-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.cjs
67 lines (65 loc) · 2.43 KB
/
eslint.config.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const { FlatCompat } = require('@eslint/eslintrc');
const js = require('@eslint/js');
const eslintPluginSonarjs = require('eslint-plugin-sonarjs');
const typescriptEslintParser = require('@typescript-eslint/parser');
const globals = require('globals');
const compat = new FlatCompat({
recommendedConfig: js.configs.recommended,
baseDirectory: __dirname,
});
module.exports = [
js.configs.recommended,
...compat.extends('plugin:@typescript-eslint/recommended', 'plugin:sonarjs/recommended-legacy'),
{ plugins: { sonarjs: eslintPluginSonarjs } },
{
languageOptions: {
parser: typescriptEslintParser,
parserOptions: { project: ['tsconfig.json'] },
globals: {
...globals.node,
...globals.browser,
...globals.es6,
...globals.jest,
},
},
},
{
rules: {
'no-unused-expressions': 'off',
'sonarjs/cognitive-complexity': 'off',
'sonarjs/no-all-duplicated-branches': 'warn',
'sonarjs/no-collapsible-if': 'warn',
'sonarjs/no-collection-size-mischeck': 'warn',
'sonarjs/no-duplicate-string': 'warn',
'sonarjs/no-duplicated-branches': 'warn',
'sonarjs/no-empty-collection': 'warn',
'sonarjs/no-extra-arguments': 'warn',
'sonarjs/no-gratuitous-expressions': 'warn',
'sonarjs/no-identical-expressions': 'warn',
'sonarjs/no-identical-functions': 'warn',
'sonarjs/no-ignored-return': 'off',
'sonarjs/no-nested-template-literals': 'warn',
'sonarjs/no-redundant-boolean': 'warn',
'sonarjs/no-redundant-jump': 'warn',
'sonarjs/no-small-switch': 'warn',
'sonarjs/no-unused-collection': 'warn',
'sonarjs/prefer-object-literal': 'warn',
'sonarjs/prefer-single-boolean-return': 'warn',
'@typescript-eslint/no-useless-escape': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'import/no-unresolved': 'off',
'no-prototype-builtins': 'off',
},
},
{
ignores: ['**/*.mjs', 'vite.config.ts', '**/*.cy.ts', 'cypress', 'cypress.config.ts'],
},
];