@slashnephy/eslint-config 3.0.424 → 3.0.426
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 +2 -2
- package/src/base/javascript.js +4 -4
- package/src/base/javascript.ts +4 -4
- package/src/base/typescript.js +5 -5
- package/src/base/typescript.ts +5 -5
- package/src/environments/userscript.js +2 -2
- package/src/environments/userscript.ts +2 -2
- package/src/frameworks/next.js.js +6 -0
- package/src/frameworks/next.js.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slashnephy/eslint-config",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.426",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"eslint",
|
|
6
6
|
"eslintconfig"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@eslint/config-inspector": "3.3.0",
|
|
57
57
|
"@types/node": "25.9.5",
|
|
58
|
-
"eslint": "10.9.
|
|
58
|
+
"eslint": "10.9.1"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"eslint": "^10"
|
package/src/base/javascript.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import eslint from '@eslint/js';
|
|
2
|
-
import
|
|
2
|
+
import { recommended as eslintCommentsRecommended } from '@eslint-community/eslint-plugin-eslint-comments/configs';
|
|
3
3
|
import stylisticPlugin from '@stylistic/eslint-plugin';
|
|
4
4
|
import { defineConfig } from 'eslint/config';
|
|
5
5
|
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
|
|
@@ -7,7 +7,7 @@ import { createNodeResolver, importX } from 'eslint-plugin-import-x';
|
|
|
7
7
|
// @ts-expect-error 型定義ファイルがない
|
|
8
8
|
import promisePlugin from 'eslint-plugin-promise';
|
|
9
9
|
import unusedImportsPlugin from 'eslint-plugin-unused-imports';
|
|
10
|
-
import
|
|
10
|
+
import { parser as tsParser } from 'typescript-eslint';
|
|
11
11
|
export const javaScript = defineConfig({
|
|
12
12
|
files: ['**/*.cjs'],
|
|
13
13
|
languageOptions: {
|
|
@@ -24,7 +24,7 @@ export const javaScript = defineConfig({
|
|
|
24
24
|
extends: [eslint.configs.recommended],
|
|
25
25
|
languageOptions: {
|
|
26
26
|
ecmaVersion: 'latest',
|
|
27
|
-
parser:
|
|
27
|
+
parser: tsParser,
|
|
28
28
|
},
|
|
29
29
|
rules: {
|
|
30
30
|
// アロー関数を優先
|
|
@@ -149,7 +149,7 @@ export const javaScript = defineConfig({
|
|
|
149
149
|
},
|
|
150
150
|
}, {
|
|
151
151
|
name: '@eslint-community/eslint-plugin-eslint-comments',
|
|
152
|
-
extends: [
|
|
152
|
+
extends: [eslintCommentsRecommended],
|
|
153
153
|
}, {
|
|
154
154
|
name: 'eslint-plugin-import-x',
|
|
155
155
|
files: ['**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}'],
|
package/src/base/javascript.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import eslint from '@eslint/js'
|
|
2
|
-
import
|
|
2
|
+
import { recommended as eslintCommentsRecommended } from '@eslint-community/eslint-plugin-eslint-comments/configs'
|
|
3
3
|
import stylisticPlugin from '@stylistic/eslint-plugin'
|
|
4
4
|
import { defineConfig } from 'eslint/config'
|
|
5
5
|
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript'
|
|
@@ -7,7 +7,7 @@ import { createNodeResolver, importX } from 'eslint-plugin-import-x'
|
|
|
7
7
|
// @ts-expect-error 型定義ファイルがない
|
|
8
8
|
import promisePlugin from 'eslint-plugin-promise'
|
|
9
9
|
import unusedImportsPlugin from 'eslint-plugin-unused-imports'
|
|
10
|
-
import
|
|
10
|
+
import { parser as tsParser } from 'typescript-eslint'
|
|
11
11
|
|
|
12
12
|
export const javaScript = defineConfig(
|
|
13
13
|
{
|
|
@@ -29,7 +29,7 @@ export const javaScript = defineConfig(
|
|
|
29
29
|
extends: [eslint.configs.recommended],
|
|
30
30
|
languageOptions: {
|
|
31
31
|
ecmaVersion: 'latest',
|
|
32
|
-
parser:
|
|
32
|
+
parser: tsParser,
|
|
33
33
|
},
|
|
34
34
|
rules: {
|
|
35
35
|
// アロー関数を優先
|
|
@@ -156,7 +156,7 @@ export const javaScript = defineConfig(
|
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
158
|
name: '@eslint-community/eslint-plugin-eslint-comments',
|
|
159
|
-
extends: [
|
|
159
|
+
extends: [eslintCommentsRecommended],
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
162
|
name: 'eslint-plugin-import-x',
|
package/src/base/typescript.js
CHANGED
|
@@ -2,7 +2,7 @@ import safeTypeScriptPlugin from '@susisu/eslint-plugin-safe-typescript';
|
|
|
2
2
|
import { defineConfig } from 'eslint/config';
|
|
3
3
|
import { importX } from 'eslint-plugin-import-x';
|
|
4
4
|
import tsdocPlugin from 'eslint-plugin-tsdoc';
|
|
5
|
-
import
|
|
5
|
+
import { configs as tsConfigs, parser as tsParser } from 'typescript-eslint';
|
|
6
6
|
export const typeScript = defineConfig({
|
|
7
7
|
files: ['**/*.cts'],
|
|
8
8
|
languageOptions: {
|
|
@@ -17,12 +17,12 @@ export const typeScript = defineConfig({
|
|
|
17
17
|
name: 'typescript-eslint',
|
|
18
18
|
files: ['**/*.{ts,cts,mts,tsx}'],
|
|
19
19
|
extends: [
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
tsConfigs.recommendedTypeChecked,
|
|
21
|
+
tsConfigs.stylisticTypeChecked,
|
|
22
22
|
],
|
|
23
23
|
languageOptions: {
|
|
24
24
|
ecmaVersion: 'latest',
|
|
25
|
-
parser:
|
|
25
|
+
parser: tsParser,
|
|
26
26
|
parserOptions: {
|
|
27
27
|
projectService: {
|
|
28
28
|
allowDefaultProject: [
|
|
@@ -215,7 +215,7 @@ export const typeScript = defineConfig({
|
|
|
215
215
|
}, {
|
|
216
216
|
name: 'typescript-eslint (JavaScript)',
|
|
217
217
|
files: ['**/*.{js,cjs,mjs,jsx}'],
|
|
218
|
-
extends: [
|
|
218
|
+
extends: [tsConfigs.disableTypeChecked],
|
|
219
219
|
}, {
|
|
220
220
|
name: 'eslint-plugin-import-x',
|
|
221
221
|
files: ['**/*.{ts,cts,mts,tsx}'],
|
package/src/base/typescript.ts
CHANGED
|
@@ -2,7 +2,7 @@ import safeTypeScriptPlugin from '@susisu/eslint-plugin-safe-typescript'
|
|
|
2
2
|
import { defineConfig } from 'eslint/config'
|
|
3
3
|
import { importX } from 'eslint-plugin-import-x'
|
|
4
4
|
import tsdocPlugin from 'eslint-plugin-tsdoc'
|
|
5
|
-
import
|
|
5
|
+
import { configs as tsConfigs, parser as tsParser } from 'typescript-eslint'
|
|
6
6
|
|
|
7
7
|
export const typeScript = defineConfig(
|
|
8
8
|
{
|
|
@@ -22,12 +22,12 @@ export const typeScript = defineConfig(
|
|
|
22
22
|
name: 'typescript-eslint',
|
|
23
23
|
files: ['**/*.{ts,cts,mts,tsx}'],
|
|
24
24
|
extends: [
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
tsConfigs.recommendedTypeChecked,
|
|
26
|
+
tsConfigs.stylisticTypeChecked,
|
|
27
27
|
],
|
|
28
28
|
languageOptions: {
|
|
29
29
|
ecmaVersion: 'latest',
|
|
30
|
-
parser:
|
|
30
|
+
parser: tsParser,
|
|
31
31
|
parserOptions: {
|
|
32
32
|
projectService: {
|
|
33
33
|
allowDefaultProject: [
|
|
@@ -221,7 +221,7 @@ export const typeScript = defineConfig(
|
|
|
221
221
|
{
|
|
222
222
|
name: 'typescript-eslint (JavaScript)',
|
|
223
223
|
files: ['**/*.{js,cjs,mjs,jsx}'],
|
|
224
|
-
extends: [
|
|
224
|
+
extends: [tsConfigs.disableTypeChecked],
|
|
225
225
|
},
|
|
226
226
|
|
|
227
227
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineConfig } from 'eslint/config';
|
|
2
|
-
import userScriptsPlugin from 'eslint-plugin-userscripts';
|
|
2
|
+
import userScriptsPlugin, { configs as userScriptsConfigs } from 'eslint-plugin-userscripts';
|
|
3
3
|
export const userScript = defineConfig({
|
|
4
4
|
name: 'eslint-plugin-userscripts',
|
|
5
5
|
files: ['**/*.user.js'],
|
|
@@ -7,7 +7,7 @@ export const userScript = defineConfig({
|
|
|
7
7
|
userScripts: userScriptsPlugin,
|
|
8
8
|
},
|
|
9
9
|
rules: {
|
|
10
|
-
...
|
|
10
|
+
...userScriptsConfigs.recommended.rules,
|
|
11
11
|
'no-undef': 'off',
|
|
12
12
|
'xss/no-mixed-html': 'off',
|
|
13
13
|
'xss/no-location-href-assign': 'off',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineConfig } from 'eslint/config'
|
|
2
|
-
import userScriptsPlugin from 'eslint-plugin-userscripts'
|
|
2
|
+
import userScriptsPlugin, { configs as userScriptsConfigs } from 'eslint-plugin-userscripts'
|
|
3
3
|
|
|
4
4
|
export const userScript = defineConfig({
|
|
5
5
|
name: 'eslint-plugin-userscripts',
|
|
@@ -8,7 +8,7 @@ export const userScript = defineConfig({
|
|
|
8
8
|
userScripts: userScriptsPlugin,
|
|
9
9
|
},
|
|
10
10
|
rules: {
|
|
11
|
-
...
|
|
11
|
+
...userScriptsConfigs.recommended.rules,
|
|
12
12
|
'no-undef': 'off',
|
|
13
13
|
'xss/no-mixed-html': 'off',
|
|
14
14
|
'xss/no-location-href-assign': 'off',
|
|
@@ -10,7 +10,13 @@ export const nextJs = defineConfig({
|
|
|
10
10
|
'**/app/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}',
|
|
11
11
|
],
|
|
12
12
|
extends: [
|
|
13
|
+
// import-x/no-named-as-default-member は named import を勧めてくるが、
|
|
14
|
+
// このパッケージは CJS で configs を named export として公開していない。
|
|
15
|
+
// 型定義は esModuleInterop により named import を通してしまうため、
|
|
16
|
+
// 従うと tsc は通るのに実行時に SyntaxError で落ちる。
|
|
17
|
+
// eslint-disable-next-line import-x/no-named-as-default-member -- 上記のとおり従うと壊れる
|
|
13
18
|
nextPlugin.configs.recommended,
|
|
19
|
+
// eslint-disable-next-line import-x/no-named-as-default-member -- 同上
|
|
14
20
|
nextPlugin.configs['core-web-vitals'],
|
|
15
21
|
],
|
|
16
22
|
rules: {
|
|
@@ -12,7 +12,13 @@ export const nextJs = defineConfig(
|
|
|
12
12
|
'**/app/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}',
|
|
13
13
|
],
|
|
14
14
|
extends: [
|
|
15
|
+
// import-x/no-named-as-default-member は named import を勧めてくるが、
|
|
16
|
+
// このパッケージは CJS で configs を named export として公開していない。
|
|
17
|
+
// 型定義は esModuleInterop により named import を通してしまうため、
|
|
18
|
+
// 従うと tsc は通るのに実行時に SyntaxError で落ちる。
|
|
19
|
+
// eslint-disable-next-line import-x/no-named-as-default-member -- 上記のとおり従うと壊れる
|
|
15
20
|
nextPlugin.configs.recommended,
|
|
21
|
+
// eslint-disable-next-line import-x/no-named-as-default-member -- 同上
|
|
16
22
|
nextPlugin.configs['core-web-vitals'],
|
|
17
23
|
],
|
|
18
24
|
rules: {
|