@fullstacksjs/eslint-config 14.4.0 → 14.6.0
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 +95 -60
- package/cjs/index.js +12 -2
- package/cjs/modules/base.js +5 -2
- package/cjs/modules/cypress.js +9 -3
- package/cjs/modules/ignore.js +1 -1
- package/cjs/modules/imports.js +5 -3
- package/cjs/modules/jest.js +5 -2
- package/cjs/modules/next.js +9 -3
- package/cjs/modules/node.js +5 -2
- package/cjs/modules/perfectionist.js +7 -3
- package/cjs/modules/playwright.js +9 -3
- package/cjs/modules/prettier.js +9 -3
- package/cjs/modules/promise.js +8 -2
- package/cjs/modules/react.js +8 -2
- package/cjs/modules/regex.js +5 -2
- package/cjs/modules/storybook.js +9 -3
- package/cjs/modules/stylistic.js +6 -3
- package/cjs/modules/tailwind.js +5 -2
- package/cjs/modules/tests.js +5 -2
- package/cjs/modules/typescript.js +5 -2
- package/cjs/modules/vitest.js +6 -2
- package/cjs/{index.d.ts → types/index.d.ts} +50 -52
- package/cjs/types/modules/import.d.ts +7 -0
- package/cjs/types/modules/react.d.ts +5 -0
- package/cjs/types/modules/regex.d.ts +5 -0
- package/cjs/types/modules/tailwind.d.ts +20 -0
- package/cjs/types/modules/typescript.d.ts +38 -0
- package/package.json +3 -2
- package/src/index.mjs +12 -2
- package/src/modules/base.mjs +6 -2
- package/src/modules/cypress.mjs +10 -3
- package/src/modules/ignore.mjs +1 -1
- package/src/modules/imports.mjs +5 -3
- package/src/modules/jest.mjs +6 -2
- package/src/modules/next.mjs +10 -3
- package/src/modules/node.mjs +6 -2
- package/src/modules/perfectionist.mjs +8 -3
- package/src/modules/playwright.mjs +10 -3
- package/src/modules/prettier.mjs +10 -3
- package/src/modules/promise.mjs +9 -2
- package/src/modules/react.mjs +9 -2
- package/src/modules/regex.mjs +6 -2
- package/src/modules/storybook.mjs +10 -3
- package/src/modules/stylistic.mjs +6 -3
- package/src/modules/tailwind.mjs +7 -2
- package/src/modules/tests.mjs +6 -2
- package/src/modules/typescript.mjs +6 -2
- package/src/modules/vitest.mjs +7 -2
- package/src/{index.d.ts → types/index.d.ts} +50 -52
- package/src/types/modules/import.d.ts +7 -0
- package/src/types/modules/react.d.ts +5 -0
- package/src/types/modules/regex.d.ts +5 -0
- package/src/types/modules/tailwind.d.ts +20 -0
- package/src/types/modules/typescript.d.ts +38 -0
package/src/modules/next.mjs
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import plugin from '@next/eslint-plugin-next';
|
|
2
|
+
import { mergeConfigs } from 'eslint-flat-config-utils';
|
|
2
3
|
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @param { import('../types').Options } options
|
|
6
|
+
* @return { import('eslint').Linter.Config }
|
|
7
|
+
*/
|
|
8
|
+
function next(options = {}) {
|
|
9
|
+
const nextConfig = {
|
|
10
|
+
name: 'next',
|
|
6
11
|
plugins: { next: plugin },
|
|
7
12
|
rules: {
|
|
8
13
|
'next/google-font-display': 'warn',
|
|
@@ -28,6 +33,8 @@ function next() {
|
|
|
28
33
|
'next/no-unwanted-polyfillio': 'warn',
|
|
29
34
|
},
|
|
30
35
|
};
|
|
36
|
+
|
|
37
|
+
return mergeConfigs(nextConfig, options.next.overrides ?? {});
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
export default next;
|
package/src/modules/node.mjs
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { mergeConfigs } from 'eslint-flat-config-utils';
|
|
1
2
|
import plugin from 'eslint-plugin-n';
|
|
2
3
|
|
|
3
4
|
import { strict } from '../utils/conditions.mjs';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
|
-
* @param { import('
|
|
7
|
+
* @param { import('../types').Options } options
|
|
7
8
|
* @return { import('eslint').Linter.Config }
|
|
8
9
|
*/
|
|
9
10
|
function node(options = {}) {
|
|
10
|
-
|
|
11
|
+
const nodeConfig = {
|
|
12
|
+
name: 'node',
|
|
11
13
|
plugins: { n: plugin },
|
|
12
14
|
rules: {
|
|
13
15
|
'n/callback-return': 'off',
|
|
@@ -55,6 +57,8 @@ function node(options = {}) {
|
|
|
55
57
|
'n/no-missing-require': 'off',
|
|
56
58
|
},
|
|
57
59
|
};
|
|
60
|
+
|
|
61
|
+
return mergeConfigs(nodeConfig, options.node.overrides ?? {});
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
export default node;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { mergeConfigs } from 'eslint-flat-config-utils';
|
|
1
2
|
import plugin from 'eslint-plugin-perfectionist';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
* @
|
|
5
|
+
* @param { import('../types').Options } options
|
|
6
|
+
* @return { Promise<import('eslint').Linter.Config> }
|
|
5
7
|
*/
|
|
6
|
-
function perfectionist() {
|
|
7
|
-
|
|
8
|
+
function perfectionist(options = {}) {
|
|
9
|
+
const perfectionistConfig = {
|
|
10
|
+
name: 'perfectionist',
|
|
8
11
|
plugins: { perfectionist: plugin },
|
|
9
12
|
rules: {
|
|
10
13
|
'perfectionist/sort-array-includes': 'warn',
|
|
@@ -68,6 +71,8 @@ function perfectionist() {
|
|
|
68
71
|
'perfectionist/sort-variable-declarations': 'warn',
|
|
69
72
|
},
|
|
70
73
|
};
|
|
74
|
+
|
|
75
|
+
return mergeConfigs(perfectionistConfig, options.sort.overrides ?? {});
|
|
71
76
|
}
|
|
72
77
|
|
|
73
78
|
export default perfectionist;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import { mergeConfigs } from 'eslint-flat-config-utils';
|
|
1
2
|
import plugin from 'eslint-plugin-playwright';
|
|
2
3
|
|
|
3
4
|
import { globs } from '../utils/globs.mjs';
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @param { import('../types').Options } options
|
|
8
|
+
* @return { Promise<import('eslint').Linter.Config> }
|
|
9
|
+
*/
|
|
10
|
+
function playwright(options = {}) {
|
|
11
|
+
const playwrightConfig = {
|
|
12
|
+
name: 'playwright',
|
|
8
13
|
plugins: { playwright: plugin },
|
|
9
14
|
files: globs.e2e,
|
|
10
15
|
rules: {
|
|
@@ -68,6 +73,8 @@ function playwright() {
|
|
|
68
73
|
'playwright/valid-title': 'warn',
|
|
69
74
|
},
|
|
70
75
|
};
|
|
76
|
+
|
|
77
|
+
return mergeConfigs(playwrightConfig, options.playwright.overrides ?? {});
|
|
71
78
|
}
|
|
72
79
|
|
|
73
80
|
export default playwright;
|
package/src/modules/prettier.mjs
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { mergeConfigs } from 'eslint-flat-config-utils';
|
|
1
2
|
import plugin from 'eslint-plugin-prettier';
|
|
2
3
|
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @param { import('../types').Options } options
|
|
6
|
+
* @return { Promise<import('eslint').Linter.Config> }
|
|
7
|
+
*/
|
|
8
|
+
function prettier(options = {}) {
|
|
9
|
+
const prettierConfig = {
|
|
10
|
+
name: 'prettier',
|
|
6
11
|
plugins: { prettier: plugin },
|
|
7
12
|
rules: {
|
|
8
13
|
'prettier/prettier': 'error',
|
|
@@ -87,6 +92,8 @@ function prettier() {
|
|
|
87
92
|
'vue/template-curly-spacing': 'off',
|
|
88
93
|
},
|
|
89
94
|
};
|
|
95
|
+
|
|
96
|
+
return mergeConfigs(prettierConfig, options.prettier.overrides ?? {});
|
|
90
97
|
}
|
|
91
98
|
|
|
92
99
|
export default prettier;
|
package/src/modules/promise.mjs
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import { mergeConfigs } from 'eslint-flat-config-utils';
|
|
1
2
|
import plugin from 'eslint-plugin-promise';
|
|
2
3
|
|
|
3
4
|
import { strict } from '../utils/conditions.mjs';
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @param { import('../types').Options } options
|
|
8
|
+
* @return { Promise<import('eslint').Linter.Config> }
|
|
9
|
+
*/
|
|
6
10
|
function promise(options = {}) {
|
|
7
|
-
|
|
11
|
+
const promiseConfig = {
|
|
12
|
+
name: 'promise',
|
|
8
13
|
plugins: { promise: plugin },
|
|
9
14
|
rules: {
|
|
10
15
|
'promise/always-return': 'off',
|
|
@@ -26,6 +31,8 @@ function promise(options = {}) {
|
|
|
26
31
|
'promise/spec-only': 'warn',
|
|
27
32
|
},
|
|
28
33
|
};
|
|
34
|
+
|
|
35
|
+
return mergeConfigs(promiseConfig, options.promise.overrides ?? {});
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
export default promise;
|
package/src/modules/react.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import reactPlugin from '@eslint-react/eslint-plugin';
|
|
2
|
+
import { mergeConfigs } from 'eslint-flat-config-utils';
|
|
2
3
|
import a11yPlugin from 'eslint-plugin-jsx-a11y';
|
|
3
4
|
import hooksPlugin from 'eslint-plugin-react-hooks';
|
|
4
5
|
import { parser } from 'typescript-eslint';
|
|
@@ -6,11 +7,15 @@ import { parser } from 'typescript-eslint';
|
|
|
6
7
|
import { predicate, strict } from '../utils/conditions.mjs';
|
|
7
8
|
import { globs } from '../utils/globs.mjs';
|
|
8
9
|
|
|
9
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @param { import('../types').Options } options
|
|
12
|
+
* @return { Promise<import('eslint').Linter.Config> }
|
|
13
|
+
*/
|
|
10
14
|
function react(options = {}) {
|
|
11
15
|
const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
const reactConfig = {
|
|
18
|
+
name: 'react',
|
|
14
19
|
files: [globs.js, globs.jsx, globs.ts, globs.tsx],
|
|
15
20
|
plugins: {
|
|
16
21
|
...reactPlugin.configs.all.plugins,
|
|
@@ -170,6 +175,8 @@ function react(options = {}) {
|
|
|
170
175
|
'jsx-a11y/prefer-tag-over-role': 'off',
|
|
171
176
|
},
|
|
172
177
|
};
|
|
178
|
+
|
|
179
|
+
return mergeConfigs(reactConfig, options.react.overrides ?? {});
|
|
173
180
|
}
|
|
174
181
|
|
|
175
182
|
export default react;
|
package/src/modules/regex.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { mergeConfigs } from 'eslint-flat-config-utils';
|
|
1
2
|
import * as plugin from 'eslint-plugin-regexp';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
* @param { import('
|
|
5
|
+
* @param { import('../types').Options } options
|
|
5
6
|
* @return { Promise<import('eslint').Linter.Config> }
|
|
6
7
|
*/
|
|
7
8
|
function regex(options = {}) {
|
|
8
|
-
|
|
9
|
+
const regexConfig = {
|
|
10
|
+
name: 'regex',
|
|
9
11
|
plugins: { regexp: plugin },
|
|
10
12
|
settings: {
|
|
11
13
|
regexp: {
|
|
@@ -101,6 +103,8 @@ function regex(options = {}) {
|
|
|
101
103
|
'no-empty-character-class': 'off',
|
|
102
104
|
},
|
|
103
105
|
};
|
|
106
|
+
|
|
107
|
+
return mergeConfigs(regexConfig, options.regex.overrides ?? {});
|
|
104
108
|
}
|
|
105
109
|
|
|
106
110
|
export default regex;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import { mergeConfigs } from 'eslint-flat-config-utils';
|
|
1
2
|
import plugin from 'eslint-plugin-storybook';
|
|
2
3
|
|
|
3
4
|
import { globs } from '../utils/globs.mjs';
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @param { import('../types').Options } options
|
|
8
|
+
* @return { Promise<import('eslint').Linter.Config> }
|
|
9
|
+
*/
|
|
10
|
+
function storybook(options = {}) {
|
|
11
|
+
const storybookConfig = {
|
|
12
|
+
name: 'storybook',
|
|
8
13
|
files: globs.storybook,
|
|
9
14
|
plugins: { storybook: plugin },
|
|
10
15
|
rules: {
|
|
@@ -32,6 +37,8 @@ function storybook() {
|
|
|
32
37
|
'react-hooks/rules-of-hooks': 'off',
|
|
33
38
|
},
|
|
34
39
|
};
|
|
40
|
+
|
|
41
|
+
return mergeConfigs(storybookConfig, options.storybook.overrides ?? {});
|
|
35
42
|
}
|
|
36
43
|
|
|
37
44
|
export default storybook;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import stylisticPlugin from '@stylistic/eslint-plugin';
|
|
2
|
+
import { mergeConfigs } from 'eslint-flat-config-utils';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
* @param { import('
|
|
5
|
+
* @param { import('../types').Options } options
|
|
5
6
|
* @return { Promise<import('eslint').Linter.Config> }
|
|
6
7
|
*/
|
|
7
|
-
function stylistic() {
|
|
8
|
-
|
|
8
|
+
function stylistic(options = {}) {
|
|
9
|
+
const stylisticConfig = {
|
|
10
|
+
name: 'stylistic',
|
|
9
11
|
plugins: { '@stylistic': stylisticPlugin },
|
|
10
12
|
rules: {
|
|
11
13
|
'@stylistic/jsx-curly-brace-presence': ['warn', { props: 'never', children: 'never', propElementValues: 'always' }],
|
|
@@ -42,6 +44,7 @@ function stylistic() {
|
|
|
42
44
|
],
|
|
43
45
|
},
|
|
44
46
|
};
|
|
47
|
+
return mergeConfigs(stylisticConfig, options.stylistic.overrides ?? {});
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
export default stylistic;
|
package/src/modules/tailwind.mjs
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { mergeConfigs } from 'eslint-flat-config-utils';
|
|
2
|
+
|
|
1
3
|
import { strict } from '../utils/conditions.mjs';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
|
-
* @param { import('
|
|
6
|
+
* @param { import('../types').Options } options
|
|
5
7
|
* @return { Promise<import('eslint').Linter.Config> }
|
|
6
8
|
*/
|
|
7
9
|
async function tailwind(options = {}) {
|
|
8
10
|
const plugin = await import('eslint-plugin-better-tailwindcss');
|
|
9
|
-
|
|
11
|
+
const tailwindConfig = {
|
|
12
|
+
name: 'tailwind',
|
|
10
13
|
plugins: { 'better-tailwindcss': plugin.default ?? plugin },
|
|
11
14
|
settings: {
|
|
12
15
|
'better-tailwindcss': {
|
|
@@ -34,6 +37,8 @@ async function tailwind(options = {}) {
|
|
|
34
37
|
'better-tailwindcss/no-unnecessary-whitespace': 'warn',
|
|
35
38
|
},
|
|
36
39
|
};
|
|
40
|
+
|
|
41
|
+
return mergeConfigs(tailwindConfig, options.tailwind.overrides ?? {});
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
export default tailwind;
|
package/src/modules/tests.mjs
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import plugin from '@vitest/eslint-plugin';
|
|
2
|
+
import { mergeConfigs } from 'eslint-flat-config-utils';
|
|
2
3
|
import globals from 'globals';
|
|
3
4
|
|
|
4
5
|
import { predicate } from '../utils/conditions.mjs';
|
|
5
6
|
import { globs } from '../utils/globs.mjs';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
|
-
* @param { import('
|
|
9
|
+
* @param { import('../types').Options } options
|
|
9
10
|
* @return { import('eslint').Linter.Config }
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
function tests(options = {}) {
|
|
13
|
-
|
|
14
|
+
const testsConfug = {
|
|
15
|
+
name: 'tests',
|
|
14
16
|
files: [...globs.test, ...globs.e2e],
|
|
15
17
|
plugins: { vitest: plugin },
|
|
16
18
|
languageOptions: {
|
|
@@ -37,6 +39,8 @@ function tests(options = {}) {
|
|
|
37
39
|
}),
|
|
38
40
|
},
|
|
39
41
|
};
|
|
42
|
+
|
|
43
|
+
return mergeConfigs(testsConfug, options.test.overrides ?? {});
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
export default tests;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mergeConfigs } from 'eslint-flat-config-utils';
|
|
1
2
|
import { parser, plugin } from 'typescript-eslint';
|
|
2
3
|
|
|
3
4
|
import { predicate, strict } from '../utils/conditions.mjs';
|
|
@@ -5,13 +6,14 @@ import { globs } from '../utils/globs.mjs';
|
|
|
5
6
|
import { namingConvention } from '../utils/naming-convention.mjs';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
|
-
* @param { import('
|
|
9
|
+
* @param { import('../types').Options } options
|
|
9
10
|
* @return { import('eslint').Linter.Config }
|
|
10
11
|
*/
|
|
11
12
|
function typescript(options = {}) {
|
|
12
13
|
const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
const typescriptConfig = {
|
|
16
|
+
name: 'typescript',
|
|
15
17
|
files: [globs.ts, globs.tsx],
|
|
16
18
|
plugins: { '@typescript-eslint': plugin },
|
|
17
19
|
languageOptions: {
|
|
@@ -247,6 +249,8 @@ function typescript(options = {}) {
|
|
|
247
249
|
'no-duplicate-imports': 'off',
|
|
248
250
|
},
|
|
249
251
|
};
|
|
252
|
+
|
|
253
|
+
return mergeConfigs(typescriptConfig, options.typescript.overrides ?? {});
|
|
250
254
|
}
|
|
251
255
|
|
|
252
256
|
export default typescript;
|
package/src/modules/vitest.mjs
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import plugin from '@vitest/eslint-plugin';
|
|
2
|
+
import { mergeConfigs } from 'eslint-flat-config-utils';
|
|
2
3
|
|
|
3
4
|
import { globs } from '../utils/globs.mjs';
|
|
4
5
|
|
|
5
6
|
/**
|
|
7
|
+
* @param { import('../types').Options } options
|
|
6
8
|
* @return { import('eslint').Linter.Config }
|
|
7
9
|
*/
|
|
8
|
-
function vitest() {
|
|
9
|
-
|
|
10
|
+
function vitest(options = {}) {
|
|
11
|
+
const vitestConfig = {
|
|
12
|
+
name: 'vitest',
|
|
10
13
|
files: globs.test,
|
|
11
14
|
plugins: { vitest: plugin },
|
|
12
15
|
languageOptions: {
|
|
@@ -99,6 +102,8 @@ function vitest() {
|
|
|
99
102
|
'vitest/warn-todo': 'warn',
|
|
100
103
|
},
|
|
101
104
|
};
|
|
105
|
+
|
|
106
|
+
return mergeConfigs(vitestConfig, options.vitest.overrides ?? {});
|
|
102
107
|
}
|
|
103
108
|
|
|
104
109
|
export default vitest;
|
|
@@ -1,69 +1,57 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
|
+
import type { ConfigWithExtends } from 'eslint-flat-config-utils';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* Globs of files to allow running with the default project compiler options
|
|
9
|
-
* despite not being matched by the project service.
|
|
10
|
-
*/
|
|
11
|
-
allowDefaultProject?: string[];
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Path to a TSConfig to use instead of TypeScript's default project configuration.
|
|
15
|
-
* @default 'tsconfig.json'
|
|
16
|
-
*/
|
|
17
|
-
defaultProject?: string;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Whether to allow TypeScript plugins as configured in the TSConfig.
|
|
21
|
-
*/
|
|
22
|
-
loadTypeScriptPlugins?: boolean;
|
|
4
|
+
import type { ImportOptions } from './modules/import';
|
|
5
|
+
import type { ReactOptions } from './modules/react';
|
|
6
|
+
import type { RegexOptions } from './modules/regex';
|
|
7
|
+
import type { TailwindOptions } from './modules/tailwind';
|
|
8
|
+
import type { TypeScriptOptions } from './modules/typescript';
|
|
23
9
|
|
|
10
|
+
interface ConfigWithOverrides {
|
|
24
11
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
12
|
+
* Override the configuration.
|
|
13
|
+
*
|
|
14
|
+
* The properties of this object are merged with and take precedence over the default configuration.
|
|
15
|
+
*
|
|
16
|
+
* There is no guarantee that the resulting configuration works correctly — it depends on the options you provide.
|
|
17
|
+
*
|
|
18
|
+
* @see [eslint-flat-config-utils: `mergeConfigs`](https://jsr.io/@antfu/eslint-flat-config-utils/doc/~/mergeConfigs)
|
|
30
19
|
*/
|
|
31
|
-
|
|
20
|
+
overrides?: ConfigWithExtends;
|
|
32
21
|
}
|
|
33
22
|
|
|
34
|
-
type TailwindConfig = {
|
|
35
|
-
callees?: string[];
|
|
36
|
-
variables?: string[];
|
|
37
|
-
attributes?: string[];
|
|
38
|
-
tags?: string[];
|
|
39
|
-
} & ({ entryPoint: string; tailwindConfig?: string } | { entryPoint?: string; tailwindConfig: string });
|
|
40
|
-
|
|
41
23
|
export interface Options extends Linter.Config {
|
|
24
|
+
/**
|
|
25
|
+
* Controls Base.
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
base?: boolean | ConfigWithOverrides;
|
|
42
29
|
/**
|
|
43
30
|
* Controls React plugin.
|
|
44
31
|
* @default true - If you have `react` or `react-dom` in your dependencies.
|
|
45
32
|
*/
|
|
46
|
-
react?: boolean |
|
|
33
|
+
react?: boolean | ReactOptions;
|
|
47
34
|
/**
|
|
35
|
+
* Controls [Perfectionist plugin](https://www.npmjs.com/package/eslint-plugin-perfectionist).
|
|
48
36
|
* @default true
|
|
49
37
|
*/
|
|
50
|
-
sort?: boolean;
|
|
38
|
+
sort?: boolean | ConfigWithOverrides;
|
|
51
39
|
/**
|
|
52
40
|
* Controls Next plugin.
|
|
53
41
|
* @default true - If you have `next` in your dependencies.
|
|
54
42
|
*/
|
|
55
|
-
next?: boolean;
|
|
43
|
+
next?: boolean | ConfigWithOverrides;
|
|
56
44
|
/**
|
|
57
45
|
* Controls Tailwind plugin.
|
|
58
46
|
* @default false
|
|
59
47
|
* @see https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md
|
|
60
48
|
*/
|
|
61
|
-
tailwind?: false |
|
|
49
|
+
tailwind?: false | TailwindOptions;
|
|
62
50
|
/**
|
|
63
51
|
* Controls [Node plugin](https://www.npmjs.com/package/eslint-plugin-n).
|
|
64
52
|
* @default false
|
|
65
53
|
*/
|
|
66
|
-
node?: boolean;
|
|
54
|
+
node?: boolean | ConfigWithOverrides;
|
|
67
55
|
/**
|
|
68
56
|
* Enables all strict rules.
|
|
69
57
|
* @default false
|
|
@@ -73,7 +61,7 @@ export interface Options extends Linter.Config {
|
|
|
73
61
|
* Controls [import plugin](https://www.npmjs.com/package/eslint-plugin-import-x).
|
|
74
62
|
* @default true
|
|
75
63
|
*/
|
|
76
|
-
import?: boolean |
|
|
64
|
+
import?: boolean | ImportOptions;
|
|
77
65
|
/**
|
|
78
66
|
* @default true - If you have `type: module` in your `package.json`.
|
|
79
67
|
*/
|
|
@@ -82,42 +70,57 @@ export interface Options extends Linter.Config {
|
|
|
82
70
|
* Controls [test plugin](https://www.npmjs.com/package/eslint-plugin-jest-formatting).
|
|
83
71
|
* @default true - If you have one of `jest`, `vitest`, `cypress`, `@playwright/test` in your dependencies.
|
|
84
72
|
*/
|
|
85
|
-
test?: boolean;
|
|
73
|
+
test?: boolean | ConfigWithOverrides;
|
|
86
74
|
/**
|
|
87
75
|
* Controls [Jest plugin](https://www.npmjs.com/package/eslint-plugin-jest).
|
|
88
76
|
* @default true - If you have `jest` in your dependencies.
|
|
89
77
|
*/
|
|
90
|
-
jest?: boolean;
|
|
78
|
+
jest?: boolean | ConfigWithOverrides;
|
|
91
79
|
/**
|
|
92
80
|
* Controls [Vitest plugin](https://www.npmjs.com/package/eslint-plugin-vitest).
|
|
93
81
|
* @default true - If you have `vitest` in your dependencies.
|
|
94
82
|
*/
|
|
95
|
-
vitest?: boolean;
|
|
83
|
+
vitest?: boolean | ConfigWithOverrides;
|
|
96
84
|
/**
|
|
97
85
|
* Controls [Cypress plugin](https://www.npmjs.com/package/eslint-plugin-cypress).
|
|
98
86
|
* @default true - If you have `cypress` in your dependencies.
|
|
99
87
|
*/
|
|
100
|
-
cypress?: boolean;
|
|
88
|
+
cypress?: boolean | ConfigWithOverrides;
|
|
101
89
|
/**
|
|
102
90
|
* Controls [Storybook plugin](https://www.npmjs.com/package/eslint-plugin-storybook).
|
|
103
91
|
* @default true if you have `storybook` in your dependencies.
|
|
104
92
|
*/
|
|
105
|
-
storybook?: boolean;
|
|
93
|
+
storybook?: boolean | ConfigWithOverrides;
|
|
106
94
|
/**
|
|
107
95
|
* Controls [Prettier plugin](https://www.npmjs.com/package/eslint-plugin-prettier).
|
|
108
96
|
* @default true - If you have `prettier` in your dependencies.
|
|
109
97
|
*/
|
|
110
|
-
prettier?: boolean;
|
|
98
|
+
prettier?: boolean | ConfigWithOverrides;
|
|
111
99
|
/**
|
|
112
100
|
* Controls [Playwright plugin](https://www.npmjs.com/package/eslint-plugin-playwright).
|
|
113
101
|
* @default true - If you have `@playwright/test` in your dependencies.
|
|
114
102
|
*/
|
|
115
|
-
playwright?: boolean;
|
|
103
|
+
playwright?: boolean | ConfigWithOverrides;
|
|
104
|
+
/**
|
|
105
|
+
* Controls [Promise plugin](https://www.npmjs.com/package/eslint-plugin-promise).
|
|
106
|
+
* @default true
|
|
107
|
+
*/
|
|
108
|
+
promise?: boolean | ConfigWithOverrides;
|
|
109
|
+
/**
|
|
110
|
+
* Controls [Stylistic plugin](https://www.npmjs.com/package/@stylistic/eslint-plugin).
|
|
111
|
+
* @default true
|
|
112
|
+
*/
|
|
113
|
+
stylistic?: boolean | ConfigWithOverrides;
|
|
116
114
|
/**
|
|
117
115
|
* Controls [TypeScript plugin](https://www.npmjs.com/package/typescript-eslint).
|
|
118
116
|
* @default true - If you have `typescript` in your dependencies.
|
|
119
117
|
*/
|
|
120
|
-
typescript?: boolean |
|
|
118
|
+
typescript?: boolean | TypeScriptOptions;
|
|
119
|
+
/**
|
|
120
|
+
* Controls [Regex plugin](https://www.npmjs.com/package/eslint-plugin-regexp).
|
|
121
|
+
* @default { allowedCharacterRanges: ['all'] }
|
|
122
|
+
*/
|
|
123
|
+
regex?: boolean | RegexOptions;
|
|
121
124
|
/**
|
|
122
125
|
* Disables expensive rules.
|
|
123
126
|
* @default false
|
|
@@ -133,11 +136,6 @@ export interface Options extends Linter.Config {
|
|
|
133
136
|
* @default './.gitignore'
|
|
134
137
|
*/
|
|
135
138
|
gitignore?: string | false;
|
|
136
|
-
/**
|
|
137
|
-
* Controls regex plugin.
|
|
138
|
-
* @default { allowedCharacterRanges: ['all'] }
|
|
139
|
-
*/
|
|
140
|
-
regex?: boolean | { allowedCharacterRanges: string[] };
|
|
141
139
|
}
|
|
142
140
|
|
|
143
141
|
export declare function defineConfig(initOptions?: Options, ...extend: Linter.Config[]): Linter.Config[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ConfigWithOverrides } from '..';
|
|
2
|
+
|
|
3
|
+
interface TailwindOptionsBase extends ConfigWithOverrides {
|
|
4
|
+
callees?: string[];
|
|
5
|
+
variables?: string[];
|
|
6
|
+
attributes?: string[];
|
|
7
|
+
tags?: string[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface TailwindOptionsWithEntryPoint extends TailwindOptionsBase {
|
|
11
|
+
entryPoint: string;
|
|
12
|
+
tailwindConfig?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface TailwindOptionsWithConfig extends TailwindOptionsBase {
|
|
16
|
+
entryPoint?: string;
|
|
17
|
+
tailwindConfig: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type TailwindOptions = TailwindOptionsWithConfig | TailwindOptionsWithEntryPoint;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ConfigWithOverrides } from '..';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Granular options to configure the project service.
|
|
5
|
+
*/
|
|
6
|
+
interface ProjectServiceOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Globs of files to allow running with the default project compiler options
|
|
9
|
+
* despite not being matched by the project service.
|
|
10
|
+
*/
|
|
11
|
+
allowDefaultProject?: string[];
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Path to a TSConfig to use instead of TypeScript's default project configuration.
|
|
15
|
+
* @default 'tsconfig.json'
|
|
16
|
+
*/
|
|
17
|
+
defaultProject?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Whether to allow TypeScript plugins as configured in the TSConfig.
|
|
21
|
+
*/
|
|
22
|
+
loadTypeScriptPlugins?: boolean;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The maximum number of files {@link allowDefaultProject} may match.
|
|
26
|
+
* Each file match slows down linting, so if you do need to use this, please
|
|
27
|
+
* file an informative issue on typescript-eslint explaining why - so we can
|
|
28
|
+
* help you avoid using it!
|
|
29
|
+
* @default 8
|
|
30
|
+
*/
|
|
31
|
+
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface TypeScriptOptions extends ConfigWithOverrides {
|
|
35
|
+
projectService?: boolean | ProjectServiceOptions;
|
|
36
|
+
tsconfigRootDir?: string;
|
|
37
|
+
cacheLifetime?: number;
|
|
38
|
+
}
|