@slashnephy/eslint-config 3.0.112 → 3.0.114

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.112",
3
+ "version": "3.0.114",
4
4
  "keywords": [
5
5
  "eslint",
6
6
  "eslintconfig"
@@ -218,24 +218,15 @@ export const javaScript = defineConfig({
218
218
  rules: {
219
219
  // 不要 import 文を禁止
220
220
  'unused-imports/no-unused-imports': 'error',
221
- // 不要な変数を禁止
222
- 'no-unused-vars': 'off',
223
- '@typescript-eslint/no-unused-vars': 'off',
224
- 'unused-imports/no-unused-vars': [
225
- 'warn',
226
- // '_' で始まる変数を許可
227
- {
228
- vars: 'all',
229
- varsIgnorePattern: '^_',
230
- args: 'after-used',
231
- argsIgnorePattern: '^_',
232
- },
233
- ],
221
+ 'unused-imports/no-unused-vars': 'off',
234
222
  },
235
223
  }, {
236
224
  name: 'eslint-plugin-promise',
237
225
  files: ['**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}'],
238
226
  extends: [promisePlugin.configs['flat/recommended']],
227
+ rules: {
228
+ 'promise/always-return': ['error', { ignoreLastCallback: true }],
229
+ },
239
230
  }, {
240
231
  name: 'eslint-plugin-xss',
241
232
  files: ['**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}'],
@@ -227,25 +227,16 @@ export const javaScript = defineConfig(
227
227
  rules: {
228
228
  // 不要 import 文を禁止
229
229
  'unused-imports/no-unused-imports': 'error',
230
- // 不要な変数を禁止
231
- 'no-unused-vars': 'off',
232
- '@typescript-eslint/no-unused-vars': 'off',
233
- 'unused-imports/no-unused-vars': [
234
- 'warn',
235
- // '_' で始まる変数を許可
236
- {
237
- vars: 'all',
238
- varsIgnorePattern: '^_',
239
- args: 'after-used',
240
- argsIgnorePattern: '^_',
241
- },
242
- ],
230
+ 'unused-imports/no-unused-vars': 'off',
243
231
  },
244
232
  },
245
233
  {
246
234
  name: 'eslint-plugin-promise',
247
235
  files: ['**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}'],
248
236
  extends: [promisePlugin.configs['flat/recommended']],
237
+ rules: {
238
+ 'promise/always-return': ['error', { ignoreLastCallback: true }],
239
+ },
249
240
  },
250
241
  {
251
242
  name: 'eslint-plugin-xss',
@@ -193,6 +193,20 @@ export const typeScript = defineConfig({
193
193
  '@typescript-eslint/no-deprecated': 'error',
194
194
  // 関数の返り値としての void 以外を禁止
195
195
  '@typescript-eslint/no-invalid-void-type': 'error',
196
+ // 不要な変数を禁止
197
+ 'no-unused-vars': 'off',
198
+ '@typescript-eslint/no-unused-vars': [
199
+ 'warn', {
200
+ // '_' で始まる変数を許可
201
+ args: 'all',
202
+ argsIgnorePattern: '^_',
203
+ caughtErrors: 'all',
204
+ caughtErrorsIgnorePattern: '^_',
205
+ destructuredArrayIgnorePattern: '^_',
206
+ varsIgnorePattern: '^_',
207
+ ignoreRestSiblings: true,
208
+ },
209
+ ],
196
210
  },
197
211
  }, {
198
212
  name: 'eslint-plugin-import-x',
@@ -198,6 +198,20 @@ export const typeScript = defineConfig(
198
198
  '@typescript-eslint/no-deprecated': 'error',
199
199
  // 関数の返り値としての void 以外を禁止
200
200
  '@typescript-eslint/no-invalid-void-type': 'error',
201
+ // 不要な変数を禁止
202
+ 'no-unused-vars': 'off',
203
+ '@typescript-eslint/no-unused-vars': [
204
+ 'warn', {
205
+ // '_' で始まる変数を許可
206
+ args: 'all',
207
+ argsIgnorePattern: '^_',
208
+ caughtErrors: 'all',
209
+ caughtErrorsIgnorePattern: '^_',
210
+ destructuredArrayIgnorePattern: '^_',
211
+ varsIgnorePattern: '^_',
212
+ ignoreRestSiblings: true,
213
+ },
214
+ ],
201
215
  },
202
216
  },
203
217
  {
@@ -1,5 +1,6 @@
1
1
  import nextPlugin from '@next/eslint-plugin-next';
2
2
  import { defineConfig } from 'eslint/config';
3
+ import reactRefreshPlugin from 'eslint-plugin-react-refresh';
3
4
  export const nextJs = defineConfig({
4
5
  name: '@next/eslint-plugin-next',
5
6
  files: [
@@ -14,7 +15,15 @@ export const nextJs = defineConfig({
14
15
  ],
15
16
  rules: {
16
17
  'import-x/no-default-export': 'off',
17
- 'react-refresh/only-export-components': 'off',
18
18
  },
19
19
  ignores: ['**/.next/**'],
20
+ }, {
21
+ name: 'eslint-plugin-react-refresh',
22
+ files: [
23
+ // Pages Router
24
+ '**/pages/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}',
25
+ // App Router
26
+ '**/app/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}',
27
+ ],
28
+ extends: [reactRefreshPlugin.configs.next],
20
29
  });
@@ -1,21 +1,33 @@
1
1
  import nextPlugin from '@next/eslint-plugin-next'
2
2
  import { defineConfig } from 'eslint/config'
3
+ import reactRefreshPlugin from 'eslint-plugin-react-refresh'
3
4
 
4
- export const nextJs = defineConfig({
5
- name: '@next/eslint-plugin-next',
6
- files: [
5
+ export const nextJs = defineConfig(
6
+ {
7
+ name: '@next/eslint-plugin-next',
8
+ files: [
7
9
  // Pages Router
8
- '**/pages/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}',
9
- // App Router
10
- '**/app/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}',
11
- ],
12
- extends: [
13
- nextPlugin.configs.recommended,
14
- nextPlugin.configs['core-web-vitals'],
15
- ],
16
- rules: {
17
- 'import-x/no-default-export': 'off',
18
- 'react-refresh/only-export-components': 'off',
10
+ '**/pages/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}',
11
+ // App Router
12
+ '**/app/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}',
13
+ ],
14
+ extends: [
15
+ nextPlugin.configs.recommended,
16
+ nextPlugin.configs['core-web-vitals'],
17
+ ],
18
+ rules: {
19
+ 'import-x/no-default-export': 'off',
20
+ },
21
+ ignores: ['**/.next/**'],
19
22
  },
20
- ignores: ['**/.next/**'],
21
- })
23
+ {
24
+ name: 'eslint-plugin-react-refresh',
25
+ files: [
26
+ // Pages Router
27
+ '**/pages/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}',
28
+ // App Router
29
+ '**/app/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}',
30
+ ],
31
+ extends: [reactRefreshPlugin.configs.next],
32
+ },
33
+ )
@@ -3,7 +3,6 @@ import { defineConfig } from 'eslint/config';
3
3
  import jsxA11y from 'eslint-plugin-jsx-a11y';
4
4
  import reactPlugin from 'eslint-plugin-react';
5
5
  import reactHooksPlugin from 'eslint-plugin-react-hooks';
6
- import reactRefreshPlugin from 'eslint-plugin-react-refresh';
7
6
  import globals from 'globals';
8
7
  export const react = defineConfig([
9
8
  {
@@ -121,8 +120,4 @@ export const react = defineConfig([
121
120
  },
122
121
  ],
123
122
  },
124
- }, {
125
- name: 'eslint-plugin-react-refresh',
126
- files: ['**/*.{jsx,tsx}'],
127
- extends: [reactRefreshPlugin.configs.recommended],
128
123
  });
@@ -3,7 +3,6 @@ import { defineConfig } from 'eslint/config'
3
3
  import jsxA11y from 'eslint-plugin-jsx-a11y'
4
4
  import reactPlugin from 'eslint-plugin-react'
5
5
  import reactHooksPlugin from 'eslint-plugin-react-hooks'
6
- import reactRefreshPlugin from 'eslint-plugin-react-refresh'
7
6
  import globals from 'globals'
8
7
 
9
8
  export const react = defineConfig(
@@ -126,9 +125,4 @@ export const react = defineConfig(
126
125
  ],
127
126
  },
128
127
  },
129
- {
130
- name: 'eslint-plugin-react-refresh',
131
- files: ['**/*.{jsx,tsx}'],
132
- extends: [reactRefreshPlugin.configs.recommended],
133
- },
134
128
  )
package/src/index.js CHANGED
@@ -35,10 +35,10 @@ export function config(options, ...overrides) {
35
35
  [
36
36
  // React
37
37
  react,
38
- // Next.js
39
- nextJs,
40
38
  // Vite
41
39
  vite,
40
+ // Next.js
41
+ nextJs,
42
42
  // Relay
43
43
  relay,
44
44
  // Storybook
package/src/index.ts CHANGED
@@ -43,10 +43,10 @@ export function config(options?: Options, ...overrides: ConfigWithExtends[]): Co
43
43
  [
44
44
  // React
45
45
  react,
46
- // Next.js
47
- nextJs,
48
46
  // Vite
49
47
  vite,
48
+ // Next.js
49
+ nextJs,
50
50
  // Relay
51
51
  relay,
52
52
  // Storybook