@fullstacksjs/eslint-config 13.9.0 → 13.10.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 CHANGED
@@ -51,7 +51,7 @@ You can fine-tune module detection by overriding it, the `defineConfig` function
51
51
  ```typescript
52
52
  interface Options {
53
53
  react?: boolean | { additionalEffectHooks?: string }; // controls react, react-hooks, jsx/a11y plugins
54
- typescript?: ParserOptions // https://typescript-eslint.io/packages/parser#configuration
54
+ typescript?: boolean | ParserOptions // https://typescript-eslint.io/packages/parser#configuration
55
55
  node?: boolean; // controls node plugin
56
56
  sort?: boolean; // controls perfectionist plugin
57
57
  strict?: boolean; // controls strict rules
package/cjs/index.d.ts CHANGED
@@ -93,7 +93,7 @@ export interface Options extends Linter.Config {
93
93
  * Controls [TypeScript plugin](https://www.npmjs.com/package/typescript-eslint).
94
94
  * @default true - If you have `typescript` in your dependencies.
95
95
  */
96
- typescript?: { projectService?: boolean | ProjectService; tsconfigRootDir?: string; cacheLifetime?: number };
96
+ typescript?: boolean | { projectService?: boolean | ProjectService; tsconfigRootDir?: string; cacheLifetime?: number };
97
97
  /**
98
98
  * Disables expensive rules.
99
99
  * @default false
@@ -111,7 +111,7 @@ export interface Options extends Linter.Config {
111
111
  gitignore?: string | false;
112
112
  /**
113
113
  * Controls regex plugin.
114
- * @default true
114
+ * @default { allowedCharacterRanges: ['all'] }
115
115
  */
116
116
  regex?: boolean | { allowedCharacterRanges: string[] };
117
117
  }
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
 
7
7
  var _eslintPluginJest = _interopRequireDefault(require("eslint-plugin-jest"));
8
+ var _globals = _interopRequireDefault(require("globals"));
8
9
  var _globs = require("../utils/globs.js");
9
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
11
  /**
@@ -16,6 +17,11 @@ function jest() {
16
17
  plugins: {
17
18
  jest: _eslintPluginJest.default
18
19
  },
20
+ languageOptions: {
21
+ globals: {
22
+ ..._globals.default.jest
23
+ }
24
+ },
19
25
  rules: {
20
26
  'jest/consistent-test-it': 'off',
21
27
  'jest/expect-expect': 'off',
@@ -15,9 +15,6 @@ function playwright() {
15
15
  },
16
16
  files: _globs.globs.e2e,
17
17
  rules: {
18
- 'jest/no-standalone-expect': ['error', {
19
- additionalTestBlockFunctions: ['test.jestPlaywrightDebug', 'it.jestPlaywrightDebug', 'test.jestPlaywrightSkip', 'it.jestPlaywrightSkip', 'test.jestPlaywrightConfig', 'it.jestPlaywrightConfig']
20
- }],
21
18
  'playwright/expect-expect': 'error',
22
19
  'playwright/missing-playwright-await': 'error',
23
20
  'playwright/max-nested-describe': ['warn', {
@@ -39,6 +36,7 @@ function playwright() {
39
36
  'playwright/no-useless-await': 'error',
40
37
  'playwright/no-unsafe-references': 'warn',
41
38
  'playwright/no-useless-not': 'warn',
39
+ 'playwright/no-unused-locators': 'warn',
42
40
  'playwright/no-wait-for-navigation': 'warn',
43
41
  'playwright/no-wait-for-selector': 'warn',
44
42
  'playwright/no-wait-for-timeout': 'warn',
@@ -5,9 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
 
7
7
  var _eslintPluginPromise = _interopRequireDefault(require("eslint-plugin-promise"));
8
+ var _conditions = require("../utils/conditions.js");
8
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
10
  /** @return { import('eslint').Linter.Config } */
10
- function promise() {
11
+ function promise(options = {}) {
11
12
  return {
12
13
  plugins: {
13
14
  promise: _eslintPluginPromise.default
@@ -26,8 +27,10 @@ function promise() {
26
27
  'promise/param-names': 'warn',
27
28
  'promise/prefer-await-to-callbacks': 'off',
28
29
  'promise/prefer-await-to-then': 'off',
30
+ 'promise/prefer-catch': (0, _conditions.strict)(options, 'warn'),
29
31
  'promise/valid-params': 'warn',
30
- 'promise/no-multiple-resolved': 'warn'
32
+ 'promise/no-multiple-resolved': 'warn',
33
+ 'promise/spec-only': 'warn'
31
34
  }
32
35
  };
33
36
  }
@@ -54,6 +54,7 @@ function react(options = {}) {
54
54
  '@eslint-react/dom/no-script-url': 'warn',
55
55
  '@eslint-react/dom/no-unsafe-iframe-sandbox': 'warn',
56
56
  '@eslint-react/dom/no-unsafe-target-blank': 'warn',
57
+ '@eslint-react/jsx-dollar': 'warn',
57
58
  '@eslint-react/jsx-key-before-spread': 'error',
58
59
  '@eslint-react/jsx-no-undef': 'off',
59
60
  '@eslint-react/jsx-no-iife': 'warn',
@@ -13,31 +13,25 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
13
13
  * @param { import('../index.js').Options } options
14
14
  * @return { import('eslint').Linter.Config }
15
15
  */
16
+
16
17
  function tests(options = {}) {
17
18
  return {
19
+ files: [..._globs.globs.test, ..._globs.globs.e2e],
18
20
  plugins: {
19
21
  vitest: _eslintPlugin.default
20
22
  },
21
- files: [..._globs.globs.test, ..._globs.globs.e2e],
22
23
  languageOptions: {
23
24
  globals: {
24
- ..._globals.default['shared-node-browser'],
25
- ..._globals.default.jest
25
+ ..._globals.default['shared-node-browser']
26
26
  }
27
27
  },
28
28
  rules: {
29
- 'vitest/padding-around-after-all-blocks': 'warn',
30
- 'vitest/padding-around-after-each-blocks': 'warn',
31
- 'vitest/padding-around-before-all-blocks': 'warn',
32
- 'vitest/padding-around-before-each-blocks': 'warn',
33
- 'vitest/padding-around-describe-blocks': 'warn',
34
- 'vitest/padding-around-expect-groups': 'warn',
35
- 'vitest/padding-around-test-blocks': 'warn',
36
29
  'max-lines-per-function': 'off',
37
30
  'no-sparse-arrays': 'off',
38
31
  'no-empty-function': 'off',
32
+ 'vitest/padding-around-all': 'warn',
39
33
  ...(0, _conditions.predicate)(options.react, {
40
- 'react/jsx-no-constructed-context-values': 'off'
34
+ '@eslint-react/no-unstable-context-value': 'off'
41
35
  }),
42
36
  ...(0, _conditions.predicate)(options.typescript, {
43
37
  '@typescript-eslint/method-signature-style': 'off',
@@ -95,11 +95,13 @@ function vitest() {
95
95
  'vitest/require-local-test-context-for-concurrent-snapshots': 'warn',
96
96
  'vitest/require-mock-type-parameters': 'off',
97
97
  'vitest/require-to-throw-message': 'warn',
98
- 'vitest/require-top-level-describe': 'warn',
98
+ 'vitest/require-top-level-describe': 'off',
99
99
  'vitest/valid-describe-callback': 'warn',
100
100
  'vitest/valid-expect': 'warn',
101
101
  'vitest/valid-expect-in-promise': 'warn',
102
- 'vitest/valid-title': 'warn',
102
+ 'vitest/valid-title': ['warn', {
103
+ allowArguments: true
104
+ }],
103
105
  'vitest/warn-todo': 'warn'
104
106
  }
105
107
  };
@@ -29,7 +29,7 @@ const globs = exports.globs = {
29
29
  html: '**/*.html',
30
30
  astro: '**/*.astro',
31
31
  graphql: '**/*.{gql,graphql}',
32
- storybook: ['**/*.stories.{js,jsx,ts,tsx}'],
32
+ storybook: ['**/*.stories.{js,mjs,cjs,jsx,ts,tsx}'],
33
33
  test: [`**/__tests__/*.${srcExt}`, `**/*.spec.${srcExt}`, `**/*.test.${srcExt}`],
34
34
  e2e: [`**/e2e/*.${srcExt}`]
35
35
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "13.9.0",
3
+ "version": "13.10.0",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
@@ -35,11 +35,11 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@eslint-react/eslint-plugin": "2.2.3",
39
- "@eslint/compat": "1.4.0",
40
- "@next/eslint-plugin-next": "16.0.0",
38
+ "@eslint-react/eslint-plugin": "2.3.1",
39
+ "@eslint/compat": "1.4.1",
40
+ "@next/eslint-plugin-next": "16.0.1",
41
41
  "@stylistic/eslint-plugin": "5.5.0",
42
- "@vitest/eslint-plugin": "1.3.24",
42
+ "@vitest/eslint-plugin": "1.4.1",
43
43
  "deepmerge": "4.3.1",
44
44
  "eslint-plugin-better-tailwindcss": "3.7.10",
45
45
  "eslint-plugin-cypress": "5.2.0",
@@ -48,31 +48,32 @@
48
48
  "eslint-plugin-jsx-a11y": "6.10.2",
49
49
  "eslint-plugin-n": "17.23.1",
50
50
  "eslint-plugin-perfectionist": "4.15.1",
51
- "eslint-plugin-playwright": "2.2.2",
51
+ "eslint-plugin-playwright": "2.3.0",
52
52
  "eslint-plugin-prettier": "5.5.4",
53
53
  "eslint-plugin-promise": "7.2.1",
54
54
  "eslint-plugin-react-hooks": "7.0.1",
55
55
  "eslint-plugin-regexp": "2.10.0",
56
- "eslint-plugin-storybook": "0.12.0",
57
- "globals": "16.4.0",
56
+ "eslint-plugin-storybook": "10.0.6",
57
+ "globals": "16.5.0",
58
58
  "local-pkg": "1.1.2",
59
- "typescript-eslint": "8.46.2"
59
+ "typescript-eslint": "8.46.3"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@eslint/eslintrc": "3.3.1",
63
- "@eslint/js": "9.38.0",
64
- "@semantic-release/github": "12.0.0",
63
+ "@eslint/js": "9.39.1",
64
+ "@semantic-release/github": "12.0.1",
65
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.2",
69
- "eslint": "9.38.0",
68
+ "cspell": "9.3.0",
69
+ "eslint": "9.39.1",
70
70
  "husky": "9.1.7",
71
71
  "jest": "30.2.0",
72
72
  "lint-staged": "16.2.6",
73
73
  "pinst": "3.0.0",
74
74
  "prettier": "3.6.2",
75
- "semantic-release": "25.0.1",
75
+ "semantic-release": "25.0.2",
76
+ "storybook": "10.0.6",
76
77
  "typescript": "5.9.3",
77
78
  "unbuild": "3.6.1"
78
79
  },
package/src/index.d.ts CHANGED
@@ -93,7 +93,7 @@ export interface Options extends Linter.Config {
93
93
  * Controls [TypeScript plugin](https://www.npmjs.com/package/typescript-eslint).
94
94
  * @default true - If you have `typescript` in your dependencies.
95
95
  */
