eslint-config-decent 2.8.64 → 2.8.65
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/README.md +0 -15
- package/dist/index.cjs +36 -23
- package/dist/index.d.cts +23 -25
- package/dist/index.d.mts +23 -25
- package/dist/index.d.ts +23 -25
- package/dist/index.mjs +37 -23
- package/package.json +21 -21
- package/src/eslint.ts +4 -4
- package/src/extension.ts +2 -2
- package/src/import.ts +3 -3
- package/src/index.ts +15 -14
- package/src/jest.ts +2 -2
- package/src/jsdoc.ts +2 -2
- package/src/mocha.ts +2 -2
- package/src/nextjs.ts +3 -3
- package/src/promise.ts +2 -2
- package/src/react.ts +3 -5
- package/src/rules/requireExtensionRule.ts +21 -18
- package/src/rules/requireIndexRule.ts +23 -20
- package/src/security.ts +2 -2
- package/src/stylistic.ts +2 -2
- package/src/testingLibrary.ts +2 -2
- package/src/types/eslint-plugin-jest-dom.d.ts +4 -4
- package/src/types/eslint-plugin-jest.d.ts +5 -5
- package/src/types/eslint-plugin-jsx-a11y.d.ts +3 -3
- package/src/types/eslint-plugin-mocha.d.ts +3 -3
- package/src/types/eslint-plugin-next.d.ts +4 -4
- package/src/types/eslint-plugin-promise.d.ts +2 -2
- package/src/types/eslint-plugin-react-hooks.d.ts +2 -2
- package/src/types/eslint-plugin-react.d.ts +5 -5
- package/src/types/eslint-plugin-security.d.ts +2 -2
- package/src/types/eslint-plugin-testing-library.d.ts +6 -6
- package/src/types/eslint-plugin-unicorn.d.ts +2 -2
- package/src/typescriptEslint.ts +2 -2
- package/src/unicorn.ts +2 -2
- package/src/vitest.ts +3 -3
- package/src/types/eslint-js.d.ts +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-decent",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.65",
|
|
4
4
|
"description": "A decent ESLint configuration",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -66,47 +66,47 @@
|
|
|
66
66
|
"node": ">=20.11.0"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@eslint/compat": "1.
|
|
70
|
-
"@eslint/js": "9.
|
|
71
|
-
"@next/eslint-plugin-next": "15.4
|
|
72
|
-
"@stylistic/eslint-plugin": "5.
|
|
73
|
-
"@
|
|
74
|
-
"@vitest/eslint-plugin": "1.3.4",
|
|
69
|
+
"@eslint/compat": "1.4.0",
|
|
70
|
+
"@eslint/js": "9.36.0",
|
|
71
|
+
"@next/eslint-plugin-next": "15.5.4",
|
|
72
|
+
"@stylistic/eslint-plugin": "5.4.0",
|
|
73
|
+
"@vitest/eslint-plugin": "1.3.15",
|
|
75
74
|
"eslint-config-prettier": "10.1.8",
|
|
76
75
|
"eslint-plugin-import-x": "4.16.1",
|
|
77
76
|
"eslint-plugin-jest": "29.0.1",
|
|
78
77
|
"eslint-plugin-jest-dom": "5.5.0",
|
|
79
|
-
"eslint-plugin-jsdoc": "
|
|
78
|
+
"eslint-plugin-jsdoc": "60.7.1",
|
|
80
79
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
81
|
-
"eslint-plugin-mocha": "11.
|
|
80
|
+
"eslint-plugin-mocha": "11.2.0",
|
|
82
81
|
"eslint-plugin-prettier": "5.5.4",
|
|
83
82
|
"eslint-plugin-promise": "7.2.1",
|
|
84
83
|
"eslint-plugin-react": "7.37.5",
|
|
85
|
-
"eslint-plugin-react-hooks": "
|
|
84
|
+
"eslint-plugin-react-hooks": "6.1.0",
|
|
86
85
|
"eslint-plugin-security": "3.0.1",
|
|
87
|
-
"eslint-plugin-testing-library": "7.
|
|
88
|
-
"eslint-plugin-unicorn": "
|
|
89
|
-
"globals": "16.
|
|
90
|
-
"typescript-eslint": "8.
|
|
86
|
+
"eslint-plugin-testing-library": "7.11.0",
|
|
87
|
+
"eslint-plugin-unicorn": "61.0.2",
|
|
88
|
+
"globals": "16.4.0",
|
|
89
|
+
"typescript-eslint": "8.45.0"
|
|
91
90
|
},
|
|
92
91
|
"devDependencies": {
|
|
92
|
+
"@eslint/config-helpers": "0.4.0",
|
|
93
93
|
"@semantic-release/changelog": "6.0.3",
|
|
94
94
|
"@semantic-release/commit-analyzer": "13.0.1",
|
|
95
95
|
"@semantic-release/git": "10.0.1",
|
|
96
|
-
"@semantic-release/github": "11.0.
|
|
96
|
+
"@semantic-release/github": "11.0.6",
|
|
97
97
|
"@semantic-release/npm": "12.0.2",
|
|
98
|
-
"@semantic-release/release-notes-generator": "14.0
|
|
99
|
-
"@swc/core": "1.13.
|
|
98
|
+
"@semantic-release/release-notes-generator": "14.1.0",
|
|
99
|
+
"@swc/core": "1.13.5",
|
|
100
100
|
"@types/node": ">=22",
|
|
101
|
-
"eslint": "9.
|
|
101
|
+
"eslint": "9.36.0",
|
|
102
102
|
"husky": "9.1.7",
|
|
103
|
-
"lint-staged": "16.
|
|
103
|
+
"lint-staged": "16.2.3",
|
|
104
104
|
"markdownlint-cli": "0.45.0",
|
|
105
105
|
"npm-run-all2": "8.0.4",
|
|
106
106
|
"pinst": "3.0.0",
|
|
107
107
|
"prettier": "3.6.2",
|
|
108
|
-
"semantic-release": "24.2.
|
|
109
|
-
"typescript": "5.9.
|
|
108
|
+
"semantic-release": "24.2.9",
|
|
109
|
+
"typescript": "5.9.3",
|
|
110
110
|
"unbuild": "3.6.1"
|
|
111
111
|
},
|
|
112
112
|
"overrides": {
|
package/src/eslint.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ConfigWithExtends } from '@eslint/config-helpers';
|
|
2
2
|
|
|
3
|
-
const base:
|
|
3
|
+
const base: ConfigWithExtends = {
|
|
4
4
|
rules: {
|
|
5
5
|
'array-callback-return': ['error', { allowImplicit: true }],
|
|
6
6
|
'block-scoped-var': 'error',
|
|
@@ -170,7 +170,7 @@ const base: TSESLint.FlatConfig.Config = {
|
|
|
170
170
|
},
|
|
171
171
|
};
|
|
172
172
|
|
|
173
|
-
const cjsAndEsm:
|
|
173
|
+
const cjsAndEsm: ConfigWithExtends = {
|
|
174
174
|
rules: {
|
|
175
175
|
curly: ['error', 'multi-line'],
|
|
176
176
|
'dot-notation': ['error', { allowKeywords: true }],
|
|
@@ -202,7 +202,7 @@ const cjsAndEsm: TSESLint.FlatConfig.Config = {
|
|
|
202
202
|
},
|
|
203
203
|
};
|
|
204
204
|
|
|
205
|
-
const cjs:
|
|
205
|
+
const cjs: ConfigWithExtends = {
|
|
206
206
|
rules: {
|
|
207
207
|
strict: ['error', 'global'],
|
|
208
208
|
},
|
package/src/extension.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ConfigWithExtends } from '@eslint/config-helpers';
|
|
2
2
|
|
|
3
3
|
import { requireExtensionRule } from './rules/requireExtensionRule.js';
|
|
4
4
|
import { requireIndexRule } from './rules/requireIndexRule.js';
|
|
5
5
|
|
|
6
|
-
const base:
|
|
6
|
+
const base: ConfigWithExtends = {
|
|
7
7
|
plugins: {
|
|
8
8
|
'decent-extension': {
|
|
9
9
|
meta: {
|
package/src/import.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Config, Plugin } from '@eslint/config-helpers';
|
|
2
2
|
import importPlugin from 'eslint-plugin-import-x';
|
|
3
3
|
|
|
4
|
-
const base:
|
|
4
|
+
const base: Config = {
|
|
5
5
|
plugins: {
|
|
6
|
-
import: importPlugin,
|
|
6
|
+
import: importPlugin as unknown as Plugin,
|
|
7
7
|
},
|
|
8
8
|
rules: {
|
|
9
9
|
'import/order': [
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { Config, ConfigWithExtends } from '@eslint/config-helpers';
|
|
1
2
|
import eslint from '@eslint/js';
|
|
2
|
-
import
|
|
3
|
+
import { defineConfig } from 'eslint/config';
|
|
3
4
|
import prettier from 'eslint-plugin-prettier/recommended';
|
|
4
5
|
import globals from 'globals';
|
|
5
|
-
import tsEslint
|
|
6
|
+
import tsEslint from 'typescript-eslint';
|
|
6
7
|
|
|
7
8
|
import { configs as eslintConfigs } from './eslint.js';
|
|
8
9
|
import { configs as extensionConfigs } from './extension.js';
|
|
@@ -51,16 +52,16 @@ export interface DefaultConfigOptions {
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
/**
|
|
54
|
-
*
|
|
55
|
-
*/
|
|
56
|
-
export const defaultConfig = tsEslintConfig;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Exports the default configuration to be passed to `tsEslint.config`. Use this if you want more control of typescript-eslint configuration output.
|
|
55
|
+
* Exports the default configuration to be passed to `defineConfig` from eslint. Use this if you want more control of the configuration output.
|
|
60
56
|
* @param {DefaultConfigOptions} options
|
|
61
57
|
* @returns Array of typescript-eslint configurations
|
|
58
|
+
* @deprecated Will be removed in the future
|
|
62
59
|
*/
|
|
63
60
|
export function tsEslintConfig(options?: DefaultConfigOptions): ConfigWithExtends[] {
|
|
61
|
+
return decentConfig(options);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function decentConfig(options?: DefaultConfigOptions): ConfigWithExtends[] {
|
|
64
65
|
const enableRequireExtensionRule = options?.enableRequireExtensionRule ?? true;
|
|
65
66
|
const enableJest = options?.enableJest ?? true;
|
|
66
67
|
const enableVitest = options?.enableVitest ?? true;
|
|
@@ -77,7 +78,7 @@ export function tsEslintConfig(options?: DefaultConfigOptions): ConfigWithExtend
|
|
|
77
78
|
defaultProject: 'tsconfig.json',
|
|
78
79
|
},
|
|
79
80
|
tsconfigRootDir: options?.tsconfigRootDir ?? import.meta.dirname,
|
|
80
|
-
...options?.parserOptions,
|
|
81
|
+
...(options?.parserOptions as Record<string, unknown> | undefined),
|
|
81
82
|
},
|
|
82
83
|
};
|
|
83
84
|
|
|
@@ -88,7 +89,7 @@ export function tsEslintConfig(options?: DefaultConfigOptions): ConfigWithExtend
|
|
|
88
89
|
eslint.configs.recommended,
|
|
89
90
|
{
|
|
90
91
|
languageOptions: {
|
|
91
|
-
...tsEslint.configs.base.languageOptions,
|
|
92
|
+
...(tsEslint.configs.base as Config).languageOptions,
|
|
92
93
|
},
|
|
93
94
|
},
|
|
94
95
|
{
|
|
@@ -154,7 +155,7 @@ export function tsEslintConfig(options?: DefaultConfigOptions): ConfigWithExtend
|
|
|
154
155
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
155
156
|
},
|
|
156
157
|
},
|
|
157
|
-
] as
|
|
158
|
+
] as Config[])
|
|
158
159
|
: []),
|
|
159
160
|
...(enableNextJs
|
|
160
161
|
? [
|
|
@@ -231,7 +232,7 @@ export function tsEslintConfig(options?: DefaultConfigOptions): ConfigWithExtend
|
|
|
231
232
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
232
233
|
},
|
|
233
234
|
},
|
|
234
|
-
] as
|
|
235
|
+
] as Config[])
|
|
235
236
|
: []),
|
|
236
237
|
{
|
|
237
238
|
...stylisticConfigs.base,
|
|
@@ -261,6 +262,6 @@ export function tsEslintConfig(options?: DefaultConfigOptions): ConfigWithExtend
|
|
|
261
262
|
* @param {object} options
|
|
262
263
|
* @returns An array of eslint configurations
|
|
263
264
|
*/
|
|
264
|
-
export function config(options?: DefaultConfigOptions):
|
|
265
|
-
return
|
|
265
|
+
export function config(options?: DefaultConfigOptions): Config[] {
|
|
266
|
+
return defineConfig(...decentConfig(options));
|
|
266
267
|
}
|
package/src/jest.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Config } from '@eslint/config-helpers';
|
|
2
2
|
import jest from 'eslint-plugin-jest';
|
|
3
3
|
import jestDom from 'eslint-plugin-jest-dom';
|
|
4
4
|
|
|
5
|
-
const base:
|
|
5
|
+
const base: Config = {
|
|
6
6
|
plugins: {
|
|
7
7
|
jest,
|
|
8
8
|
'jest-dom': jestDom,
|
package/src/jsdoc.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Config } from '@eslint/config-helpers';
|
|
2
2
|
import jsdoc from 'eslint-plugin-jsdoc';
|
|
3
3
|
|
|
4
|
-
const base:
|
|
4
|
+
const base: Config = {
|
|
5
5
|
settings: {
|
|
6
6
|
jsdoc: {
|
|
7
7
|
preferredTypes: {
|
package/src/mocha.ts
CHANGED
package/src/nextjs.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { FixupPluginDefinition } from '@eslint/compat';
|
|
2
2
|
import { fixupPluginRules } from '@eslint/compat';
|
|
3
|
+
import type { Config, RuleConfig } from '@eslint/config-helpers';
|
|
3
4
|
import nextJs from '@next/eslint-plugin-next';
|
|
4
|
-
import type { TSESLint } from '@typescript-eslint/utils';
|
|
5
5
|
|
|
6
|
-
const recommendedRules: Record<string,
|
|
6
|
+
const recommendedRules: Record<string, RuleConfig> = {};
|
|
7
7
|
|
|
8
8
|
for (const ruleName of Object.keys({ ...nextJs.configs.recommended.rules })) {
|
|
9
9
|
recommendedRules[ruleName] = 'error';
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
const base:
|
|
12
|
+
const base: Config = {
|
|
13
13
|
plugins: {
|
|
14
14
|
'@next/next': fixupPluginRules(nextJs as FixupPluginDefinition),
|
|
15
15
|
},
|
package/src/promise.ts
CHANGED
package/src/react.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { fixupPluginRules } from '@eslint/compat';
|
|
3
|
-
import type { TSESLint } from '@typescript-eslint/utils';
|
|
1
|
+
import type { Config } from '@eslint/config-helpers';
|
|
4
2
|
import a11y from 'eslint-plugin-jsx-a11y';
|
|
5
3
|
import react from 'eslint-plugin-react';
|
|
6
4
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
7
5
|
|
|
8
|
-
const base:
|
|
6
|
+
const base: Config = {
|
|
9
7
|
settings: {
|
|
10
8
|
react: {
|
|
11
9
|
version: 'detect',
|
|
@@ -18,7 +16,7 @@ const base: TSESLint.FlatConfig.Config = {
|
|
|
18
16
|
plugins: {
|
|
19
17
|
'jsx-a11y': a11y,
|
|
20
18
|
react,
|
|
21
|
-
'react-hooks':
|
|
19
|
+
'react-hooks': reactHooks,
|
|
22
20
|
},
|
|
23
21
|
rules: {
|
|
24
22
|
...a11y.configs.recommended.rules,
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { dirname, resolve } from 'node:path';
|
|
3
3
|
|
|
4
|
-
import type {
|
|
5
|
-
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
4
|
+
import type { Rule } from 'eslint';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
type MessageIds = 'requireExtension';
|
|
9
|
-
|
|
10
|
-
export const requireExtensionRule = ESLintUtils.RuleCreator(() => 'https://github.com/jgeurts/eslint-config-decent/tree/main/src/rules/requireExtensionRule.ts')<Options, MessageIds>({
|
|
11
|
-
name: 'require-extension',
|
|
6
|
+
export const requireExtensionRule: Rule.RuleModule = {
|
|
12
7
|
meta: {
|
|
13
8
|
type: 'suggestion',
|
|
14
9
|
docs: {
|
|
15
10
|
description: 'Ensure import and export statements include a file extension',
|
|
11
|
+
url: 'https://github.com/jgeurts/eslint-config-decent/tree/main/src/rules/requireExtensionRule.ts',
|
|
16
12
|
},
|
|
17
13
|
fixable: 'code',
|
|
18
14
|
schema: [],
|
|
@@ -20,9 +16,12 @@ export const requireExtensionRule = ESLintUtils.RuleCreator(() => 'https://githu
|
|
|
20
16
|
requireExtension: 'Relative imports and exports must include a file extension.',
|
|
21
17
|
},
|
|
22
18
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
create(context: Rule.RuleContext) {
|
|
20
|
+
function checkSource(source: Rule.Node | null | undefined): void {
|
|
21
|
+
if (source?.type !== 'Literal' || typeof source.value !== 'string') {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
26
25
|
const importPath = source.value;
|
|
27
26
|
|
|
28
27
|
if (!importPath || !importPath.startsWith('.') || importPath.endsWith('.js')) {
|
|
@@ -46,17 +45,21 @@ export const requireExtensionRule = ESLintUtils.RuleCreator(() => 'https://githu
|
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
return {
|
|
49
|
-
ImportDeclaration(node:
|
|
50
|
-
|
|
48
|
+
ImportDeclaration(node: Rule.Node): void {
|
|
49
|
+
if (node.type === 'ImportDeclaration') {
|
|
50
|
+
checkSource(node.source as Rule.Node);
|
|
51
|
+
}
|
|
51
52
|
},
|
|
52
|
-
ExportNamedDeclaration(node:
|
|
53
|
-
if (node.source) {
|
|
54
|
-
checkSource(node.source);
|
|
53
|
+
ExportNamedDeclaration(node: Rule.Node): void {
|
|
54
|
+
if (node.type === 'ExportNamedDeclaration' && node.source) {
|
|
55
|
+
checkSource(node.source as Rule.Node);
|
|
55
56
|
}
|
|
56
57
|
},
|
|
57
|
-
ExportAllDeclaration(node:
|
|
58
|
-
|
|
58
|
+
ExportAllDeclaration(node: Rule.Node): void {
|
|
59
|
+
if (node.type === 'ExportAllDeclaration') {
|
|
60
|
+
checkSource(node.source as Rule.Node);
|
|
61
|
+
}
|
|
59
62
|
},
|
|
60
63
|
};
|
|
61
64
|
},
|
|
62
|
-
}
|
|
65
|
+
};
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import { existsSync, lstatSync } from 'node:fs';
|
|
2
2
|
import { dirname, resolve } from 'node:path';
|
|
3
3
|
|
|
4
|
-
import type {
|
|
5
|
-
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
4
|
+
import type { Rule } from 'eslint';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
type MessageIds = 'requireExtension';
|
|
9
|
-
|
|
10
|
-
export const requireIndexRule = ESLintUtils.RuleCreator(() => 'https://github.com/jgeurts/eslint-config-decent/tree/main/src/rules/requireIndexRule.ts')<Options, MessageIds>({
|
|
11
|
-
name: 'require-index',
|
|
6
|
+
export const requireIndexRule: Rule.RuleModule = {
|
|
12
7
|
meta: {
|
|
13
8
|
type: 'suggestion',
|
|
14
9
|
docs: {
|
|
15
10
|
description: 'Ensure directory import and export statements use index.js',
|
|
11
|
+
url: 'https://github.com/jgeurts/eslint-config-decent/tree/main/src/rules/requireIndexRule.ts',
|
|
16
12
|
},
|
|
17
13
|
fixable: 'code',
|
|
18
14
|
schema: [],
|
|
19
15
|
messages: {
|
|
20
|
-
|
|
16
|
+
requireIndex: 'Directory imports and exports must use index.js.',
|
|
21
17
|
},
|
|
22
18
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
create(context: Rule.RuleContext) {
|
|
20
|
+
function checkSource(source: Rule.Node | null | undefined): void {
|
|
21
|
+
if (source?.type !== 'Literal' || typeof source.value !== 'string') {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
26
25
|
const importPath = source.value;
|
|
27
26
|
|
|
28
27
|
// Resolve the path relative to the file being linted
|
|
@@ -34,7 +33,7 @@ export const requireIndexRule = ESLintUtils.RuleCreator(() => 'https://github.co
|
|
|
34
33
|
if (isDirectory) {
|
|
35
34
|
context.report({
|
|
36
35
|
node: source,
|
|
37
|
-
messageId: '
|
|
36
|
+
messageId: 'requireIndex',
|
|
38
37
|
fix(fixer) {
|
|
39
38
|
const fixedPath = importPath.replace(/\/?$/, '/index.js');
|
|
40
39
|
return fixer.replaceText(source, `'${fixedPath}'`);
|
|
@@ -44,17 +43,21 @@ export const requireIndexRule = ESLintUtils.RuleCreator(() => 'https://github.co
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
return {
|
|
47
|
-
ImportDeclaration(node:
|
|
48
|
-
|
|
46
|
+
ImportDeclaration(node: Rule.Node): void {
|
|
47
|
+
if (node.type === 'ImportDeclaration') {
|
|
48
|
+
checkSource(node.source as Rule.Node);
|
|
49
|
+
}
|
|
49
50
|
},
|
|
50
|
-
ExportNamedDeclaration(node:
|
|
51
|
-
if (node.source) {
|
|
52
|
-
checkSource(node.source);
|
|
51
|
+
ExportNamedDeclaration(node: Rule.Node): void {
|
|
52
|
+
if (node.type === 'ExportNamedDeclaration' && node.source) {
|
|
53
|
+
checkSource(node.source as Rule.Node);
|
|
53
54
|
}
|
|
54
55
|
},
|
|
55
|
-
ExportAllDeclaration(node:
|
|
56
|
-
|
|
56
|
+
ExportAllDeclaration(node: Rule.Node): void {
|
|
57
|
+
if (node.type === 'ExportAllDeclaration') {
|
|
58
|
+
checkSource(node.source as Rule.Node);
|
|
59
|
+
}
|
|
57
60
|
},
|
|
58
61
|
};
|
|
59
62
|
},
|
|
60
|
-
}
|
|
63
|
+
};
|
package/src/security.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Config } from '@eslint/config-helpers';
|
|
2
2
|
import security from 'eslint-plugin-security';
|
|
3
3
|
|
|
4
|
-
const base:
|
|
4
|
+
const base: Config = {
|
|
5
5
|
plugins: {
|
|
6
6
|
security,
|
|
7
7
|
},
|
package/src/stylistic.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { Config } from '@eslint/config-helpers';
|
|
1
2
|
import stylistic from '@stylistic/eslint-plugin';
|
|
2
|
-
import type { TSESLint } from '@typescript-eslint/utils';
|
|
3
3
|
|
|
4
4
|
const baseStylistic = stylistic.configs.customize({
|
|
5
5
|
braceStyle: '1tbs',
|
|
6
6
|
jsx: true,
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
const base:
|
|
9
|
+
const base: Config = {
|
|
10
10
|
...baseStylistic,
|
|
11
11
|
rules: {
|
|
12
12
|
...stylistic.configs['disable-legacy'].rules,
|
package/src/testingLibrary.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { FixupPluginDefinition } from '@eslint/compat';
|
|
2
2
|
import { fixupPluginRules } from '@eslint/compat';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Config } from '@eslint/config-helpers';
|
|
4
4
|
import testingLibrary from 'eslint-plugin-testing-library';
|
|
5
5
|
|
|
6
|
-
const base:
|
|
6
|
+
const base: Config = {
|
|
7
7
|
plugins: {
|
|
8
8
|
'testing-library': fixupPluginRules(testingLibrary as FixupPluginDefinition) as typeof testingLibrary,
|
|
9
9
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare module 'eslint-plugin-jest-dom' {
|
|
2
|
-
import type {
|
|
2
|
+
import type { Config, Plugin } from '@eslint/config-helpers';
|
|
3
3
|
|
|
4
|
-
const value:
|
|
4
|
+
const value: Plugin & {
|
|
5
5
|
configs: {
|
|
6
|
-
'flat/all':
|
|
7
|
-
'flat/recommended':
|
|
6
|
+
'flat/all': Config;
|
|
7
|
+
'flat/recommended': Config;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
export default value;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
declare module 'eslint-plugin-jest' {
|
|
2
|
-
import type {
|
|
2
|
+
import type { Config, Plugin } from '@eslint/config-helpers';
|
|
3
3
|
|
|
4
|
-
const value:
|
|
4
|
+
const value: Plugin & {
|
|
5
5
|
configs: {
|
|
6
|
-
'flat/all':
|
|
7
|
-
'flat/recommended':
|
|
8
|
-
'flat/style':
|
|
6
|
+
'flat/all': Config;
|
|
7
|
+
'flat/recommended': Config;
|
|
8
|
+
'flat/style': Config;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
export default value;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare module 'eslint-plugin-jsx-a11y' {
|
|
2
|
-
import type {
|
|
2
|
+
import type { Config, Plugin } from '@eslint/config-helpers';
|
|
3
3
|
|
|
4
|
-
const value:
|
|
4
|
+
const value: Plugin & {
|
|
5
5
|
configs: {
|
|
6
|
-
recommended:
|
|
6
|
+
recommended: Config;
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
9
|
export default value;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare module 'eslint-plugin-mocha' {
|
|
2
|
-
import type {
|
|
2
|
+
import type { Config, Plugin } from '@eslint/config-helpers';
|
|
3
3
|
|
|
4
|
-
const value:
|
|
4
|
+
const value: Plugin & {
|
|
5
5
|
configs: {
|
|
6
|
-
recommended:
|
|
6
|
+
recommended: Config;
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
9
|
export default value;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare module '@next/eslint-plugin-next' {
|
|
2
|
-
import type {
|
|
2
|
+
import type { Config, Plugin } from '@eslint/config-helpers';
|
|
3
3
|
|
|
4
|
-
const value:
|
|
4
|
+
const value: Plugin & {
|
|
5
5
|
configs: {
|
|
6
|
-
recommended:
|
|
7
|
-
'core-web-vitals':
|
|
6
|
+
recommended: Config;
|
|
7
|
+
'core-web-vitals': Config;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
export default value;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
declare module 'eslint-plugin-react' {
|
|
2
|
-
import type {
|
|
2
|
+
import type { Config, Plugin } from '@eslint/config-helpers';
|
|
3
3
|
|
|
4
|
-
const value:
|
|
4
|
+
const value: Plugin & {
|
|
5
5
|
configs: {
|
|
6
|
-
all:
|
|
7
|
-
recommended:
|
|
8
|
-
'jsx-runtime':
|
|
6
|
+
all: Config;
|
|
7
|
+
recommended: Config;
|
|
8
|
+
'jsx-runtime': Config;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
export default value;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
declare module 'eslint-plugin-testing-library' {
|
|
2
|
-
import type {
|
|
2
|
+
import type { Config, Plugin } from '@eslint/config-helpers';
|
|
3
3
|
|
|
4
|
-
const value:
|
|
4
|
+
const value: Plugin & {
|
|
5
5
|
configs: {
|
|
6
|
-
'flat/angular':
|
|
7
|
-
'flat/dom':
|
|
8
|
-
'flat/react':
|
|
9
|
-
'flat/vue':
|
|
6
|
+
'flat/angular': Config;
|
|
7
|
+
'flat/dom': Config;
|
|
8
|
+
'flat/react': Config;
|
|
9
|
+
'flat/vue': Config;
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
export default value;
|