-
Notifications
You must be signed in to change notification settings - Fork 7
/
eslint.config.cjs
101 lines (100 loc) · 2.63 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
const standard = require('eslint-config-standard');
const jsdoc = require('eslint-plugin-jsdoc');
const preferArrow = require('eslint-plugin-prefer-arrow');
const importPlugin = require('eslint-plugin-import');
const typescriptEslint = require('@typescript-eslint/eslint-plugin');
const n = require('eslint-plugin-n');
const promise = require('eslint-plugin-promise');
module.exports = [
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
browser: true,
es6: true,
node: true,
__: true,
$: true,
frappe: true,
cur_frm: true,
cur_dialog: true,
moment: true,
in_list: true,
open_url_post: true,
refresh_field: true,
locals: true,
location: true,
},
},
plugins: {
jsdoc,
preferArrow,
import: importPlugin,
n,
promise,
'@typescript-eslint': typescriptEslint,
},
rules: {
...standard.rules,
'arrow-parens': ['off', 'as-needed'],
'comma-dangle': 'off',
complexity: 'off',
'constructor-super': 'error',
curly: 'off',
'dot-notation': 'error',
'eol-last': 'off',
eqeqeq: ['error', 'smart'],
'guard-for-in': 'error',
'id-blacklist': 'off',
'id-match': 'off',
'import/order': 'off',
'max-classes-per-file': 'off',
'max-len': [
'error',
{
code: 150,
},
],
'new-parens': 'error',
'no-bitwise': 'error',
'no-caller': 'error',
'no-cond-assign': 'error',
'no-console': 'error',
'no-debugger': 'error',
'no-empty': 'off',
'no-eval': 'error',
'no-fallthrough': 'off',
'no-invalid-this': 'off',
'no-new-wrappers': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-undef-init': 'error',
'no-underscore-dangle': 'off',
'no-unsafe-finally': 'error',
'no-unused-expressions': 'off',
'no-unused-labels': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'one-var': ['off', 'never'],
'prefer-arrow/prefer-arrow-functions': [
'off',
{
disallowPrototype: true,
singleReturnOnly: false,
classPropertiesAllowed: false,
},
],
'prefer-const': 'error',
'require-await': 'off',
radix: 'error',
semi: 'off',
'space-before-function-paren': 'off',
'spaced-comment': 'error',
'use-isnan': 'error',
'valid-typeof': 'off',
},
},
];