@slashnephy/eslint-config 3.0.411 → 3.0.413

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slashnephy/eslint-config",
3
- "version": "3.0.411",
3
+ "version": "3.0.413",
4
4
  "keywords": [
5
5
  "eslint",
6
6
  "eslintconfig"
@@ -108,7 +108,14 @@ export const react = defineConfig(
108
108
  },
109
109
  ], {
110
110
  name: 'eslint-plugin-react-hooks',
111
- files: ['**/*.{jsx,tsx}'],
111
+ // JSX を含むファイルに限定しない。カスタムフックは JSX を返さないので `.ts` / `.js` に
112
+ // 置かれることが多く、`{jsx,tsx}` だけだとそれらが一切検査されない。
113
+ // eslint-plugin-react-hooks v7 のルールは React Compiler の診断そのもの
114
+ // (refs / immutability / preserve-manual-memoization など) であり、
115
+ // 適用漏れは「Compiler がコンパイルを諦めているのに lint は緑」という状態を生む。
116
+ // JSX 前提の eslint-plugin-react や jsx-a11y-x と違い、このプラグインは
117
+ // JSX の有無と無関係に効くべきなので、スクリプト全体を対象にする。
118
+ files: ['**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}'],
112
119
  extends: [reactHooksPlugin.configs.flat['recommended-latest']],
113
120
  rules: {
114
121
  // https://recoiljs.org/docs/introduction/installation/#eslint
@@ -110,7 +110,14 @@ export const react = defineConfig(
110
110
  ],
111
111
  {
112
112
  name: 'eslint-plugin-react-hooks',
113
- files: ['**/*.{jsx,tsx}'],
113
+ // JSX を含むファイルに限定しない。カスタムフックは JSX を返さないので `.ts` / `.js` に
114
+ // 置かれることが多く、`{jsx,tsx}` だけだとそれらが一切検査されない。
115
+ // eslint-plugin-react-hooks v7 のルールは React Compiler の診断そのもの
116
+ // (refs / immutability / preserve-manual-memoization など) であり、
117
+ // 適用漏れは「Compiler がコンパイルを諦めているのに lint は緑」という状態を生む。
118
+ // JSX 前提の eslint-plugin-react や jsx-a11y-x と違い、このプラグインは
119
+ // JSX の有無と無関係に効くべきなので、スクリプト全体を対象にする。
120
+ files: ['**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}'],
114
121
  extends: [reactHooksPlugin.configs.flat['recommended-latest']],
115
122
  rules: {
116
123
  // https://recoiljs.org/docs/introduction/installation/#eslint