@fullstacksjs/eslint-config 13.13.2 → 13.14.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 +2 -1
- package/cjs/modules/jest.js +8 -1
- package/cjs/modules/react.js +6 -2
- package/cjs/modules/stylistic.js +2 -3
- package/cjs/modules/typescript.js +1 -2
- package/cjs/modules/vitest.js +2 -0
- package/package.json +12 -11
- package/src/modules/jest.mjs +9 -1
- package/src/modules/react.mjs +9 -2
- package/src/modules/stylistic.mjs +1 -1
- package/src/modules/typescript.mjs +1 -1
- package/src/modules/vitest.mjs +2 -0
package/README.md
CHANGED
|
@@ -30,6 +30,7 @@ import { defineConfig } from '@fullstacksjs/eslint-config';
|
|
|
30
30
|
export default defineConfig({
|
|
31
31
|
typescript: {
|
|
32
32
|
tsconfigRootDir: import.meta.dirname, // Recommended when using TypeScript
|
|
33
|
+
}
|
|
33
34
|
});
|
|
34
35
|
```
|
|
35
36
|
|
|
@@ -182,7 +183,7 @@ import/no-deprecated
|
|
|
182
183
|
|
|
183
184
|
```js
|
|
184
185
|
export default defineConfig({
|
|
185
|
-
disableExpensiveRules: !process.env.CI || !process.env.HUSKY // Or anywhere you want
|
|
186
|
+
disableExpensiveRules: !process.env.CI || !process.env.HUSKY, // Or anywhere you want
|
|
186
187
|
prettier: false // So you should run the formatter explicitly.
|
|
187
188
|
});
|
|
188
189
|
```
|
package/cjs/modules/jest.js
CHANGED
|
@@ -6,12 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
|
|
7
7
|
var _eslintPluginJest = _interopRequireDefault(require("eslint-plugin-jest"));
|
|
8
8
|
var _globals = _interopRequireDefault(require("globals"));
|
|
9
|
+
var _conditions = require("../utils/conditions.js");
|
|
9
10
|
var _globs = require("../utils/globs.js");
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
12
|
/**
|
|
12
13
|
* @param { import('../index.js').Options } options
|
|
13
14
|
* @return { import('eslint').Linter.Config } */
|
|
14
|
-
function jest() {
|
|
15
|
+
function jest(options = {}) {
|
|
16
|
+
const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
|
|
15
17
|
return {
|
|
16
18
|
files: _globs.globs.test,
|
|
17
19
|
plugins: {
|
|
@@ -37,6 +39,10 @@ function jest() {
|
|
|
37
39
|
'jest/no-done-callback': 'warn',
|
|
38
40
|
'jest/no-expect-resolves': 'off',
|
|
39
41
|
'jest/no-export': 'error',
|
|
42
|
+
...(0, _conditions.predicate)(projectService, {
|
|
43
|
+
'jest/no-error-equal': 'error',
|
|
44
|
+
'jest/no-unnecessary-assertion': 'warn'
|
|
45
|
+
}),
|
|
40
46
|
'jest/no-hooks': 'off',
|
|
41
47
|
'jest/no-interpolation-in-snapshots': 'error',
|
|
42
48
|
'jest/no-jasmine-globals': 'off',
|
|
@@ -60,6 +66,7 @@ function jest() {
|
|
|
60
66
|
'jest/prefer-inline-snapshots': 'off',
|
|
61
67
|
'jest/prefer-lowercase-title': 'off',
|
|
62
68
|
'jest/prefer-mock-promise-shorthand': 'warn',
|
|
69
|
+
'jest/prefer-mock-return-shorthand': 'warn',
|
|
63
70
|
'jest/prefer-snapshot-hint': 'warn',
|
|
64
71
|
'jest/prefer-spy-on': 'off',
|
|
65
72
|
'jest/prefer-strict-equal': 'off',
|
package/cjs/modules/react.js
CHANGED
|
@@ -112,7 +112,7 @@ function react(options = {}) {
|
|
|
112
112
|
'@eslint-react/no-unnecessary-key': 'warn',
|
|
113
113
|
'@eslint-react/prefer-use-state-lazy-initialization': 'warn',
|
|
114
114
|
'@eslint-react/prefer-destructuring-assignment': 'warn',
|
|
115
|
-
'@eslint-react/hooks-extra/no-direct-set-state-in-use-effect': '
|
|
115
|
+
'@eslint-react/hooks-extra/no-direct-set-state-in-use-effect': 'off',
|
|
116
116
|
'@eslint-react/naming-convention/component-name': 'warn',
|
|
117
117
|
'@eslint-react/naming-convention/context-name': 'warn',
|
|
118
118
|
'@eslint-react/naming-convention/filename-extension': ['error', {
|
|
@@ -120,7 +120,11 @@ function react(options = {}) {
|
|
|
120
120
|
extensions: ['.jsx', '.tsx']
|
|
121
121
|
}],
|
|
122
122
|
'@eslint-react/naming-convention/filename': 'off',
|
|
123
|
-
'@eslint-react/naming-convention/
|
|
123
|
+
'@eslint-react/naming-convention/ref-name': 'warn',
|
|
124
|
+
'@eslint-react/naming-convention/use-state': ['warn', {
|
|
125
|
+
enforceAssignment: true,
|
|
126
|
+
enforceSetterName: false
|
|
127
|
+
}],
|
|
124
128
|
'@eslint-react/web-api/no-leaked-timeout': 'error',
|
|
125
129
|
'@eslint-react/web-api/no-leaked-event-listener': 'error',
|
|
126
130
|
'@eslint-react/web-api/no-leaked-interval': 'error',
|
package/cjs/modules/stylistic.js
CHANGED
|
@@ -25,9 +25,8 @@ function stylistic() {
|
|
|
25
25
|
component: true,
|
|
26
26
|
html: true
|
|
27
27
|
}],
|
|
28
|
-
'@stylistic/no-mixed-operators':
|
|
29
|
-
|
|
30
|
-
}],
|
|
28
|
+
'@stylistic/no-mixed-operators': 'off',
|
|
29
|
+
//conflict with prettier
|
|
31
30
|
'@stylistic/padding-line-between-statements': ['warn', {
|
|
32
31
|
blankLine: 'always',
|
|
33
32
|
prev: ['case', 'default'],
|
|
@@ -128,8 +128,7 @@ function typescript(options = {}) {
|
|
|
128
128
|
classes: true
|
|
129
129
|
}],
|
|
130
130
|
'@typescript-eslint/no-useless-constructor': 'error',
|
|
131
|
-
'@typescript-eslint/no-useless-default-assignment': '
|
|
132
|
-
// Re-enable after fix https://github.com/typescript-eslint/typescript-eslint/issues/11849
|
|
131
|
+
'@typescript-eslint/no-useless-default-assignment': 'warn',
|
|
133
132
|
'@typescript-eslint/no-useless-empty-export': 'warn',
|
|
134
133
|
'@typescript-eslint/parameter-properties': 'off',
|
|
135
134
|
'@typescript-eslint/prefer-as-const': 'warn',
|
package/cjs/modules/vitest.js
CHANGED
|
@@ -65,6 +65,7 @@ function vitest() {
|
|
|
65
65
|
'vitest/no-standalone-expect': 'warn',
|
|
66
66
|
'vitest/no-test-prefixes': 'warn',
|
|
67
67
|
'vitest/no-test-return-statement': 'warn',
|
|
68
|
+
'vitest/no-unneeded-async-expect-function': 'warn',
|
|
68
69
|
'vitest/prefer-called-once': 'warn',
|
|
69
70
|
'vitest/prefer-called-times': 'off',
|
|
70
71
|
'vitest/prefer-called-with': 'warn',
|
|
@@ -79,6 +80,7 @@ function vitest() {
|
|
|
79
80
|
'vitest/prefer-importing-vitest-globals': 'off',
|
|
80
81
|
'vitest/prefer-lowercase-title': 'warn',
|
|
81
82
|
'vitest/prefer-mock-promise-shorthand': 'warn',
|
|
83
|
+
'vitest/prefer-mock-return-shorthand': 'warn',
|
|
82
84
|
'vitest/prefer-snapshot-hint': 'warn',
|
|
83
85
|
'vitest/prefer-spy-on': 'warn',
|
|
84
86
|
'vitest/prefer-strict-boolean-matchers': 'off',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstacksjs/eslint-config",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.14.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "fullstacks <fullstacksjs@gmail.com>",
|
|
6
6
|
"description": "fullstacks eslint config",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"url": "git+https://github.com/fullstacksjs/eslint-config.git"
|
|
10
10
|
},
|
|
11
11
|
"publishConfig": {
|
|
12
|
-
"
|
|
12
|
+
"access": "public",
|
|
13
|
+
"provenance": true
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
15
16
|
"src",
|
|
@@ -36,28 +37,28 @@
|
|
|
36
37
|
}
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@eslint-react/eslint-plugin": "2.
|
|
40
|
+
"@eslint-react/eslint-plugin": "2.5.1",
|
|
40
41
|
"@eslint/compat": "2.0.0",
|
|
41
|
-
"@next/eslint-plugin-next": "16.
|
|
42
|
+
"@next/eslint-plugin-next": "16.1.1",
|
|
42
43
|
"@stylistic/eslint-plugin": "5.6.1",
|
|
43
|
-
"@vitest/eslint-plugin": "1.5
|
|
44
|
+
"@vitest/eslint-plugin": "1.6.5",
|
|
44
45
|
"deepmerge": "4.3.1",
|
|
45
46
|
"eslint-plugin-better-tailwindcss": "3.8.0",
|
|
46
47
|
"eslint-plugin-cypress": "5.2.0",
|
|
47
48
|
"eslint-plugin-import-x": "4.16.1",
|
|
48
|
-
"eslint-plugin-jest": "29.
|
|
49
|
+
"eslint-plugin-jest": "29.12.1",
|
|
49
50
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
50
51
|
"eslint-plugin-n": "17.23.1",
|
|
51
|
-
"eslint-plugin-perfectionist": "5.
|
|
52
|
+
"eslint-plugin-perfectionist": "5.2.0",
|
|
52
53
|
"eslint-plugin-playwright": "2.4.0",
|
|
53
54
|
"eslint-plugin-prettier": "5.5.4",
|
|
54
55
|
"eslint-plugin-promise": "7.2.1",
|
|
55
56
|
"eslint-plugin-react-hooks": "7.0.1",
|
|
56
57
|
"eslint-plugin-regexp": "2.10.0",
|
|
57
|
-
"eslint-plugin-storybook": "10.1.
|
|
58
|
-
"globals": "
|
|
58
|
+
"eslint-plugin-storybook": "10.1.11",
|
|
59
|
+
"globals": "17.0.0",
|
|
59
60
|
"local-pkg": "1.1.2",
|
|
60
|
-
"typescript-eslint": "8.
|
|
61
|
+
"typescript-eslint": "8.51.0"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@eslint/eslintrc": "3.3.3",
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
"pinst": "3.0.0",
|
|
75
76
|
"prettier": "3.7.4",
|
|
76
77
|
"semantic-release": "25.0.2",
|
|
77
|
-
"storybook": "10.1.
|
|
78
|
+
"storybook": "10.1.11",
|
|
78
79
|
"typescript": "5.9.3",
|
|
79
80
|
"unbuild": "3.6.1"
|
|
80
81
|
},
|
package/src/modules/jest.mjs
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import plugin from 'eslint-plugin-jest';
|
|
2
2
|
import globals from 'globals';
|
|
3
3
|
|
|
4
|
+
import { predicate } from '../utils/conditions.mjs';
|
|
4
5
|
import { globs } from '../utils/globs.mjs';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* @param { import('..').Options } options
|
|
8
9
|
* @return { import('eslint').Linter.Config } */
|
|
9
|
-
function jest() {
|
|
10
|
+
function jest(options = {}) {
|
|
11
|
+
const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
|
|
12
|
+
|
|
10
13
|
return {
|
|
11
14
|
files: globs.test,
|
|
12
15
|
plugins: { jest: plugin },
|
|
@@ -28,6 +31,10 @@ function jest() {
|
|
|
28
31
|
'jest/no-done-callback': 'warn',
|
|
29
32
|
'jest/no-expect-resolves': 'off',
|
|
30
33
|
'jest/no-export': 'error',
|
|
34
|
+
...predicate(projectService, {
|
|
35
|
+
'jest/no-error-equal': 'error',
|
|
36
|
+
'jest/no-unnecessary-assertion': 'warn',
|
|
37
|
+
}),
|
|
31
38
|
'jest/no-hooks': 'off',
|
|
32
39
|
'jest/no-interpolation-in-snapshots': 'error',
|
|
33
40
|
'jest/no-jasmine-globals': 'off',
|
|
@@ -49,6 +56,7 @@ function jest() {
|
|
|
49
56
|
'jest/prefer-inline-snapshots': 'off',
|
|
50
57
|
'jest/prefer-lowercase-title': 'off',
|
|
51
58
|
'jest/prefer-mock-promise-shorthand': 'warn',
|
|
59
|
+
'jest/prefer-mock-return-shorthand': 'warn',
|
|
52
60
|
'jest/prefer-snapshot-hint': 'warn',
|
|
53
61
|
'jest/prefer-spy-on': 'off',
|
|
54
62
|
'jest/prefer-strict-equal': 'off',
|
package/src/modules/react.mjs
CHANGED
|
@@ -110,13 +110,20 @@ function react(options = {}) {
|
|
|
110
110
|
'@eslint-react/prefer-use-state-lazy-initialization': 'warn',
|
|
111
111
|
'@eslint-react/prefer-destructuring-assignment': 'warn',
|
|
112
112
|
|
|
113
|
-
'@eslint-react/hooks-extra/no-direct-set-state-in-use-effect': '
|
|
113
|
+
'@eslint-react/hooks-extra/no-direct-set-state-in-use-effect': 'off',
|
|
114
114
|
|
|
115
115
|
'@eslint-react/naming-convention/component-name': 'warn',
|
|
116
116
|
'@eslint-react/naming-convention/context-name': 'warn',
|
|
117
117
|
'@eslint-react/naming-convention/filename-extension': ['error', { allow: 'always', extensions: ['.jsx', '.tsx'] }],
|
|
118
118
|
'@eslint-react/naming-convention/filename': 'off',
|
|
119
|
-
'@eslint-react/naming-convention/
|
|
119
|
+
'@eslint-react/naming-convention/ref-name': 'warn',
|
|
120
|
+
'@eslint-react/naming-convention/use-state': [
|
|
121
|
+
'warn',
|
|
122
|
+
{
|
|
123
|
+
enforceAssignment: true,
|
|
124
|
+
enforceSetterName: false,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
120
127
|
|
|
121
128
|
'@eslint-react/web-api/no-leaked-timeout': 'error',
|
|
122
129
|
'@eslint-react/web-api/no-leaked-event-listener': 'error',
|
|
@@ -16,7 +16,7 @@ function stylistic() {
|
|
|
16
16
|
html: true,
|
|
17
17
|
},
|
|
18
18
|
],
|
|
19
|
-
'@stylistic/no-mixed-operators':
|
|
19
|
+
'@stylistic/no-mixed-operators': 'off', //conflict with prettier
|
|
20
20
|
'@stylistic/padding-line-between-statements': [
|
|
21
21
|
'warn',
|
|
22
22
|
{ blankLine: 'always', prev: ['case', 'default'], next: '*' },
|
|
@@ -117,7 +117,7 @@ function typescript(options = {}) {
|
|
|
117
117
|
],
|
|
118
118
|
'@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: true }],
|
|
119
119
|
'@typescript-eslint/no-useless-constructor': 'error',
|
|
120
|
-
'@typescript-eslint/no-useless-default-assignment': '
|
|
120
|
+
'@typescript-eslint/no-useless-default-assignment': 'warn',
|
|
121
121
|
'@typescript-eslint/no-useless-empty-export': 'warn',
|
|
122
122
|
'@typescript-eslint/parameter-properties': 'off',
|
|
123
123
|
'@typescript-eslint/prefer-as-const': 'warn',
|
package/src/modules/vitest.mjs
CHANGED
|
@@ -58,6 +58,7 @@ function vitest() {
|
|
|
58
58
|
'vitest/no-standalone-expect': 'warn',
|
|
59
59
|
'vitest/no-test-prefixes': 'warn',
|
|
60
60
|
'vitest/no-test-return-statement': 'warn',
|
|
61
|
+
'vitest/no-unneeded-async-expect-function': 'warn',
|
|
61
62
|
|
|
62
63
|
'vitest/prefer-called-once': 'warn',
|
|
63
64
|
'vitest/prefer-called-times': 'off',
|
|
@@ -73,6 +74,7 @@ function vitest() {
|
|
|
73
74
|
'vitest/prefer-importing-vitest-globals': 'off',
|
|
74
75
|
'vitest/prefer-lowercase-title': 'warn',
|
|
75
76
|
'vitest/prefer-mock-promise-shorthand': 'warn',
|
|
77
|
+
'vitest/prefer-mock-return-shorthand': 'warn',
|
|
76
78
|
'vitest/prefer-snapshot-hint': 'warn',
|
|
77
79
|
'vitest/prefer-spy-on': 'warn',
|
|
78
80
|
'vitest/prefer-strict-boolean-matchers': 'off',
|