96
- typescript?: { projectService?: boolean | ProjectService; tsconfigRootDir?: string; cacheLifetime?: number };
96
+ typescript?: boolean | { projectService?: boolean | ProjectService; tsconfigRootDir?: string; cacheLifetime?: number };
97
97
  /**
98
98
  * Disables expensive rules.
99
99
  * @default false
@@ -111,7 +111,7 @@ export interface Options extends Linter.Config {
111
111
  gitignore?: string | false;
112
112
  /**
113
113
  * Controls regex plugin.
114
- * @default true
114
+ * @default { allowedCharacterRanges: ['all'] }
115
115
  */
116
116
  regex?: boolean | { allowedCharacterRanges: string[] };
117
117
  }
@@ -1,4 +1,5 @@
1
1
  import plugin from 'eslint-plugin-jest';
2
+ import globals from 'globals';
2
3
 
3
4
  import { globs } from '../utils/globs.mjs';
4
5
 
@@ -9,6 +10,11 @@ function jest() {
9
10
  return {
10
11
  files: globs.test,
11
12
  plugins: { jest: plugin },
13
+ languageOptions: {
14
+ globals: {
15
+ ...globals.jest,
16
+ },
17
+ },
12
18
  rules: {
13
19
  'jest/consistent-test-it': 'off',
14
20
  'jest/expect-expect': 'off',
@@ -8,19 +8,6 @@ function playwright() {
8
8
  plugins: { playwright: plugin },
9
9
  files: globs.e2e,
10
10
  rules: {
11
- 'jest/no-standalone-expect': [
12
- 'error',
13
- {
14
- additionalTestBlockFunctions: [
15
- 'test.jestPlaywrightDebug',
16
- 'it.jestPlaywrightDebug',
17
- 'test.jestPlaywrightSkip',
18
- 'it.jestPlaywrightSkip',
19
- 'test.jestPlaywrightConfig',
20
- 'it.jestPlaywrightConfig',
21
- ],
22
- },
23
- ],
24
11
  'playwright/expect-expect': 'error',
25
12
  'playwright/missing-playwright-await': 'error',
26
13
  'playwright/max-nested-describe': ['warn', { max: 5 }],
@@ -40,6 +27,7 @@ function playwright() {
40
27
  'playwright/no-useless-await': 'error',
41
28
  'playwright/no-unsafe-references': 'warn',
42
29
  'playwright/no-useless-not': 'warn',
30
+ 'playwright/no-unused-locators': 'warn',
43
31
  'playwright/no-wait-for-navigation': 'warn',
44
32
  'playwright/no-wait-for-selector': 'warn',
45
33
  'playwright/no-wait-for-timeout': 'warn',
@@ -1,7 +1,9 @@
1
1
  import plugin from 'eslint-plugin-promise';
2
2
 
3
+ import { strict } from '../utils/conditions.mjs';
4
+
3
5
  /** @return { import('eslint').Linter.Config } */
4
- function promise() {
6
+ function promise(options = {}) {
5
7
  return {
6
8
  plugins: { promise: plugin },
7
9
  rules: {
@@ -18,8 +20,10 @@ function promise() {
18
20
  'promise/param-names': 'warn',
19
21
  'promise/prefer-await-to-callbacks': 'off',
20
22
  'promise/prefer-await-to-then': 'off',
23
+ 'promise/prefer-catch': strict(options, 'warn'),
21
24
  'promise/valid-params': 'warn',
22
25
  'promise/no-multiple-resolved': 'warn',
26
+ 'promise/spec-only': 'warn',
23
27
  },
24
28
  };
25
29
  }
@@ -49,6 +49,7 @@ function react(options = {}) {
49
49
  '@eslint-react/dom/no-unsafe-iframe-sandbox': 'warn',
50
50
  '@eslint-react/dom/no-unsafe-target-blank': 'warn',
51
51
 
52
+ '@eslint-react/jsx-dollar': 'warn',
52
53
  '@eslint-react/jsx-key-before-spread': 'error',
53
54
  '@eslint-react/jsx-no-undef': 'off',
54
55
  '@eslint-react/jsx-no-iife': 'warn',
@@ -8,28 +8,23 @@ import { globs } from '../utils/globs.mjs';
8
8
  * @param { import('..').Options } options
9
9
  * @return { import('eslint').Linter.Config }
10
10
  */
11
+
11
12
  function tests(options = {}) {
12
13
  return {
13
- plugins: { vitest: plugin },
14
14
  files: [...globs.test, ...globs.e2e],
15
+ plugins: { vitest: plugin },
15
16
  languageOptions: {
16
- globals: { ...globals['shared-node-browser'], ...globals.jest },
17
+ globals: { ...globals['shared-node-browser'] },
17
18
  },
18
19
  rules: {
19
- 'vitest/padding-around-after-all-blocks': 'warn',
20
- 'vitest/padding-around-after-each-blocks': 'warn',
21
- 'vitest/padding-around-before-all-blocks': 'warn',
22
- 'vitest/padding-around-before-each-blocks': 'warn',
23
- 'vitest/padding-around-describe-blocks': 'warn',
24
- 'vitest/padding-around-expect-groups': 'warn',
25
- 'vitest/padding-around-test-blocks': 'warn',
26
-
27
20
  'max-lines-per-function': 'off',
28
21
  'no-sparse-arrays': 'off',
29
22
  'no-empty-function': 'off',
30
23
 
24
+ 'vitest/padding-around-all': 'warn',
25
+
31
26
  ...predicate(options.react, {
32
- 'react/jsx-no-constructed-context-values': 'off',
27
+ '@eslint-react/no-unstable-context-value': 'off',
33
28
  }),
34
29
 
35
30
  ...predicate(options.typescript, {
@@ -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
+
61
62
  'vitest/prefer-called-once': 'warn',
62
63
  'vitest/prefer-called-times': 'off',
63
64
  'vitest/prefer-called-with': 'warn',
@@ -88,11 +89,11 @@ function vitest() {
88
89
  'vitest/require-local-test-context-for-concurrent-snapshots': 'warn',
89
90
  'vitest/require-mock-type-parameters': 'off',
90
91
  'vitest/require-to-throw-message': 'warn',
91
- 'vitest/require-top-level-describe': 'warn',
92
+ 'vitest/require-top-level-describe': 'off',
92
93
  'vitest/valid-describe-callback': 'warn',
93
94
  'vitest/valid-expect': 'warn',
94
95
  'vitest/valid-expect-in-promise': 'warn',
95
- 'vitest/valid-title': 'warn',
96
+ 'vitest/valid-title': ['warn', { allowArguments: true }],
96
97
  'vitest/warn-todo': 'warn',
97
98
  },
98
99
  };
@@ -28,7 +28,7 @@ export const globs = {
28
28
  astro: '**/*.astro',
29
29
  graphql: '**/*.{gql,graphql}',
30
30
 
31
- storybook: ['**/*.stories.{js,jsx,ts,tsx}'],
31
+ storybook: ['**/*.stories.{js,mjs,cjs,jsx,ts,tsx}'],
32
32
 
33
33
  test: [`**/__tests__/*.${srcExt}`, `**/*.spec.${srcExt}`, `**/*.test.${srcExt}`],
34
34
  e2e: [`**/e2e/*.${srcExt}`],