Closed renovate[bot] closed 3 months ago
This PR contains the following updates:
^1.2.0
^2.0.0
📅 Schedule: Branch creation - "before 4am on the first day of the month" in timezone Asia/Tokyo, Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.
This PR contains the following updates:
^1.2.0
->^2.0.0
Release Notes
mizdra/eslint-config-mizdra (@mizdra/eslint-config-mizdra)
### [`v2.0.0`](https://togithub.com/mizdra/eslint-config-mizdra/releases/tag/v2.0.0) [Compare Source](https://togithub.com/mizdra/eslint-config-mizdra/compare/v1.2.0...v2.0.0) #### 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 を書き換えてください。 ```diff // .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 を書き換えてください。 ```diff 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 を書き換えてください。 ```diff // .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`](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin) - [`@typescript-eslint/parser`](https://www.npmjs.com/package/@typescript-eslint/parser) - [`eslint-config-prettier`](https://www.npmjs.com/package/eslint-config-prettier) - [`eslint-plugin-import`](https://www.npmjs.com/package/eslint-plugin-import) - [`eslint-plugin-react`](https://www.npmjs.com/package/eslint-plugin-react) - [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks) これらは `eslint-config-mizdra` の `peerDependencies` として管理していました。しかし `peerDependencies` だと、`eslint-config-mizdra` を利用するプロジェクトにて、上記 6 つのパッケージを `npm i` で明にインストールする必要があり、インストールの手間やパッケージの更新の手間が発生していました。 そこでこれらのパッケージを `peerDependencies` ではなく `dependencies` として管理するよう変更しました。これにより、`eslint-config-mizdra` を利用するプロジェクトにて、上記 6 つのパッケージの手動でのインストールが不要になります。すでにこれらのパッケージをインストールしているプロジェクトでは、新しいバージョンの `eslint-config-mizdra` に移行する際に、パッケージのアンインストールすることをお勧めします。 ```bash npm un @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-plugin-import eslint-plugin-react eslint-plugin-react-hooks ``` 一方で、3rd-party パッケージの管理が `dependencies` になったことで、それらのパッケージのバージョンの固定方法や、アップグレード方法が以前と変わっています。詳しくは README の「[よくある質問](https://togithub.com/mizdra/eslint-config-mizdra/tree/v2.0.0#%E3%82%88%E3%81%8F%E3%81%82%E3%82%8B%E8%B3%AA%E5%95%8F)」をご覧ください。 ##### Node.js v14 以下を drop しました Node.js v16+ 以降をお使いください。 ##### 大幅な rule の見直し 適用される rule やそのオプションを大幅に見直しました。適時コードを修正したり、無視して lint error を解消するようにしてください。合わせて https://github.com/mizdra/eslint-interactive を使うと効率的に lint error を解消できると思います。 #### What's Changed ##### Breaking Change - config の書き方を整理 by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/157](https://togithub.com/mizdra/eslint-config-mizdra/pull/157) - `@mizdra/mizdra/+typescript` で `files` 外し忘れていた by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/158](https://togithub.com/mizdra/eslint-config-mizdra/pull/158) - eslint-config/eslint-plugin/parser を peerDeps ではなく deps にする by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/165](https://togithub.com/mizdra/eslint-config-mizdra/pull/165) - 有効・無効にするルールを大幅に見直す by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/164](https://togithub.com/mizdra/eslint-config-mizdra/pull/164) - ルールの見直し by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/166](https://togithub.com/mizdra/eslint-config-mizdra/pull/166) - Node.js v14 以下を drop by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/172](https://togithub.com/mizdra/eslint-config-mizdra/pull/172) ##### Bug - `.jsx` ファイルのパースに失敗する問題を修正 by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/160](https://togithub.com/mizdra/eslint-config-mizdra/pull/160) ##### Documentation - README 更新 by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/179](https://togithub.com/mizdra/eslint-config-mizdra/pull/179) ##### Feature - `@mizdra/mizdra/+node` config を追加 by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/171](https://togithub.com/mizdra/eslint-config-mizdra/pull/171) - `@mizdra/mizdra/+node` の改善 by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/178](https://togithub.com/mizdra/eslint-config-mizdra/pull/178) ##### Refactoring - ディレクトリの整理 & テストの追加 by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/159](https://togithub.com/mizdra/eslint-config-mizdra/pull/159) - 細かいリファクタリング by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/175](https://togithub.com/mizdra/eslint-config-mizdra/pull/175) - 不必要なファイルが npm publish されないように by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/176](https://togithub.com/mizdra/eslint-config-mizdra/pull/176) ##### Maintenance - pnpm から npm に移行 by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/161](https://togithub.com/mizdra/eslint-config-mizdra/pull/161) - `lint:*:fix` script は削除 by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/163](https://togithub.com/mizdra/eslint-config-mizdra/pull/163) ##### Dependencies - chore(deps): update dependency prettier to ~2.7.1 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/133](https://togithub.com/mizdra/eslint-config-mizdra/pull/133) - chore(deps): update dependency eslint to ^8.18.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/132](https://togithub.com/mizdra/eslint-config-mizdra/pull/132) - chore(deps): update dependency eslint to ^8.20.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/134](https://togithub.com/mizdra/eslint-config-mizdra/pull/134) - chore(deps): update dependency typescript to ^4.7.4 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/135](https://togithub.com/mizdra/eslint-config-mizdra/pull/135) - chore(deps): update dependency eslint to ^8.23.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/137](https://togithub.com/mizdra/eslint-config-mizdra/pull/137) - chore(deps): update dependency typescript to ^4.8.2 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/138](https://togithub.com/mizdra/eslint-config-mizdra/pull/138) - chore(deps): update dependency typescript to ^4.8.4 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/139](https://togithub.com/mizdra/eslint-config-mizdra/pull/139) - chore(deps): update dependency eslint to ^8.24.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/140](https://togithub.com/mizdra/eslint-config-mizdra/pull/140) - chore(deps): update dependency eslint to ^8.26.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/142](https://togithub.com/mizdra/eslint-config-mizdra/pull/142) - chore(deps): update dependency eslint to ^8.28.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/143](https://togithub.com/mizdra/eslint-config-mizdra/pull/143) - chore(deps): update dependency prettier to ~2.8.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/144](https://togithub.com/mizdra/eslint-config-mizdra/pull/144) - chore(deps): update dependency prettier to ~2.8.1 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/145](https://togithub.com/mizdra/eslint-config-mizdra/pull/145) - chore(deps): update dependency eslint to ^8.31.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/146](https://togithub.com/mizdra/eslint-config-mizdra/pull/146) - chore(deps): update dependency prettier to ~2.8.3 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/147](https://togithub.com/mizdra/eslint-config-mizdra/pull/147) - chore(deps): update dependency eslint to ^8.33.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/148](https://togithub.com/mizdra/eslint-config-mizdra/pull/148) - chore(deps): update dependency prettier to ~2.8.4 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/149](https://togithub.com/mizdra/eslint-config-mizdra/pull/149) - chore(deps): update dependency eslint to ^8.35.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/150](https://togithub.com/mizdra/eslint-config-mizdra/pull/150) - chore(deps): update dependency prettier to ~2.8.7 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/151](https://togithub.com/mizdra/eslint-config-mizdra/pull/151) - chore(deps): update dependency eslint to ^8.37.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/152](https://togithub.com/mizdra/eslint-config-mizdra/pull/152) - chore(deps): update dependency eslint-config-prettier to ^8.8.0 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/153](https://togithub.com/mizdra/eslint-config-mizdra/pull/153) - chore(deps): update dependency eslint-plugin-import to ^2.27.5 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/154](https://togithub.com/mizdra/eslint-config-mizdra/pull/154) - chore(deps): update dependency typescript to ^4.9.5 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/155](https://togithub.com/mizdra/eslint-config-mizdra/pull/155) - chore(deps): update dependency typescript to v5 by [@renovate](https://togithub.com/renovate) in [https://github.com/mizdra/eslint-config-mizdra/pull/156](https://togithub.com/mizdra/eslint-config-mizdra/pull/156) ##### Other Changes - `import/no-extraneous-dependencies` を有効化 by [@mizdra](https://togithub.com/mizdra) in [https://github.com/mizdra/eslint-config-mizdra/pull/170](https://togithub.com/mizdra/eslint-config-mizdra/pull/170) **Full Changelog**: https://github.com/mizdra/eslint-config-mizdra/compare/v1.2.0...v2.0.0Configuration
📅 Schedule: Branch creation - "before 4am on the first day of the month" in timezone Asia/Tokyo, Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.