@fullstacksjs/eslint-config 13.8.2 → 13.9.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.
@@ -57,7 +57,7 @@ function base(options = {}) {
57
57
  skipComments: false
58
58
  }],
59
59
  'max-nested-callbacks': ['error', 7],
60
- 'max-params': ['error', 7],
60
+ 'max-params': ['error', 3],
61
61
  'max-statements': ['error', 40],
62
62
  'no-alert': 'error',
63
63
  'no-array-constructor': 'error',
@@ -22,7 +22,7 @@ function next() {
22
22
  'next/no-before-interactive-script-outside-document': 'warn',
23
23
  'next/no-css-tags': 'warn',
24
24
  'next/no-document-import-in-page': 'warn',
25
- // 'next/no-duplicate-head': 'warn',
25
+ 'next/no-duplicate-head': 'warn',
26
26
  'next/no-head-element': 'warn',
27
27
  'next/no-head-import-in-document': 'warn',
28
28
  'next/no-html-link-for-pages': 'warn',
@@ -35,21 +35,21 @@ function prettier() {
35
35
  '@typescript-eslint/space-before-function-paren': 'off',
36
36
  '@typescript-eslint/space-infix-ops': 'off',
37
37
  '@typescript-eslint/type-annotation-spacing': 'off',
38
- 'react/jsx-child-element-spacing': 'off',
39
- 'react/jsx-closing-bracket-location': 'off',
40
- 'react/jsx-closing-tag-location': 'off',
41
- 'react/jsx-curly-newline': 'off',
42
- 'react/jsx-curly-spacing': 'off',
43
- 'react/jsx-equals-spacing': 'off',
44
- 'react/jsx-first-prop-new-line': 'off',
45
- 'react/jsx-indent': 'off',
46
- 'react/jsx-indent-props': 'off',
47
- 'react/jsx-max-props-per-line': 'off',
48
- 'react/jsx-newline': 'off',
49
- 'react/jsx-one-expression-per-line': 'off',
50
- 'react/jsx-props-no-multi-spaces': 'off',
51
- 'react/jsx-tag-spacing': 'off',
52
- 'react/jsx-wrap-multilines': 'off',
38
+ '@stylistic/jsx-child-element-spacing': 'off',
39
+ '@stylistic/jsx-closing-bracket-location': 'off',
40
+ '@stylistic/jsx-closing-tag-location': 'off',
41
+ '@stylistic/jsx-curly-newline': 'off',
42
+ '@stylistic/jsx-curly-spacing': 'off',
43
+ '@stylistic/jsx-equals-spacing': 'off',
44
+ '@stylistic/jsx-first-prop-new-line': 'off',
45
+ '@stylistic/jsx-indent': 'off',
46
+ '@stylistic/jsx-indent-props': 'off',
47
+ '@stylistic/jsx-max-props-per-line': 'off',
48
+ '@stylistic/jsx-newline': 'off',
49
+ '@stylistic/jsx-one-expression-per-line': 'off',
50
+ '@stylistic/jsx-props-no-multi-spaces': 'off',
51
+ '@stylistic/jsx-tag-spacing': 'off',
52
+ '@stylistic/jsx-wrap-multilines': 'off',
53
53
  'vue/html-self-closing': 'off',
54
54
  'vue/max-len': 'off',
55
55
  'vue/array-bracket-newline': 'off',
@@ -7,17 +7,28 @@ Object.defineProperty(exports, "__esModule", {
7
7
  var _eslintPlugin = _interopRequireDefault(require("@eslint-react/eslint-plugin"));
8
8
  var _eslintPluginJsxA11y = _interopRequireDefault(require("eslint-plugin-jsx-a11y"));
9
9
  var _eslintPluginReactHooks = _interopRequireDefault(require("eslint-plugin-react-hooks"));
10
+ var _typescriptEslint = require("typescript-eslint");
10
11
  var _conditions = require("../utils/conditions.js");
12
+ var _globs = require("../utils/globs.js");
11
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
14
  /** @return { import('eslint').Linter.Config } */
13
15
  function react(options = {}) {
14
16
  const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
15
17
  return {
18
+ files: [_globs.globs.js, _globs.globs.jsx, _globs.globs.ts, _globs.globs.tsx],
16
19
  plugins: {
17
20
  ..._eslintPlugin.default.configs.all.plugins,
18
21
  'react-hooks': _eslintPluginReactHooks.default,
19
22
  'jsx-a11y': _eslintPluginJsxA11y.default
20
23
  },
24
+ ...(0, _conditions.predicate)(projectService, {
25
+ languageOptions: {
26
+ parser: _typescriptEslint.parser,
27
+ parserOptions: {
28
+ ...options.typescript
29
+ }
30
+ }
31
+ }),
21
32
  settings: {
22
33
  'react': {
23
34
  pragma: 'React',
@@ -32,7 +32,7 @@ function storybook() {
32
32
  'storybook/no-title-property-in-meta': 'off',
33
33
  // Conflicts
34
34
  '@typescript-eslint/no-confusing-void-expression': 'off',
35
- 'react/jsx-no-useless-fragment': 'off',
35
+ '@eslint-react/no-useless-fragment': 'off',
36
36
  'react-hooks/rules-of-hooks': 'off'
37
37
  }
38
38
  };
@@ -39,7 +39,7 @@ function typescript(options = {}) {
39
39
  '@typescript-eslint/camelcase': 'off',
40
40
  '@typescript-eslint/class-literal-property-style': ['error', 'getters'],
41
41
  '@typescript-eslint/consistent-generic-constructors': ['warn', 'constructor'],
42
- '@typescript-eslint/consistent-indexed-object-style': 'off',
42
+ '@typescript-eslint/consistent-indexed-object-style': 'warn',
43
43
  '@typescript-eslint/consistent-type-assertions': 'error',
44
44
  '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
45
45
  '@typescript-eslint/consistent-type-imports': ['warn', {
@@ -71,7 +71,7 @@ function typescript(options = {}) {
71
71
  '@typescript-eslint/no-empty-object-type': ['warn', {
72
72
  allowInterfaces: 'with-single-extends'
73
73
  }],
74
- '@typescript-eslint/no-explicit-any': 'off',
74
+ '@typescript-eslint/no-explicit-any': (0, _conditions.strict)(options, 'warn'),
75
75
  '@typescript-eslint/no-extra-non-null-assertion': 'error',
76
76
  '@typescript-eslint/no-extraneous-class': ['warn', {
77
77
  allowWithDecorator: true
@@ -105,12 +105,14 @@ function typescript(options = {}) {
105
105
  '@typescript-eslint/no-this-alias': 'error',
106
106
  '@typescript-eslint/no-type-alias': 'off',
107
107
  '@typescript-eslint/no-unnecessary-type-constraint': 'warn',
108
- '@typescript-eslint/no-unsafe-argument': 'off',
109
- '@typescript-eslint/no-unsafe-assignment': 'off',
110
- '@typescript-eslint/no-unsafe-call': 'off',
108
+ '@typescript-eslint/no-unsafe-argument': (0, _conditions.strict)(options, 'warn'),
109
+ '@typescript-eslint/no-unsafe-assignment': (0, _conditions.strict)(options, 'warn'),
110
+ '@typescript-eslint/no-unsafe-call': (0, _conditions.strict)(options, 'warn'),
111
111
  '@typescript-eslint/no-unsafe-declaration-merging': 'warn',
112
- '@typescript-eslint/no-unsafe-member-access': 'off',
113
- '@typescript-eslint/no-unsafe-return': 'off',
112
+ '@typescript-eslint/no-unsafe-member-access': (0, _conditions.strict)(options, ['warn', {
113
+ allowOptionalChaining: true
114
+ }]),
115
+ '@typescript-eslint/no-unsafe-return': (0, _conditions.strict)(options, 'warn'),
114
116
  '@typescript-eslint/no-untyped-public-signature': 'off',
115
117
  '@typescript-eslint/no-unused-expressions': 'error',
116
118
  '@typescript-eslint/no-unused-vars': ['warn', {
@@ -197,6 +199,7 @@ function typescript(options = {}) {
197
199
  '@typescript-eslint/no-unnecessary-type-conversion': 'error',
198
200
  '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
199
201
  '@typescript-eslint/no-unsafe-enum-comparison': 'warn',
202
+ '@typescript-eslint/no-unsafe-function-type': 'warn',
200
203
  '@typescript-eslint/no-unnecessary-condition': ['warn', {
201
204
  allowConstantLoopConditions: false
202
205
  }],
@@ -243,10 +246,6 @@ function typescript(options = {}) {
243
246
  'prefer-promise-reject-errors': 'off',
244
247
  'consistent-return': 'off'
245
248
  }),
246
- // open issues
247
- 'react/jsx-no-useless-fragment': 'off',
248
- // Need useless-fragment for JSX return type
249
-
250
249
  // Conflicts with @typescript-eslint
251
250
  'no-empty-function': 'off',
252
251
  'default-case': 'off',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "13.8.2",
3
+ "version": "13.9.0",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
@@ -35,45 +35,45 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@eslint-react/eslint-plugin": "2.0.6",
38
+ "@eslint-react/eslint-plugin": "2.2.3",
39
39
  "@eslint/compat": "1.4.0",
40
- "@next/eslint-plugin-next": "15.5.4",
41
- "@stylistic/eslint-plugin": "5.4.0",
42
- "@vitest/eslint-plugin": "1.3.13",
40
+ "@next/eslint-plugin-next": "16.0.0",
41
+ "@stylistic/eslint-plugin": "5.5.0",
42
+ "@vitest/eslint-plugin": "1.3.24",
43
43
  "deepmerge": "4.3.1",
44
- "eslint-plugin-better-tailwindcss": "3.7.9",
45
- "eslint-plugin-cypress": "5.1.1",
44
+ "eslint-plugin-better-tailwindcss": "3.7.10",
45
+ "eslint-plugin-cypress": "5.2.0",
46
46
  "eslint-plugin-import-x": "4.16.1",
47
47
  "eslint-plugin-jest": "29.0.1",
48
48
  "eslint-plugin-jsx-a11y": "6.10.2",
49
49
  "eslint-plugin-n": "17.23.1",
50
- "eslint-plugin-perfectionist": "4.15.0",
50
+ "eslint-plugin-perfectionist": "4.15.1",
51
51
  "eslint-plugin-playwright": "2.2.2",
52
52
  "eslint-plugin-prettier": "5.5.4",
53
53
  "eslint-plugin-promise": "7.2.1",
54
- "eslint-plugin-react-hooks": "7.0.0",
54
+ "eslint-plugin-react-hooks": "7.0.1",
55
55
  "eslint-plugin-regexp": "2.10.0",
56
56
  "eslint-plugin-storybook": "0.12.0",
57
57
  "globals": "16.4.0",
58
58
  "local-pkg": "1.1.2",
59
- "typescript-eslint": "8.44.1"
59
+ "typescript-eslint": "8.46.2"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@eslint/eslintrc": "3.3.1",
63
- "@eslint/js": "9.36.0",
64
- "@semantic-release/github": "11.0.6",
65
- "@semantic-release/npm": "12.0.2",
63
+ "@eslint/js": "9.38.0",
64
+ "@semantic-release/github": "12.0.0",
65
+ "@semantic-release/npm": "13.1.1",
66
66
  "@semantic-release/release-notes-generator": "14.1.0",
67
67
  "@types/eslint": "9.6.1",
68
- "cspell": "9.2.1",
69
- "eslint": "9.36.0",
68
+ "cspell": "9.2.2",
69
+ "eslint": "9.38.0",
70
70
  "husky": "9.1.7",
71
- "jest": "30.1.3",
72
- "lint-staged": "16.2.1",
71
+ "jest": "30.2.0",
72
+ "lint-staged": "16.2.6",
73
73
  "pinst": "3.0.0",
74
74
  "prettier": "3.6.2",
75
- "semantic-release": "24.2.9",
76
- "typescript": "5.9.2",
75
+ "semantic-release": "25.0.1",
76
+ "typescript": "5.9.3",
77
77
  "unbuild": "3.6.1"
78
78
  },
79
79
  "peerDependencies": {
@@ -96,5 +96,9 @@
96
96
  "jest": {
97
97
  "optional": true
98
98
  }
99
+ },
100
+ "volta": {
101
+ "node": "22.20.0",
102
+ "npm": "11.6.2"
99
103
  }
100
104
  }
@@ -45,7 +45,7 @@ function base(options = {}) {
45
45
  'max-lines-per-function': ['error', 150],
46
46
  'max-lines': ['error', { max: 2500, skipBlankLines: false, skipComments: false }],
47
47
  'max-nested-callbacks': ['error', 7],
48
- 'max-params': ['error', 7],
48
+ 'max-params': ['error', 3],
49
49
  'max-statements': ['error', 40],
50
50
  'no-alert': 'error',
51
51
  'no-array-constructor': 'error',
@@ -14,7 +14,7 @@ function next() {
14
14
  'next/no-before-interactive-script-outside-document': 'warn',
15
15
  'next/no-css-tags': 'warn',
16
16
  'next/no-document-import-in-page': 'warn',
17
- // 'next/no-duplicate-head': 'warn',
17
+ 'next/no-duplicate-head': 'warn',
18
18
  'next/no-head-element': 'warn',
19
19
  'next/no-head-import-in-document': 'warn',
20
20
  'next/no-html-link-for-pages': 'warn',
@@ -30,21 +30,21 @@ function prettier() {
30
30
  '@typescript-eslint/space-infix-ops': 'off',
31
31
  '@typescript-eslint/type-annotation-spacing': 'off',
32
32
 
33
- 'react/jsx-child-element-spacing': 'off',
34
- 'react/jsx-closing-bracket-location': 'off',
35
- 'react/jsx-closing-tag-location': 'off',
36
- 'react/jsx-curly-newline': 'off',
37
- 'react/jsx-curly-spacing': 'off',
38
- 'react/jsx-equals-spacing': 'off',
39
- 'react/jsx-first-prop-new-line': 'off',
40
- 'react/jsx-indent': 'off',
41
- 'react/jsx-indent-props': 'off',
42
- 'react/jsx-max-props-per-line': 'off',
43
- 'react/jsx-newline': 'off',
44
- 'react/jsx-one-expression-per-line': 'off',
45
- 'react/jsx-props-no-multi-spaces': 'off',
46
- 'react/jsx-tag-spacing': 'off',
47
- 'react/jsx-wrap-multilines': 'off',
33
+ '@stylistic/jsx-child-element-spacing': 'off',
34
+ '@stylistic/jsx-closing-bracket-location': 'off',
35
+ '@stylistic/jsx-closing-tag-location': 'off',
36
+ '@stylistic/jsx-curly-newline': 'off',
37
+ '@stylistic/jsx-curly-spacing': 'off',
38
+ '@stylistic/jsx-equals-spacing': 'off',
39
+ '@stylistic/jsx-first-prop-new-line': 'off',
40
+ '@stylistic/jsx-indent': 'off',
41
+ '@stylistic/jsx-indent-props': 'off',
42
+ '@stylistic/jsx-max-props-per-line': 'off',
43
+ '@stylistic/jsx-newline': 'off',
44
+ '@stylistic/jsx-one-expression-per-line': 'off',
45
+ '@stylistic/jsx-props-no-multi-spaces': 'off',
46
+ '@stylistic/jsx-tag-spacing': 'off',
47
+ '@stylistic/jsx-wrap-multilines': 'off',
48
48
 
49
49
  'vue/html-self-closing': 'off',
50
50
  'vue/max-len': 'off',
@@ -1,19 +1,28 @@
1
1
  import reactPlugin from '@eslint-react/eslint-plugin';
2
2
  import a11yPlugin from 'eslint-plugin-jsx-a11y';
3
3
  import hooksPlugin from 'eslint-plugin-react-hooks';
4
+ import { parser } from 'typescript-eslint';
4
5
 
5
6
  import { predicate } from '../utils/conditions.mjs';
7
+ import { globs } from '../utils/globs.mjs';
6
8
 
7
9
  /** @return { import('eslint').Linter.Config } */
8
10
  function react(options = {}) {
9
11
  const projectService = options.typescript && options.typescript.tsconfigRootDir && options.typescript.projectService;
10
12
 
11
13
  return {
14
+ files: [globs.js, globs.jsx, globs.ts, globs.tsx],
12
15
  plugins: {
13
16
  ...reactPlugin.configs.all.plugins,
14
17
  'react-hooks': hooksPlugin,
15
18
  'jsx-a11y': a11yPlugin,
16
19
  },
20
+ ...predicate(projectService, {
21
+ languageOptions: {
22
+ parser,
23
+ parserOptions: { ...options.typescript },
24
+ },
25
+ }),
17
26
  settings: {
18
27
  'react': {
19
28
  pragma: 'React',
@@ -27,7 +27,7 @@ function storybook() {
27
27
 
28
28
  // Conflicts
29
29
  '@typescript-eslint/no-confusing-void-expression': 'off',
30
- 'react/jsx-no-useless-fragment': 'off',
30
+ '@eslint-react/no-useless-fragment': 'off',
31
31
  'react-hooks/rules-of-hooks': 'off',
32
32
  },
33
33
  };
@@ -1,6 +1,6 @@
1
1
  import { parser, plugin } from 'typescript-eslint';
2
2
 
3
- import { predicate } from '../utils/conditions.mjs';
3
+ import { predicate, strict } from '../utils/conditions.mjs';
4
4
  import { globs } from '../utils/globs.mjs';
5
5
  import { namingConvention } from '../utils/naming-convention.mjs';
6
6
 
@@ -37,7 +37,7 @@ function typescript(options = {}) {
37
37
  '@typescript-eslint/camelcase': 'off',
38
38
  '@typescript-eslint/class-literal-property-style': ['error', 'getters'],
39
39
  '@typescript-eslint/consistent-generic-constructors': ['warn', 'constructor'],
40
- '@typescript-eslint/consistent-indexed-object-style': 'off',
40
+ '@typescript-eslint/consistent-indexed-object-style': 'warn',
41
41
  '@typescript-eslint/consistent-type-assertions': 'error',
42
42
  '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
43
43
  '@typescript-eslint/consistent-type-imports': [
@@ -74,7 +74,7 @@ function typescript(options = {}) {
74
74
  '@typescript-eslint/no-dynamic-delete': 'error',
75
75
  '@typescript-eslint/no-empty-function': 'error',
76
76
  '@typescript-eslint/no-empty-object-type': ['warn', { allowInterfaces: 'with-single-extends' }],
77
- '@typescript-eslint/no-explicit-any': 'off',
77
+ '@typescript-eslint/no-explicit-any': strict(options, 'warn'),
78
78
  '@typescript-eslint/no-extra-non-null-assertion': 'error',
79
79
  '@typescript-eslint/no-extraneous-class': ['warn', { allowWithDecorator: true }],
80
80
  '@typescript-eslint/no-import-type-side-effects': 'warn',
@@ -96,12 +96,12 @@ function typescript(options = {}) {
96
96
  '@typescript-eslint/no-this-alias': 'error',
97
97
  '@typescript-eslint/no-type-alias': 'off',
98
98
  '@typescript-eslint/no-unnecessary-type-constraint': 'warn',
99
- '@typescript-eslint/no-unsafe-argument': 'off',
100
- '@typescript-eslint/no-unsafe-assignment': 'off',
101
- '@typescript-eslint/no-unsafe-call': 'off',
99
+ '@typescript-eslint/no-unsafe-argument': strict(options, 'warn'),
100
+ '@typescript-eslint/no-unsafe-assignment': strict(options, 'warn'),
101
+ '@typescript-eslint/no-unsafe-call': strict(options, 'warn'),
102
102
  '@typescript-eslint/no-unsafe-declaration-merging': 'warn',
103
- '@typescript-eslint/no-unsafe-member-access': 'off',
104
- '@typescript-eslint/no-unsafe-return': 'off',
103
+ '@typescript-eslint/no-unsafe-member-access': strict(options, ['warn', { allowOptionalChaining: true }]),
104
+ '@typescript-eslint/no-unsafe-return': strict(options, 'warn'),
105
105
  '@typescript-eslint/no-untyped-public-signature': 'off',
106
106
  '@typescript-eslint/no-unused-expressions': 'error',
107
107
  '@typescript-eslint/no-unused-vars': [
@@ -171,6 +171,7 @@ function typescript(options = {}) {
171
171
  '@typescript-eslint/no-unnecessary-type-conversion': 'error',
172
172
  '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
173
173
  '@typescript-eslint/no-unsafe-enum-comparison': 'warn',
174
+ '@typescript-eslint/no-unsafe-function-type': 'warn',
174
175
  '@typescript-eslint/no-unnecessary-condition': [
175
176
  'warn',
176
177
  {
@@ -215,9 +216,6 @@ function typescript(options = {}) {
215
216
  'consistent-return': 'off',
216
217
  }),
217
218
 
218
- // open issues
219
- 'react/jsx-no-useless-fragment': 'off', // Need useless-fragment for JSX return type
220
-
221
219
  // Conflicts with @typescript-eslint
222
220
  'no-empty-function': 'off',
223
221
  'default-case': 'off',