@fullstacksjs/eslint-config 11.1.0 → 11.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstacksjs/eslint-config",
3
- "version": "11.1.0",
3
+ "version": "11.1.2",
4
4
  "license": "MIT",
5
5
  "author": "fullstacks <fullstacksjs@gmail.com>",
6
6
  "description": "fullstacks eslint config",
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "peerDependencies": {
70
70
  "cypress": ">=8",
71
- "eslint": ">=9",
71
+ "eslint": "9",
72
72
  "graphql": ">=15",
73
73
  "prettier": "3",
74
74
  "react": ">=16",
package/src/init.d.ts CHANGED
@@ -15,7 +15,7 @@ export interface Options {
15
15
  storybook?: boolean;
16
16
  prettier?: boolean;
17
17
  playwright?: boolean;
18
- typescript?: { projects: string[] | string };
18
+ typescript?: { projects: string[] | string | boolean; tsconfigRootDir?: string };
19
19
  disableExpensiveRules?: boolean;
20
20
  }
21
21
 
package/src/modules/fp.js CHANGED
@@ -8,7 +8,6 @@ function fp() {
8
8
  'functional/functional-parameters': 'off',
9
9
  'functional/no-let': ['error', { allowInForLoopInit: true }],
10
10
  'functional/no-loop-statements': 'error',
11
- 'functional/immutable-data': ['error', { ignoreClasses: true, ignoreImmediateMutation: true, ignoreNonConstDeclarations: true }],
12
11
  },
13
12
  };
14
13
  }
@@ -11,7 +11,17 @@ function typescript(options = {}) {
11
11
  return {
12
12
  files: [globs.ts, globs.tsx],
13
13
  plugins: { '@typescript-eslint': plugin },
14
- languageOptions: { parser },
14
+ languageOptions: {
15
+ parser,
16
+ parserOptions: {
17
+ ...predicate(options.typescript && options.typescript.projects, {
18
+ project: options.typescript.projects,
19
+ }),
20
+ ...predicate(options.typescript && options.typescript.tsconfigRootDir, {
21
+ tsconfigRootDir: options.typescript.tsconfigRootDir,
22
+ }),
23
+ },
24
+ },
15
25
  rules: {
16
26
  '@typescript-eslint/adjacent-overload-signatures': 'error',
17
27
  '@typescript-eslint/array-type': 'error',
@@ -175,7 +185,7 @@ function typescript(options = {}) {
175
185
  }),
176
186
  '@typescript-eslint/no-mixed-enums': 'error',
177
187
  '@typescript-eslint/no-redundant-type-constituents': 'warn',
178
- '@typescript-eslint/no-throw-literal': ['warn', { allowThrowingUnknown: false }],
188
+ // '@typescript-eslint/no-throw-literal': ['warn', { allowThrowingUnknown: false }],
179
189
  '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
180
190
  '@typescript-eslint/no-unsafe-enum-comparison': 'warn',
181
191
  '@typescript-eslint/no-unnecessary-condition': [
@@ -189,7 +199,7 @@ function typescript(options = {}) {
189
199
  '@typescript-eslint/no-unnecessary-type-arguments': 'error',
190
200
  '@typescript-eslint/no-unnecessary-type-assertion': 'error',
191
201
  '@typescript-eslint/no-unsafe-unary-minus': 'error',
192
- '@typescript-eslint/no-useless-template-literals': 'warn',
202
+ 'no-unnecessary-template-expression': 'warn',
193
203
  '@typescript-eslint/non-nullable-type-assertion-style': 'warn',
194
204
  '@typescript-eslint/prefer-includes': 'warn',
195
205
  '@typescript-eslint/prefer-optional-chain': 'warn',
@@ -217,6 +227,10 @@ function typescript(options = {}) {
217
227
  '@typescript-eslint/switch-exhaustiveness-check': 'error',
218
228
  '@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }],
219
229
 
230
+ ...predicate(options.fp, {
231
+ 'functional/immutable-data': ['error', { ignoreClasses: true, ignoreImmediateMutation: true, ignoreNonConstDeclarations: true }],
232
+ }),
233
+
220
234
  // collisions
221
235
  'prefer-promise-reject-errors': 'off',
222
236
  'consistent-return': 'off',
@@ -58,15 +58,15 @@ function vitest() {
58
58
  'vitest/prefer-expect-resolves': 'warn',
59
59
  'vitest/prefer-hooks-in-order': 'warn',
60
60
  'vitest/prefer-hooks-on-top': 'warn',
61
- 'vitest/prefer-lowercase-title': 'warn',
61
+ 'vitest/prefer-lowercase-title': 'off',
62
62
  'vitest/prefer-mock-promise-shorthand': 'warn',
63
63
  'vitest/prefer-snapshot-hint': 'warn',
64
64
  'vitest/prefer-spy-on': 'warn',
65
- 'vitest/prefer-strict-equal': 'warn',
65
+ 'vitest/prefer-strict-equal': 'off',
66
66
  'vitest/prefer-to-be': 'warn',
67
- 'vitest/prefer-to-be-falsy': 'warn',
67
+ 'vitest/prefer-to-be-falsy': 'off',
68
68
  'vitest/prefer-to-be-object': 'warn',
69
- 'vitest/prefer-to-be-truthy': 'warn',
69
+ 'vitest/prefer-to-be-truthy': 'off',
70
70
  'vitest/prefer-to-contain': 'warn',
71
71
  'vitest/prefer-to-have-length': 'warn',
72
72
  'vitest/prefer-todo': 'warn',