Skip to content

Commit

Permalink
fix: improve vitest rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ASafaeirad committed Jun 8, 2024
1 parent 4c52925 commit a8127d4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/modules/fp.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ function fp() {
'functional/functional-parameters': 'off',
'functional/no-let': ['error', { allowInForLoopInit: true }],
'functional/no-loop-statements': 'error',
'functional/immutable-data': ['error', { ignoreClasses: true, ignoreImmediateMutation: true, ignoreNonConstDeclarations: true }],
},
};
}
Expand Down
6 changes: 5 additions & 1 deletion src/modules/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function typescript(options = {}) {
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unsafe-unary-minus': 'error',
'@typescript-eslint/no-useless-template-literals': 'warn',
'no-unnecessary-template-expression': 'warn',
'@typescript-eslint/non-nullable-type-assertion-style': 'warn',
'@typescript-eslint/prefer-includes': 'warn',
'@typescript-eslint/prefer-optional-chain': 'warn',
Expand Down Expand Up @@ -227,6 +227,10 @@ function typescript(options = {}) {
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }],

...predicate(options.fp, {
'functional/immutable-data': ['error', { ignoreClasses: true, ignoreImmediateMutation: true, ignoreNonConstDeclarations: true }],
}),

// collisions
'prefer-promise-reject-errors': 'off',
'consistent-return': 'off',
Expand Down
8 changes: 4 additions & 4 deletions src/modules/vitest.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ function vitest() {
'vitest/prefer-expect-resolves': 'warn',
'vitest/prefer-hooks-in-order': 'warn',
'vitest/prefer-hooks-on-top': 'warn',
'vitest/prefer-lowercase-title': 'warn',
'vitest/prefer-lowercase-title': 'off',
'vitest/prefer-mock-promise-shorthand': 'warn',
'vitest/prefer-snapshot-hint': 'warn',
'vitest/prefer-spy-on': 'warn',
'vitest/prefer-strict-equal': 'warn',
'vitest/prefer-strict-equal': 'off',
'vitest/prefer-to-be': 'warn',
'vitest/prefer-to-be-falsy': 'warn',
'vitest/prefer-to-be-falsy': 'off',
'vitest/prefer-to-be-object': 'warn',
'vitest/prefer-to-be-truthy': 'warn',
'vitest/prefer-to-be-truthy': 'off',
'vitest/prefer-to-contain': 'warn',
'vitest/prefer-to-have-length': 'warn',
'vitest/prefer-todo': 'warn',
Expand Down

0 comments on commit a8127d4

Please sign in to comment.