@fullstacksjs/eslint-config 12.0.0 → 12.1.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 +1 -4
- package/cjs/modules/tests.js +3 -1
- package/cjs/modules/typescript.js +1 -0
- package/cjs/option.d.ts +70 -0
- package/package.json +1 -1
- package/src/modules/tests.mjs +2 -0
- package/src/modules/typescript.mjs +1 -0
- package/src/option.d.ts +70 -0
package/README.md
CHANGED
|
@@ -57,10 +57,7 @@ You can fine-tune module detection by overriding it, the `defineConfig` function
|
|
|
57
57
|
```typescript
|
|
58
58
|
interface Options {
|
|
59
59
|
react?: boolean; // controls react, react-hooks, jsx/a11y plugins
|
|
60
|
-
typescript?:
|
|
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
|
-
};
|
|
60
|
+
typescript?: ParserOptions // https://typescript-eslint.io/packages/parser#configuration
|
|
64
61
|
node?: boolean; // controls node plugin
|
|
65
62
|
sort?: boolean; // controls perfectionist plugin
|
|
66
63
|
strict?: boolean; // controls strict rules
|
package/cjs/modules/tests.js
CHANGED
|
@@ -34,6 +34,7 @@ function tests(options = {}) {
|
|
|
34
34
|
'jest-formatting/padding-around-test-blocks': 'warn',
|
|
35
35
|
'max-lines-per-function': 'off',
|
|
36
36
|
'no-sparse-arrays': 'off',
|
|
37
|
+
'no-empty-function': 'off',
|
|
37
38
|
...(0, _conditions.predicate)(options.react, {
|
|
38
39
|
'react/jsx-no-constructed-context-values': 'off'
|
|
39
40
|
}),
|
|
@@ -42,7 +43,8 @@ function tests(options = {}) {
|
|
|
42
43
|
'@typescript-eslint/no-namespace': 'off',
|
|
43
44
|
'@typescript-eslint/unbound-method': 'off',
|
|
44
45
|
'@typescript-eslint/no-empty-function': 'off',
|
|
45
|
-
'@typescript-eslint/no-floating-promises': 'off'
|
|
46
|
+
'@typescript-eslint/no-floating-promises': 'off',
|
|
47
|
+
'@typescript-eslint/prefer-promise-reject-errors': 'off'
|
|
46
48
|
})
|
|
47
49
|
}
|
|
48
50
|
};
|
package/cjs/option.d.ts
CHANGED
|
@@ -8,23 +8,93 @@ interface ProjectService {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export interface Options extends Linter.Config {
|
|
11
|
+
/**
|
|
12
|
+
* @default true if you have `react` or `react-dom` in your dependencies
|
|
13
|
+
* Controls react plugin.
|
|
14
|
+
*/
|
|
11
15
|
react?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
12
19
|
sort?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @default true if you have `next` in your dependencies
|
|
22
|
+
* Controls next plugin.
|
|
23
|
+
*/
|
|
13
24
|
next?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @default true if you have `tailwind` in your dependencies
|
|
27
|
+
* Controls tailwind plugin.
|
|
28
|
+
*/
|
|
14
29
|
tailwind?: boolean | { callees: string[] };
|
|
30
|
+
/**
|
|
31
|
+
* @default false
|
|
32
|
+
* Controls [node plugin](https://www.npmjs.com/package/eslint-plugin-n).
|
|
33
|
+
*/
|
|
15
34
|
node?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* @default false
|
|
37
|
+
* Enables all strict rules.
|
|
38
|
+
*/
|
|
16
39
|
strict?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* @default true
|
|
42
|
+
* Controls [import plugin](https://www.npmjs.com/package/eslint-plugin-import-x).
|
|
43
|
+
*/
|
|
17
44
|
import?: boolean | { internalRegExp?: string; lifetime?: number; projects?: string | string[] };
|
|
45
|
+
/**
|
|
46
|
+
* @default true if you have `type: module` in your `package.json`.
|
|
47
|
+
*/
|
|
18
48
|
esm?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* @default true if you have one of `jest`, `vitest`, `cypress`, `playwright`, `storybook`, `prettier` in your dependencies.
|
|
51
|
+
* Controls [test plugin](https://www.npmjs.com/package/eslint-plugin-jest-formatting).
|
|
52
|
+
*/
|
|
19
53
|
test?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @default true if you have `jest` in your dependencies.
|
|
56
|
+
* Controls [jest plugin](https://www.npmjs.com/package/eslint-plugin-jest).
|
|
57
|
+
*/
|
|
20
58
|
jest?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* @default true if you have `vitest` in your dependencies.
|
|
61
|
+
* Controls [vitest plugin](https://www.npmjs.com/package/eslint-plugin-vitest).
|
|
62
|
+
*/
|
|
21
63
|
vitest?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* @default true if you have `cypress` in your dependencies.
|
|
66
|
+
* Controls [cypress plugin](https://www.npmjs.com/package/eslint-plugin-cypress).
|
|
67
|
+
*/
|
|
22
68
|
cypress?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* @default true if you have `storybook` in your dependencies.
|
|
71
|
+
* Controls [storybook plugin](https://www.npmjs.com/package/eslint-plugin-storybook).
|
|
72
|
+
*/
|
|
23
73
|
storybook?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* @default true if you have `prettier` in your dependencies.
|
|
76
|
+
* Controls [prettier plugin](https://www.npmjs.com/package/eslint-plugin-prettier).
|
|
77
|
+
*/
|
|
24
78
|
prettier?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* @default true if you have `playwright` in your dependencies.
|
|
81
|
+
* Controls [playwright plugin](https://www.npmjs.com/package/eslint-plugin-playwright).
|
|
82
|
+
*/
|
|
25
83
|
playwright?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* @default true if you have `typescript` in your dependencies.
|
|
86
|
+
* Controls [typescript plugin](https://www.npmjs.com/package/typescript-eslint).
|
|
87
|
+
*/
|
|
26
88
|
typescript?: { projectService?: boolean | ProjectService; tsconfigRootDir: string; cacheLifetime?: number };
|
|
89
|
+
/**
|
|
90
|
+
* @default false
|
|
91
|
+
* Disables expensive rules.
|
|
92
|
+
*/
|
|
27
93
|
disableExpensiveRules?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* @default []
|
|
96
|
+
* List of globs to ignore.
|
|
97
|
+
*/
|
|
28
98
|
ignores?: string[];
|
|
29
99
|
}
|
|
30
100
|
|
package/package.json
CHANGED
package/src/modules/tests.mjs
CHANGED
|
@@ -25,6 +25,7 @@ function tests(options = {}) {
|
|
|
25
25
|
|
|
26
26
|
'max-lines-per-function': 'off',
|
|
27
27
|
'no-sparse-arrays': 'off',
|
|
28
|
+
'no-empty-function': 'off',
|
|
28
29
|
|
|
29
30
|
...predicate(options.react, {
|
|
30
31
|
'react/jsx-no-constructed-context-values': 'off',
|
|
@@ -36,6 +37,7 @@ function tests(options = {}) {
|
|
|
36
37
|
'@typescript-eslint/unbound-method': 'off',
|
|
37
38
|
'@typescript-eslint/no-empty-function': 'off',
|
|
38
39
|
'@typescript-eslint/no-floating-promises': 'off',
|
|
40
|
+
'@typescript-eslint/prefer-promise-reject-errors': 'off',
|
|
39
41
|
}),
|
|
40
42
|
},
|
|
41
43
|
};
|
|
@@ -218,6 +218,7 @@ function typescript(options = {}) {
|
|
|
218
218
|
'react/jsx-no-useless-fragment': 'off', // Need useless-fragment for JSX return type
|
|
219
219
|
|
|
220
220
|
// Conflicts with @typescript-eslint
|
|
221
|
+
'no-empty-function': 'off',
|
|
221
222
|
'default-case': 'off',
|
|
222
223
|
'import/named': 'off',
|
|
223
224
|
'import/namespace': 'off',
|
package/src/option.d.ts
CHANGED
|
@@ -8,23 +8,93 @@ interface ProjectService {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export interface Options extends Linter.Config {
|
|
11
|
+
/**
|
|
12
|
+
* @default true if you have `react` or `react-dom` in your dependencies
|
|
13
|
+
* Controls react plugin.
|
|
14
|
+
*/
|
|
11
15
|
react?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
12
19
|
sort?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @default true if you have `next` in your dependencies
|
|
22
|
+
* Controls next plugin.
|
|
23
|
+
*/
|
|
13
24
|
next?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @default true if you have `tailwind` in your dependencies
|
|
27
|
+
* Controls tailwind plugin.
|
|
28
|
+
*/
|
|
14
29
|
tailwind?: boolean | { callees: string[] };
|
|
30
|
+
/**
|
|
31
|
+
* @default false
|
|
32
|
+
* Controls [node plugin](https://www.npmjs.com/package/eslint-plugin-n).
|
|
33
|
+
*/
|
|
15
34
|
node?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* @default false
|
|
37
|
+
* Enables all strict rules.
|
|
38
|
+
*/
|
|
16
39
|
strict?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* @default true
|
|
42
|
+
* Controls [import plugin](https://www.npmjs.com/package/eslint-plugin-import-x).
|
|
43
|
+
*/
|
|
17
44
|
import?: boolean | { internalRegExp?: string; lifetime?: number; projects?: string | string[] };
|
|
45
|
+
/**
|
|
46
|
+
* @default true if you have `type: module` in your `package.json`.
|
|
47
|
+
*/
|
|
18
48
|
esm?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* @default true if you have one of `jest`, `vitest`, `cypress`, `playwright`, `storybook`, `prettier` in your dependencies.
|
|
51
|
+
* Controls [test plugin](https://www.npmjs.com/package/eslint-plugin-jest-formatting).
|
|
52
|
+
*/
|
|
19
53
|
test?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @default true if you have `jest` in your dependencies.
|
|
56
|
+
* Controls [jest plugin](https://www.npmjs.com/package/eslint-plugin-jest).
|
|
57
|
+
*/
|
|
20
58
|
jest?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* @default true if you have `vitest` in your dependencies.
|
|
61
|
+
* Controls [vitest plugin](https://www.npmjs.com/package/eslint-plugin-vitest).
|
|
62
|
+
*/
|
|
21
63
|
vitest?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* @default true if you have `cypress` in your dependencies.
|
|
66
|
+
* Controls [cypress plugin](https://www.npmjs.com/package/eslint-plugin-cypress).
|
|
67
|
+
*/
|
|
22
68
|
cypress?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* @default true if you have `storybook` in your dependencies.
|
|
71
|
+
* Controls [storybook plugin](https://www.npmjs.com/package/eslint-plugin-storybook).
|
|
72
|
+
*/
|
|
23
73
|
storybook?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* @default true if you have `prettier` in your dependencies.
|
|
76
|
+
* Controls [prettier plugin](https://www.npmjs.com/package/eslint-plugin-prettier).
|
|
77
|
+
*/
|
|
24
78
|
prettier?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* @default true if you have `playwright` in your dependencies.
|
|
81
|
+
* Controls [playwright plugin](https://www.npmjs.com/package/eslint-plugin-playwright).
|
|
82
|
+
*/
|
|
25
83
|
playwright?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* @default true if you have `typescript` in your dependencies.
|
|
86
|
+
* Controls [typescript plugin](https://www.npmjs.com/package/typescript-eslint).
|
|
87
|
+
*/
|
|
26
88
|
typescript?: { projectService?: boolean | ProjectService; tsconfigRootDir: string; cacheLifetime?: number };
|
|
89
|
+
/**
|
|
90
|
+
* @default false
|
|
91
|
+
* Disables expensive rules.
|
|
92
|
+
*/
|
|
27
93
|
disableExpensiveRules?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* @default []
|
|
96
|
+
* List of globs to ignore.
|
|
97
|
+
*/
|
|
28
98
|
ignores?: string[];
|
|
29
99
|
}
|
|
30
100
|
|