@enormora/eslint-config-typescript 0.0.4 → 0.0.6

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
@@ -5,7 +5,7 @@
5
5
  "url": "git://github.com/enormora/eslint-config.git"
6
6
  },
7
7
  "name": "@enormora/eslint-config-typescript",
8
- "version": "0.0.4",
8
+ "version": "0.0.6",
9
9
  "dependencies": {
10
10
  "@typescript-eslint/eslint-plugin": "6.7.2",
11
11
  "@typescript-eslint/parser": "6.7.2",
@@ -14,6 +14,6 @@
14
14
  "main": "typescript.js",
15
15
  "type": "module",
16
16
  "peerDependencies": {
17
- "@enormora/eslint-config-base": "0.0.4"
17
+ "@enormora/eslint-config-base": "0.0.6"
18
18
  }
19
19
  }
package/typescript.js CHANGED
@@ -331,10 +331,7 @@ export const typescriptConfig = {
331
331
  '@typescript-eslint/class-methods-use-this': 'error',
332
332
 
333
333
  'functional/functional-parameters': 'off',
334
- 'functional/immutable-data': [
335
- 'error',
336
- { ignoreClasses: false, ignoreImmediateMutation: true, ignoreNonConstDeclarations: false }
337
- ],
334
+ 'functional/immutable-data': 'off',
338
335
  'functional/no-classes': 'off',
339
336
  'functional/no-conditional-statements': 'off',
340
337
  'functional/no-expression-statements': 'off',
@@ -369,13 +366,42 @@ export const typescriptConfig = {
369
366
  }
370
367
  ]
371
368
  },
369
+ parameters: {
370
+ enforcement: 'ReadonlyShallow'
371
+ },
372
+ returnTypes: {
373
+ enforcement: 'ReadonlyShallow'
374
+ },
372
375
  variables: {
376
+ enforcement: 'ReadonlyShallow',
373
377
  ignoreInFunctions: true
374
378
  }
375
379
  }
376
380
  ],
377
381
  'functional/prefer-tacit': 'error',
378
382
  'functional/readonly-type': ['error', 'keyword'],
379
- 'functional/type-declaration-immutability': 'off'
383
+ 'functional/type-declaration-immutability': [
384
+ 'error',
385
+ {
386
+ rules: [
387
+ {
388
+ identifiers: '^.*',
389
+ immutability: 'ReadonlyShallow',
390
+ comparator: 'AtLeast',
391
+ fixer: [
392
+ {
393
+ pattern: '^(Array|Map|Set)<(.+)>$',
394
+ replace: 'Readonly$1<$2>'
395
+ },
396
+ {
397
+ pattern: '^(.+)$',
398
+ replace: 'Readonly<$1>'
399
+ }
400
+ ]
401
+ }
402
+ ],
403
+ ignoreInterfaces: false
404
+ }
405
+ ]
380
406
  }
381
407
  };