Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented May 31, 2023

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@mizdra/eslint-config-mizdra ^1.2.0 -> ^2.0.0 age adoption passing confidence

Release Notes

mizdra/eslint-config-mizdra (@​mizdra/eslint-config-mizdra)

v2.0.0

Compare Source

Breaking Changes

@mizdra/mizdra にて、ECMAScript 2021 をゼロコンフィグで lint できる設定を廃止しました

以前 の @mizdra/mizdra は ECMAScript 2021 で書かれたアプリケーションをゼロコンフィグで lint できるよう、parserOptions: { ecmaVersion: 2021 }env: { es2021: true } を設定していました。しかし、利用する ECMAScript のバージョンはアプリケーションごとに異なるため、アプリケーション側で明示的に ECMAScript バージョンが指定するのが望ましいと考えています。

そこで @mizdra/mizdraparserOptions: { 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/+reactenv: { 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 パッケージに依存していました。

これらは eslint-config-mizdrapeerDependencies として管理していました。しかし peerDependencies だと、eslint-config-mizdra を利用するプロジェクトにて、上記 6 つのパッケージを npm i で明にインストールする必要があり、インストールの手間やパッケージの更新の手間が発生していました。

そこでこれらのパッケージを peerDependencies ではなく dependencies として管理するよう変更しました。これにより、eslint-config-mizdra を利用するプロジェクトにて、上記 6 つのパッケージの手動でのインストールが不要になります。すでにこれらのパッケージをインストールしているプロジェクトでは、新しいバージョンの eslint-config-mizdra に移行する際に、パッケージのアンインストールすることをお勧めします。

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 の「よくある質問」をご覧ください。

Node.js v14 以下を drop しました

Node.js v16+ 以降をお使いください。

大幅な rule の見直し

適用される rule やそのオプションを大幅に見直しました。適時コードを修正したり、無視して lint error を解消するようにしてください。合わせて https://github.com/mizdra/eslint-interactive を使うと効率的に lint error を解消できると思います。

What's Changed

Breaking Change
Bug
Documentation
Feature
Refactoring
Maintenance
Dependencies
Other Changes

Full 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added renovate Type: Dependencies Dependency issues or Changes to dependency files labels May 31, 2023
@renovate renovate bot force-pushed the renovate/mizdra-eslint-config-mizdra-2.x branch 3 times, most recently from 35bda46 to e7860a6 Compare May 31, 2023 22:42
@renovate renovate bot force-pushed the renovate/mizdra-eslint-config-mizdra-2.x branch 3 times, most recently from 62e5b24 to cd82f1b Compare July 1, 2023 02:54
@renovate renovate bot force-pushed the renovate/mizdra-eslint-config-mizdra-2.x branch 3 times, most recently from 1516070 to 4fdea4e Compare August 1, 2023 08:10
@renovate renovate bot force-pushed the renovate/mizdra-eslint-config-mizdra-2.x branch 4 times, most recently from d0581c3 to 2008eaf Compare September 1, 2023 03:02
@renovate renovate bot force-pushed the renovate/mizdra-eslint-config-mizdra-2.x branch from 2008eaf to 4bf85b8 Compare September 30, 2023 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

renovate Type: Dependencies Dependency issues or Changes to dependency files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant