@fullstacksjs/eslint-config 12.1.0 → 12.2.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/cjs/index.js CHANGED
@@ -97,17 +97,17 @@ function defineConfig(initOptions = {}, ...extend) {
97
97
  if (enableSort) rules.push((0, _perfectionist.default)(options));
98
98
  if (enableImport) rules.push((0, _imports.default)(options));
99
99
  if (enableTailwind) rules.push((0, _tailwind.default)(options));
100
- if (enableTest) rules.push((0, _tests.default)(options));
101
100
  if (enableNode) rules.push((0, _node.default)(options));
102
- if (enableJest) rules.push((0, _jest.default)(options));
103
- if (enableVitest) rules.push((0, _vitest.default)(options));
104
- if (enableCypress) rules.push((0, _cypress.default)(options));
105
101
  if (enableReact) rules.push((0, _react.default)(options));
106
102
  if (enableStorybook) rules.push((0, _storybook.default)(options));
107
103
  if (enableTypescript) rules.push((0, _typescript.default)(options));
108
- if (enablePlaywright) rules.push((0, _playwright.default)(options));
109
- if (enableNext && enableNext) rules.push((0, _next.default)(options));
104
+ if (enableNext) rules.push((0, _next.default)(options));
110
105
  if (enablePrettier) rules.push((0, _prettier.default)(options));
106
+ if (enableJest) rules.push((0, _jest.default)(options));
107
+ if (enableVitest) rules.push((0, _vitest.default)(options));
108
+ if (enableTest) rules.push((0, _tests.default)(options));
109
+ if (enableCypress) rules.push((0, _cypress.default)(options));
110
+ if (enablePlaywright) rules.push((0, _playwright.default)(options));
111
111
  if (Object.keys(eslintOptions).length > 0) rules.push(eslintOptions);
112
112
  if (extend) Array.prototype.push.apply(rules, extend);
113
113
  return (0, _config.defineConfig)(rules);
@@ -23,6 +23,7 @@ function cypress() {
23
23
  'cypress/no-unnecessary-waiting': 'error',
24
24
  'cypress/require-data-selectors': 'off',
25
25
  'cypress/unsafe-to-chain-command': 'error',
26
+ 'cypress/no-chained-get': 'error',
26
27
  '@typescript-eslint/no-namespace': 'off'
27
28
  }
28
29
  };
@@ -38,6 +38,9 @@ function react() {
38
38
  '@eslint-react/dom/no-unsafe-iframe-sandbox': 'warn',
39
39
  '@eslint-react/dom/no-unsafe-target-blank': 'warn',
40
40
  '@eslint-react/ensure-forward-ref-using-ref': 'off',
41
+ '@eslint-react/jsx-key-before-spread': 'error',
42
+ '@eslint-react/jsx-no-undef': 'off',
43
+ '@eslint-react/jsx-uses-react': 'off',
41
44
  '@eslint-react/no-access-state-in-setstate': 'error',
42
45
  '@eslint-react/no-array-index-key': 'warn',
43
46
  '@eslint-react/no-children-count': 'warn',
@@ -57,7 +60,9 @@ function react() {
57
60
  '@eslint-react/no-implicit-key': 'error',
58
61
  '@eslint-react/no-missing-context-display-name': 'off',
59
62
  '@eslint-react/no-missing-key': 'error',
63
+ '@eslint-react/no-misused-capture-owner-stack': 'error',
60
64
  '@eslint-react/no-nested-component-definitions': 'warn',
65
+ '@eslint-react/no-nested-lazy-component-declarations': 'error',
61
66
  '@eslint-react/no-redundant-should-component-update': 'error',
62
67
  '@eslint-react/no-set-state-in-component-did-mount': 'warn',
63
68
  '@eslint-react/no-set-state-in-component-did-update': 'warn',
@@ -74,7 +79,9 @@ function react() {
74
79
  '@eslint-react/no-useless-fragment': 'warn',
75
80
  '@eslint-react/prefer-destructuring-assignment': 'warn',
76
81
  '@eslint-react/prefer-shorthand-boolean': 'warn',
82
+ '@eslint-react/avoid-shorthand-boolean': 'off',
77
83
  '@eslint-react/prefer-shorthand-fragment': 'warn',
84
+ '@eslint-react/avoid-shorthand-fragment': 'off',
78
85
  '@eslint-react/hooks-extra/ensure-custom-hooks-using-other-hooks': 'warn',
79
86
  '@eslint-react/hooks-extra/ensure-use-memo-has-non-empty-deps': 'warn',
80
87
  '@eslint-react/hooks-extra/prefer-use-state-lazy-initialization': 'warn',
@@ -19,6 +19,7 @@ function storybook() {
19
19
  'storybook/context-in-play-function': 'error',
20
20
  'storybook/default-exports': 'error',
21
21
  'storybook/hierarchy-separator': 'warn',
22
+ 'storybook/meta-satisfies-type': 'warn',
22
23
  'storybook/no-redundant-story-name': 'warn',
23
24
  'storybook/no-uninstalled-addons': 'error',
24
25
  'storybook/prefer-pascal-case': 'warn',
@@ -26,9 +27,9 @@ function storybook() {
26
27
  'storybook/use-storybook-expect': 'error',
27
28
  'storybook/use-storybook-testing-library': 'error',
28
29
  'storybook/csf-component': 'warn',
30
+ 'storybook/meta-inline-properties': 'off',
29
31
  'storybook/no-stories-of': 'warn',
30
32
  'storybook/no-title-property-in-meta': 'off',
31
- 'storybook/meta-inline-properties': 'off',
32
33
  // Conflicts
33
34
  '@typescript-eslint/no-confusing-void-expression': 'off',
34
35
  'react/jsx-no-useless-fragment': 'off',
@@ -13,6 +13,7 @@ var _namingConvention = require("../utils/naming-convention.js");
13
13
  * @return { import('eslint').Linter.Config }
14
14
  */
15
15
  function typescript(options = {}) {
16
+ const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
16
17
  return {
17
18
  files: [_globs.globs.ts, _globs.globs.tsx],
18
19
  plugins: {
@@ -55,7 +56,7 @@ function typescript(options = {}) {
55
56
  '@typescript-eslint/member-naming': 'off',
56
57
  '@typescript-eslint/member-ordering': 'off',
57
58
  '@typescript-eslint/method-signature-style': ['warn', 'property'],
58
- '@typescript-eslint/naming-convention': ['warn', ..._namingConvention.namingConvention, ...(options.typescript && options.typescript.projects ? [{
59
+ '@typescript-eslint/naming-convention': ['warn', ..._namingConvention.namingConvention, ...(projectService ? [{
59
60
  selector: 'variable',
60
61
  types: ['boolean'],
61
62
  format: ['PascalCase'],
@@ -160,7 +161,7 @@ function typescript(options = {}) {
160
161
  }],
161
162
  '@typescript-eslint/unified-signatures': 'error',
162
163
  '@typescript-eslint/key-spacing': 'off',
163
- ...(0, _conditions.predicate)(options.typescript && options.typescript.projects, {
164
+ ...(0, _conditions.predicate)(projectService, {
164
165
  '@typescript-eslint/await-thenable': 'error',
165
166
  '@typescript-eslint/consistent-return': 'off',
166
167
  '@typescript-eslint/consistent-type-exports': 'warn',
@@ -193,7 +194,7 @@ function typescript(options = {}) {
193
194
  '@typescript-eslint/no-misused-spread': 'error',
194
195
  '@typescript-eslint/no-mixed-enums': 'error',
195
196
  '@typescript-eslint/no-redundant-type-constituents': 'warn',
196
- // '@typescript-eslint/no-throw-literal': ['warn', { allowThrowingUnknown: false }],
197
+ '@typescript-eslint/no-unnecessary-type-conversion': 'error',
197
198
  '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
198
199
  '@typescript-eslint/no-unsafe-enum-comparison': 'warn',
199
200
  '@typescript-eslint/no-unnecessary-condition': ['warn', {
@@ -206,6 +207,9 @@ function typescript(options = {}) {
206
207
  '@typescript-eslint/no-unnecessary-type-assertion': 'error',
207
208
  '@typescript-eslint/no-unsafe-unary-minus': 'error',
208
209
  '@typescript-eslint/non-nullable-type-assertion-style': 'warn',
210
+ '@typescript-eslint/only-throw-error': ['warn', {
211
+ allowRethrowing: true
212
+ }],
209
213
  '@typescript-eslint/prefer-includes': 'warn',
210
214
  '@typescript-eslint/prefer-optional-chain': 'warn',
211
215
  '@typescript-eslint/prefer-reduce-type-parameter': 'warn',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "12.1.0",
3
+ "version": "12.2.0",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
@@ -34,44 +34,44 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@eslint-react/eslint-plugin": "1.37.3",
38
- "@next/eslint-plugin-next": "15.2.3",
39
- "@stylistic/eslint-plugin": "4.2.0",
37
+ "@eslint-react/eslint-plugin": "1.50.0",
38
+ "@next/eslint-plugin-next": "15.3.2",
39
+ "@stylistic/eslint-plugin": "4.4.0",
40
40
  "deepmerge": "4.3.1",
41
- "eslint-plugin-cypress": "4.2.0",
42
- "eslint-plugin-import-x": "4.9.1",
41
+ "eslint-plugin-cypress": "4.3.0",
42
+ "eslint-plugin-import-x": "4.13.3",
43
43
  "eslint-plugin-jest": "28.11.0",
44
44
  "eslint-plugin-jest-formatting": "3.1.0",
45
45
  "eslint-plugin-jsx-a11y": "6.10.2",
46
- "eslint-plugin-n": "17.16.2",
47
- "eslint-plugin-perfectionist": "4.10.1",
46
+ "eslint-plugin-n": "17.18.0",
47
+ "eslint-plugin-perfectionist": "4.13.0",
48
48
  "eslint-plugin-playwright": "2.2.0",
49
- "eslint-plugin-prettier": "5.2.3",
49
+ "eslint-plugin-prettier": "5.4.0",
50
50
  "eslint-plugin-promise": "7.2.1",
51
51
  "eslint-plugin-react-hooks": "5.2.0",
52
- "eslint-plugin-storybook": "0.11.6",
52
+ "eslint-plugin-storybook": "0.12.0",
53
53
  "eslint-plugin-tailwindcss": "3.18.0",
54
54
  "eslint-plugin-vitest": "0.5.4",
55
- "globals": "16.0.0",
55
+ "globals": "16.2.0",
56
56
  "local-pkg": "1.1.1",
57
- "typescript-eslint": "8.29.1"
57
+ "typescript-eslint": "8.32.1"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@eslint/eslintrc": "3.3.1",
61
- "@eslint/js": "9.23.0",
62
- "@semantic-release/github": "11.0.1",
61
+ "@eslint/js": "9.27.0",
62
+ "@semantic-release/github": "11.0.3",
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.18.1",
67
- "eslint": "9.24.0",
66
+ "cspell": "9.0.2",
67
+ "eslint": "9.27.0",
68
68
  "husky": "9.1.7",
69
69
  "jest": "29.7.0",
70
- "lint-staged": "15.5.1",
70
+ "lint-staged": "16.0.0",
71
71
  "np": "10.2.0",
72
72
  "pinst": "3.0.0",
73
73
  "prettier": "3.5.3",
74
- "semantic-release": "24.2.3",
74
+ "semantic-release": "24.2.5",
75
75
  "typescript": "5.8.3",
76
76
  "unbuild": "3.5.0"
77
77
  },
package/src/index.mjs CHANGED
@@ -92,17 +92,17 @@ export function defineConfig(initOptions = {}, ...extend) {
92
92
  if (enableSort) rules.push(perfectionist(options));
93
93
  if (enableImport) rules.push(imports(options));
94
94
  if (enableTailwind) rules.push(tailwind(options));
95
- if (enableTest) rules.push(tests(options));
96
95
  if (enableNode) rules.push(node(options));
97
- if (enableJest) rules.push(jest(options));
98
- if (enableVitest) rules.push(vitest(options));
99
- if (enableCypress) rules.push(cypress(options));
100
96
  if (enableReact) rules.push(react(options));
101
97
  if (enableStorybook) rules.push(storybook(options));
102
98
  if (enableTypescript) rules.push(typescript(options));
103
- if (enablePlaywright) rules.push(playwright(options));
104
- if (enableNext && enableNext) rules.push(next(options));
99
+ if (enableNext) rules.push(next(options));
105
100
  if (enablePrettier) rules.push(prettier(options));
101
+ if (enableJest) rules.push(jest(options));
102
+ if (enableVitest) rules.push(vitest(options));
103
+ if (enableTest) rules.push(tests(options));
104
+ if (enableCypress) rules.push(cypress(options));
105
+ if (enablePlaywright) rules.push(playwright(options));
106
106
 
107
107
  if (Object.keys(eslintOptions).length > 0) rules.push(eslintOptions);
108
108
  if (extend) Array.prototype.push.apply(rules, extend);
@@ -16,6 +16,7 @@ function cypress() {
16
16
  'cypress/no-unnecessary-waiting': 'error',
17
17
  'cypress/require-data-selectors': 'off',
18
18
  'cypress/unsafe-to-chain-command': 'error',
19
+ 'cypress/no-chained-get': 'error',
19
20
  '@typescript-eslint/no-namespace': 'off',
20
21
  },
21
22
  };
@@ -32,6 +32,9 @@ function react() {
32
32
  '@eslint-react/dom/no-unsafe-iframe-sandbox': 'warn',
33
33
  '@eslint-react/dom/no-unsafe-target-blank': 'warn',
34
34
  '@eslint-react/ensure-forward-ref-using-ref': 'off',
35
+ '@eslint-react/jsx-key-before-spread': 'error',
36
+ '@eslint-react/jsx-no-undef': 'off',
37
+ '@eslint-react/jsx-uses-react': 'off',
35
38
  '@eslint-react/no-access-state-in-setstate': 'error',
36
39
  '@eslint-react/no-array-index-key': 'warn',
37
40
  '@eslint-react/no-children-count': 'warn',
@@ -51,7 +54,9 @@ function react() {
51
54
  '@eslint-react/no-implicit-key': 'error',
52
55
  '@eslint-react/no-missing-context-display-name': 'off',
53
56
  '@eslint-react/no-missing-key': 'error',
57
+ '@eslint-react/no-misused-capture-owner-stack': 'error',
54
58
  '@eslint-react/no-nested-component-definitions': 'warn',
59
+ '@eslint-react/no-nested-lazy-component-declarations': 'error',
55
60
  '@eslint-react/no-redundant-should-component-update': 'error',
56
61
  '@eslint-react/no-set-state-in-component-did-mount': 'warn',
57
62
  '@eslint-react/no-set-state-in-component-did-update': 'warn',
@@ -67,8 +72,12 @@ function react() {
67
72
  '@eslint-react/no-useless-forward-ref': 'warn',
68
73
  '@eslint-react/no-useless-fragment': 'warn',
69
74
  '@eslint-react/prefer-destructuring-assignment': 'warn',
75
+
70
76
  '@eslint-react/prefer-shorthand-boolean': 'warn',
77
+ '@eslint-react/avoid-shorthand-boolean': 'off',
78
+
71
79
  '@eslint-react/prefer-shorthand-fragment': 'warn',
80
+ '@eslint-react/avoid-shorthand-fragment': 'off',
72
81
 
73
82
  '@eslint-react/hooks-extra/ensure-custom-hooks-using-other-hooks': 'warn',
74
83
  '@eslint-react/hooks-extra/ensure-use-memo-has-non-empty-deps': 'warn',
@@ -12,6 +12,7 @@ function storybook() {
12
12
  'storybook/context-in-play-function': 'error',
13
13
  'storybook/default-exports': 'error',
14
14
  'storybook/hierarchy-separator': 'warn',
15
+ 'storybook/meta-satisfies-type': 'warn',
15
16
  'storybook/no-redundant-story-name': 'warn',
16
17
  'storybook/no-uninstalled-addons': 'error',
17
18
  'storybook/prefer-pascal-case': 'warn',
@@ -20,9 +21,9 @@ function storybook() {
20
21
  'storybook/use-storybook-testing-library': 'error',
21
22
 
22
23
  'storybook/csf-component': 'warn',
24
+ 'storybook/meta-inline-properties': 'off',
23
25
  'storybook/no-stories-of': 'warn',
24
26
  'storybook/no-title-property-in-meta': 'off',
25
- 'storybook/meta-inline-properties': 'off',
26
27
 
27
28
  // Conflicts
28
29
  '@typescript-eslint/no-confusing-void-expression': 'off',
@@ -9,6 +9,8 @@ import { namingConvention } from '../utils/naming-convention.mjs';
9
9
  * @return { import('eslint').Linter.Config }
10
10
  */
11
11
  function typescript(options = {}) {
12
+ const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
13
+
12
14
  return {
13
15
  files: [globs.ts, globs.tsx],
14
16
  plugins: { '@typescript-eslint': plugin },
@@ -54,7 +56,7 @@ function typescript(options = {}) {
54
56
  '@typescript-eslint/naming-convention': [
55
57
  'warn',
56
58
  ...namingConvention,
57
- ...(options.typescript && options.typescript.projects
59
+ ...(projectService
58
60
  ? [
59
61
  {
60
62
  selector: 'variable',
@@ -142,7 +144,7 @@ function typescript(options = {}) {
142
144
  '@typescript-eslint/unified-signatures': 'error',
143
145
  '@typescript-eslint/key-spacing': 'off',
144
146
 
145
- ...predicate(options.typescript && options.typescript.projects, {
147
+ ...predicate(projectService, {
146
148
  '@typescript-eslint/await-thenable': 'error',
147
149
  '@typescript-eslint/consistent-return': 'off',
148
150
  '@typescript-eslint/consistent-type-exports': 'warn',
@@ -166,7 +168,7 @@ function typescript(options = {}) {
166
168
  '@typescript-eslint/no-misused-spread': 'error',
167
169
  '@typescript-eslint/no-mixed-enums': 'error',
168
170
  '@typescript-eslint/no-redundant-type-constituents': 'warn',
169
- // '@typescript-eslint/no-throw-literal': ['warn', { allowThrowingUnknown: false }],
171
+ '@typescript-eslint/no-unnecessary-type-conversion': 'error',
170
172
  '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
171
173
  '@typescript-eslint/no-unsafe-enum-comparison': 'warn',
172
174
  '@typescript-eslint/no-unnecessary-condition': [
@@ -182,6 +184,7 @@ function typescript(options = {}) {
182
184
  '@typescript-eslint/no-unnecessary-type-assertion': 'error',
183
185
  '@typescript-eslint/no-unsafe-unary-minus': 'error',
184
186
  '@typescript-eslint/non-nullable-type-assertion-style': 'warn',
187
+ '@typescript-eslint/only-throw-error': ['warn', { allowRethrowing: true }],
185
188
  '@typescript-eslint/prefer-includes': 'warn',
186
189
  '@typescript-eslint/prefer-optional-chain': 'warn',
187
190
  '@typescript-eslint/prefer-reduce-type-parameter': 'warn',