-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.js
80 lines (71 loc) · 3 KB
/
eslint.config.js
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
68
69
70
71
72
73
74
75
76
77
78
79
const baseConfig = require('@enonic/eslint-config');
const { plugin: tsPlugin } = require('typescript-eslint');
const globals = require('globals');
module.exports = [
...baseConfig, // This includes the extended configuration from @enonic/eslint-config
{
files: ["**/*.ts", "**/*.tsx"], // Apply rules to TypeScript files
languageOptions: {
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
globals: {
...globals.browser,
...globals.es6,
},
},
plugins: {
'@typescript-eslint': tsPlugin,
},
rules: {
'new-cap': ['warn', {'capIsNewExceptions': ['Q']}],
// TODO: Remove rules, during the refactoring
// === DEFAULT RULES ===
'prefer-const': ['off'],
'no-plusplus': ['off'],
'no-extra-boolean-cast': ['off'],
'no-prototype-builtins': ['off'],
'no-useless-escape': ['off'],
'no-empty-pattern': ['off'],
'@typescript-eslint/no-unsafe-member-access': ['off'],
'@typescript-eslint/no-inferrable-types': ['off'],
'@typescript-eslint/ban-types': ['off'],
'@typescript-eslint/no-unsafe-return': ['off'],
'@typescript-eslint/no-unsafe-argument': ['off'],
'@typescript-eslint/no-unsafe-assignment': ['off'],
'@typescript-eslint/no-unsafe-call': ['off'],
'@typescript-eslint/no-floating-promises': ['off'],
'@typescript-eslint/restrict-plus-operands': ['off'],
'@typescript-eslint/no-implied-eval': ['off'],
'@typescript-eslint/no-empty-function': ['off'],
'@typescript-eslint/no-empty-interface': ['off'],
'@typescript-eslint/restrict-template-expressions': ['off'],
// === CUSTOM RULES ===
// '@typescript-eslint/explicit-function-return-type': ['error', {allowExpressions: true}],
'@typescript-eslint/explicit-function-return-type': ['off'],
// 'comma-dangle': ['error', 'always-multiline'],
'comma-dangle': ['off'],
// '@typescript-eslint/member-ordering': ['error'],
'@typescript-eslint/member-ordering': ['off'],
// 'spaced-comment': ['error', 'always', {'exceptions': ['-', '+']}],
'spaced-comment': ['off'],
// '@typescript-eslint/no-use-before-define': ['error', {'functions': false, 'classes': true}],
'@typescript-eslint/no-use-before-define': ['off'],
// '@typescript-eslint/unbound-method': ['error', {ignoreStatic: true}],
'@typescript-eslint/unbound-method': ['off'],
},
},
{
ignores: [
"**/node_modules/",
"**/build/",
"**/dist/",
"**/testing/",
"**/.xp/",
"**/*.js",
"**/*.d.ts",
"**/spec/**/*",
]
}
];