chore(deps): update dependency @mizdra/eslint-config-mizdra to v2 #119
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^1.2.0->^2.0.0Release Notes
mizdra/eslint-config-mizdra (@mizdra/eslint-config-mizdra)
v2.0.0Compare Source
Breaking Changes
@mizdra/mizdraにて、ECMAScript 2021 をゼロコンフィグで lint できる設定を廃止しました以前 の
@mizdra/mizdraは ECMAScript 2021 で書かれたアプリケーションをゼロコンフィグで lint できるよう、parserOptions: { ecmaVersion: 2021 }とenv: { es2021: true }を設定していました。しかし、利用する ECMAScript のバージョンはアプリケーションごとに異なるため、アプリケーション側で明示的に ECMAScript バージョンが指定するのが望ましいと考えています。そこで
@mizdra/mizdraでparserOptions: { ecmaVersion: 2021 }とenv: { es2021: true }を自動で設定する挙動を廃止しました。以前と同じ挙動にするには、以下のように config を書き換えてください。
// .eslintrc.js module.exports = { root: true, extends: ['@​mizdra/mizdra'], // 以下の 2 行を追加 + parserOptions: { ecmaVersion: 2021 }, + env: { es2021: true }, // ... };すでに上記設定を明示的にしているアプリケーションや、
parserOptions: { ecmaVersion: 2022 }やenv: { es2022: true }のような上位互換の設定がされているアプリケーションでは、この変更による影響は受けません。@mizdra/mizdra/+typescriptの適用範囲をfilesオプションで絞り込む挙動を廃止しました以前 の
@mizdra/mizdra/+typescriptは TypeScript ファイルにのみ config の設定が反映されるよう、files: ['*.ts', '*.tsx', '*.cts', '*.mts']で制限をしていました。しかし、config 側で適用対象のファイルを決め打ちしているため、上記の適用範囲以外のファイルに config を適用できないという問題がありました。また、config の利用側からは、適用範囲のルールが隠れているため、混乱を招きがちでした。そこで
@mizdra/mizdra/+typescriptの適用範囲をfilesオプションで絞り込む挙動を廃止しました。以前と同じ挙動にするには、以下のように config を書き換えてください。
module.exports = { root: true, // 最も外側にある `extends` からは、`@mizdra/mizdra/+typescript` を削除する - extends: ['@​mizdra/mizdra', '@​mizdra/mizdra/+typescript', '@​mizdra/mizdra/+prettier'], + extends: ['@​mizdra/mizdra', '@​mizdra/mizdra/+prettier'], // ... overrides: [ { // `files` を指定しつつ、`extends` で `@mizdra/mizdra/+typescript` を継承する。 // prettier を使っている場合は、`@mizdra/mizdra/+prettier` も継承する。 + files: ['*.ts', '*.tsx', '*.cts', '*.mts'], + extends: ['@​mizdra/mizdra/+typescript', '@​mizdra/mizdra/+prettier'], rules: { // ... }, }, ], };@mizdra/mizdra/+reactでenv: { browser: true }を設定する挙動を廃止しました以前 の
@mizdra/mizdra/+reactは、config の利用側が書く設定が少なくなるよう、env: { browser: true }を自動で設定していました。React は多くの場合、ブラウザ上で実行されるライブラリですが、非ブラウザ環境でも実行できます。そのため、env: { browser: true }を決め打ちで設定する挙動を廃止しました。以前と同じ挙動にするには、以下のように config を書き換えてください。
// .eslintrc.js module.exports = { root: true, extends: ['@​mizdra/mizdra', '@​mizdra/mizdra/+react'], parserOptions: { ecmaVersion: 2021 }, env: { es2021: true, // 以下の行を追加 + browser: true, }, // ... };eslint-config-mizdraが依存している eslint-config や eslint-plugin がpeerDependenciesからdependenciesに変更されました以前の
eslint-config-mizdraは以下の 6 つの 3rd-party パッケージに依存していました。@typescript-eslint/eslint-plugin@typescript-eslint/parsereslint-config-prettiereslint-plugin-importeslint-plugin-reacteslint-plugin-react-hooksこれらは
eslint-config-mizdraのpeerDependenciesとして管理していました。しかしpeerDependenciesだと、eslint-config-mizdraを利用するプロジェクトにて、上記 6 つのパッケージをnpm iで明にインストールする必要があり、インストールの手間やパッケージの更新の手間が発生していました。そこでこれらのパッケージを
peerDependenciesではなくdependenciesとして管理するよう変更しました。これにより、eslint-config-mizdraを利用するプロジェクトにて、上記 6 つのパッケージの手動でのインストールが不要になります。すでにこれらのパッケージをインストールしているプロジェクトでは、新しいバージョンのeslint-config-mizdraに移行する際に、パッケージのアンインストールすることをお勧めします。一方で、3rd-party パッケージの管理が
dependenciesになったことで、それらのパッケージのバージョンの固定方法や、アップグレード方法が以前と変わっています。詳しくは README の「よくある質問」をご覧ください。Node.js v14 以下を drop しました
Node.js v16+ 以降をお使いください。
大幅な rule の見直し
適用される rule やそのオプションを大幅に見直しました。適時コードを修正したり、無視して lint error を解消するようにしてください。合わせて https://github.com/mizdra/eslint-interactive を使うと効率的に lint error を解消できると思います。
What's Changed
Breaking Change
@mizdra/mizdra/+typescriptでfiles外し忘れていた by @mizdra in https://github.com/mizdra/eslint-config-mizdra/pull/158Bug
.jsxファイルのパースに失敗する問題を修正 by @mizdra in https://github.com/mizdra/eslint-config-mizdra/pull/160Documentation
Feature
@mizdra/mizdra/+nodeconfig を追加 by @mizdra in https://github.com/mizdra/eslint-config-mizdra/pull/171@mizdra/mizdra/+nodeの改善 by @mizdra in https://github.com/mizdra/eslint-config-mizdra/pull/178Refactoring
Maintenance
lint:*:fixscript は削除 by @mizdra in https://github.com/mizdra/eslint-config-mizdra/pull/163Dependencies
Other Changes
import/no-extraneous-dependenciesを有効化 by @mizdra in https://github.com/mizdra/eslint-config-mizdra/pull/170Full Changelog: mizdra/eslint-config-mizdra@v1.2.0...v2.0.0
Configuration
📅 Schedule: Branch creation - "* 0-3 1 * *" in timezone Asia/Tokyo, Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.