@fullstacksjs/eslint-config 11.10.2 → 12.0.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 +29 -27
- package/cjs/index.js +1 -4
- package/cjs/modules/prettier.js +0 -1
- package/cjs/modules/typescript.js +1 -6
- package/cjs/option.d.ts +8 -1
- package/package.json +6 -6
- package/src/index.mjs +1 -4
- package/src/modules/prettier.mjs +0 -1
- package/src/modules/typescript.mjs +1 -6
- package/src/option.d.ts +8 -1
package/README.md
CHANGED
|
@@ -27,7 +27,11 @@ To use the configuration, all you need is to export the generated config by the
|
|
|
27
27
|
```js
|
|
28
28
|
import { defineConfig } from '@fullstacksjs/eslint-config';
|
|
29
29
|
|
|
30
|
-
export default defineConfig(
|
|
30
|
+
export default defineConfig({
|
|
31
|
+
typescript: {
|
|
32
|
+
tsconfigRootDir: import.meta.dirname, // If you are using TypeScript
|
|
33
|
+
}
|
|
34
|
+
});
|
|
31
35
|
```
|
|
32
36
|
|
|
33
37
|
### CJS
|
|
@@ -35,7 +39,9 @@ export default defineConfig();
|
|
|
35
39
|
```js
|
|
36
40
|
const { defineConfig } = require('@fullstacksjs/eslint-config');
|
|
37
41
|
|
|
38
|
-
module.exports = defineConfig(
|
|
42
|
+
module.exports = defineConfig({
|
|
43
|
+
tsconfigRootDir: import.meta.dirname, // If you are using TypeScript
|
|
44
|
+
});
|
|
39
45
|
```
|
|
40
46
|
|
|
41
47
|
## How Module Detection Works
|
|
@@ -50,30 +56,26 @@ You can fine-tune module detection by overriding it, the `defineConfig` function
|
|
|
50
56
|
|
|
51
57
|
```typescript
|
|
52
58
|
interface Options {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
tailwind?: boolean | { callee?: string[] }; // controls tailwindcss plugin
|
|
74
|
-
next?: boolean; // controls next plugin
|
|
75
|
-
prettier?: boolean; // controls prettier plugin
|
|
76
|
-
disableExpensiveRules?: boolean; // controls expensive rules
|
|
59
|
+
react?: boolean; // controls react, react-hooks, jsx/a11y plugins
|
|
60
|
+
typescript?: { // controls typescript plugin
|
|
61
|
+
projectService?: boolean | ProjectService; tsconfigRootDir: string; cacheLifetime?: number; // https://typescript-eslint.io/packages/parser#projectservice
|
|
62
|
+
tsconfigRootDir?: string // https://typescript-eslint.io/packages/parser#tsconfigrootdir
|
|
63
|
+
};
|
|
64
|
+
node?: boolean; // controls node plugin
|
|
65
|
+
sort?: boolean; // controls perfectionist plugin
|
|
66
|
+
strict?: boolean; // controls strict rules
|
|
67
|
+
import?: { internalRegExp?: string; lifetime?: number; }; // controls import plugin
|
|
68
|
+
esm?: boolean; // controls esm plugin
|
|
69
|
+
test?: boolean; // controls test formatting plugin
|
|
70
|
+
jest?: boolean; // controls jest plugin
|
|
71
|
+
vitest?: boolean; // controls vitest plugin
|
|
72
|
+
cypress?: boolean; // controls cypress plugin
|
|
73
|
+
playwright?: boolean // controls playwright plugin
|
|
74
|
+
storybook?: boolean; // controls storybook plugin
|
|
75
|
+
tailwind?: boolean | { callee?: string[] }; // controls tailwindcss plugin
|
|
76
|
+
next?: boolean; // controls next plugin
|
|
77
|
+
prettier?: boolean; // controls prettier plugin
|
|
78
|
+
disableExpensiveRules?: boolean; // controls expensive rules
|
|
77
79
|
}
|
|
78
80
|
```
|
|
79
81
|
|
|
@@ -110,7 +112,7 @@ import { defineConfig } from '@fullstacksjs/eslint-config';
|
|
|
110
112
|
import pluginVue from 'eslint-plugin-vue';
|
|
111
113
|
|
|
112
114
|
export default defineConfig(
|
|
113
|
-
{
|
|
115
|
+
{ /* Options */},
|
|
114
116
|
...pluginVue.configs['flat/recommended']
|
|
115
117
|
)
|
|
116
118
|
```
|
package/cjs/index.js
CHANGED
|
@@ -53,7 +53,7 @@ const defaultOptions = {
|
|
|
53
53
|
// ISSUE: https://github.com/francoismassart/eslint-plugin-tailwindcss/issues/325,
|
|
54
54
|
test: testPackages.some(p => (0, _localPkg.isPackageExists)(p)),
|
|
55
55
|
typescript: (0, _localPkg.isPackageExists)('typescript') ? {
|
|
56
|
-
|
|
56
|
+
projectService: true
|
|
57
57
|
} : false,
|
|
58
58
|
vitest: (0, _localPkg.isPackageExists)('vitest')
|
|
59
59
|
};
|
|
@@ -69,9 +69,6 @@ function defineConfig(initOptions = {}, ...extend) {
|
|
|
69
69
|
if (options.tailwind === true) {
|
|
70
70
|
options.tailwind = {};
|
|
71
71
|
}
|
|
72
|
-
if (options.typescript === true) {
|
|
73
|
-
options.typescript = {};
|
|
74
|
-
}
|
|
75
72
|
if (options.import === true) {
|
|
76
73
|
options.import = {};
|
|
77
74
|
}
|
package/cjs/modules/prettier.js
CHANGED
|
@@ -30,7 +30,6 @@ function prettier() {
|
|
|
30
30
|
'@typescript-eslint/member-delimiter-style': 'off',
|
|
31
31
|
'@typescript-eslint/no-extra-parens': 'off',
|
|
32
32
|
'@typescript-eslint/no-extra-semi': 'off',
|
|
33
|
-
'@typescript-eslint/object-curly-spacing': 'off',
|
|
34
33
|
'@typescript-eslint/semi': 'off',
|
|
35
34
|
'@typescript-eslint/space-before-blocks': 'off',
|
|
36
35
|
'@typescript-eslint/space-before-function-paren': 'off',
|
|
@@ -21,12 +21,7 @@ function typescript(options = {}) {
|
|
|
21
21
|
languageOptions: {
|
|
22
22
|
parser: _typescriptEslint.parser,
|
|
23
23
|
parserOptions: {
|
|
24
|
-
...
|
|
25
|
-
project: options.typescript.projects
|
|
26
|
-
}),
|
|
27
|
-
...(0, _conditions.predicate)(options.typescript && options.typescript.tsconfigRootDir, {
|
|
28
|
-
tsconfigRootDir: options.typescript.tsconfigRootDir
|
|
29
|
-
})
|
|
24
|
+
...options.typescript
|
|
30
25
|
}
|
|
31
26
|
},
|
|
32
27
|
rules: {
|
package/cjs/option.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
2
|
|
|
3
|
+
interface ProjectService {
|
|
4
|
+
allowDefaultProject: string[];
|
|
5
|
+
defaultProject: string;
|
|
6
|
+
loadTypeScriptPlugins: boolean;
|
|
7
|
+
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
3
10
|
export interface Options extends Linter.Config {
|
|
4
11
|
react?: boolean;
|
|
5
12
|
sort?: boolean;
|
|
@@ -16,7 +23,7 @@ export interface Options extends Linter.Config {
|
|
|
16
23
|
storybook?: boolean;
|
|
17
24
|
prettier?: boolean;
|
|
18
25
|
playwright?: boolean;
|
|
19
|
-
typescript?: {
|
|
26
|
+
typescript?: { projectService?: boolean | ProjectService; tsconfigRootDir: string; cacheLifetime?: number };
|
|
20
27
|
disableExpensiveRules?: boolean;
|
|
21
28
|
ignores?: string[];
|
|
22
29
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstacksjs/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "fullstacks <fullstacksjs@gmail.com>",
|
|
6
6
|
"description": "fullstacks eslint config",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"eslint-plugin-vitest": "0.5.4",
|
|
55
55
|
"globals": "16.0.0",
|
|
56
56
|
"local-pkg": "1.1.1",
|
|
57
|
-
"typescript-eslint": "8.
|
|
57
|
+
"typescript-eslint": "8.29.1"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@eslint/eslintrc": "3.3.1",
|
|
@@ -63,16 +63,16 @@
|
|
|
63
63
|
"@semantic-release/npm": "12.0.1",
|
|
64
64
|
"@semantic-release/release-notes-generator": "14.0.3",
|
|
65
65
|
"@types/eslint": "9.6.1",
|
|
66
|
-
"cspell": "8.
|
|
67
|
-
"eslint": "9.
|
|
66
|
+
"cspell": "8.18.1",
|
|
67
|
+
"eslint": "9.24.0",
|
|
68
68
|
"husky": "9.1.7",
|
|
69
69
|
"jest": "29.7.0",
|
|
70
|
-
"lint-staged": "15.5.
|
|
70
|
+
"lint-staged": "15.5.1",
|
|
71
71
|
"np": "10.2.0",
|
|
72
72
|
"pinst": "3.0.0",
|
|
73
73
|
"prettier": "3.5.3",
|
|
74
74
|
"semantic-release": "24.2.3",
|
|
75
|
-
"typescript": "5.8.
|
|
75
|
+
"typescript": "5.8.3",
|
|
76
76
|
"unbuild": "3.5.0"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
package/src/index.mjs
CHANGED
|
@@ -45,7 +45,7 @@ const defaultOptions = {
|
|
|
45
45
|
strict: false,
|
|
46
46
|
tailwind: false, // ISSUE: https://github.com/francoismassart/eslint-plugin-tailwindcss/issues/325,
|
|
47
47
|
test: testPackages.some(p => isPackageExists(p)),
|
|
48
|
-
typescript: isPackageExists('typescript') ? {
|
|
48
|
+
typescript: isPackageExists('typescript') ? { projectService: true } : false,
|
|
49
49
|
vitest: isPackageExists('vitest'),
|
|
50
50
|
};
|
|
51
51
|
|
|
@@ -61,9 +61,6 @@ export function defineConfig(initOptions = {}, ...extend) {
|
|
|
61
61
|
if (options.tailwind === true) {
|
|
62
62
|
options.tailwind = {};
|
|
63
63
|
}
|
|
64
|
-
if (options.typescript === true) {
|
|
65
|
-
options.typescript = {};
|
|
66
|
-
}
|
|
67
64
|
if (options.import === true) {
|
|
68
65
|
options.import = {};
|
|
69
66
|
}
|
package/src/modules/prettier.mjs
CHANGED
|
@@ -24,7 +24,6 @@ function prettier() {
|
|
|
24
24
|
'@typescript-eslint/member-delimiter-style': 'off',
|
|
25
25
|
'@typescript-eslint/no-extra-parens': 'off',
|
|
26
26
|
'@typescript-eslint/no-extra-semi': 'off',
|
|
27
|
-
'@typescript-eslint/object-curly-spacing': 'off',
|
|
28
27
|
'@typescript-eslint/semi': 'off',
|
|
29
28
|
'@typescript-eslint/space-before-blocks': 'off',
|
|
30
29
|
'@typescript-eslint/space-before-function-paren': 'off',
|
|
@@ -15,12 +15,7 @@ function typescript(options = {}) {
|
|
|
15
15
|
languageOptions: {
|
|
16
16
|
parser,
|
|
17
17
|
parserOptions: {
|
|
18
|
-
...
|
|
19
|
-
project: options.typescript.projects,
|
|
20
|
-
}),
|
|
21
|
-
...predicate(options.typescript && options.typescript.tsconfigRootDir, {
|
|
22
|
-
tsconfigRootDir: options.typescript.tsconfigRootDir,
|
|
23
|
-
}),
|
|
18
|
+
...options.typescript,
|
|
24
19
|
},
|
|
25
20
|
},
|
|
26
21
|
rules: {
|
package/src/option.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
2
|
|
|
3
|
+
interface ProjectService {
|
|
4
|
+
allowDefaultProject: string[];
|
|
5
|
+
defaultProject: string;
|
|
6
|
+
loadTypeScriptPlugins: boolean;
|
|
7
|
+
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
3
10
|
export interface Options extends Linter.Config {
|
|
4
11
|
react?: boolean;
|
|
5
12
|
sort?: boolean;
|
|
@@ -16,7 +23,7 @@ export interface Options extends Linter.Config {
|
|
|
16
23
|
storybook?: boolean;
|
|
17
24
|
prettier?: boolean;
|
|
18
25
|
playwright?: boolean;
|
|
19
|
-
typescript?: {
|
|
26
|
+
typescript?: { projectService?: boolean | ProjectService; tsconfigRootDir: string; cacheLifetime?: number };
|
|
20
27
|
disableExpensiveRules?: boolean;
|
|
21
28
|
ignores?: string[];
|
|
22
29
|
}
|