-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheslint.config.js
More file actions
65 lines (64 loc) · 1.61 KB
/
eslint.config.js
File metadata and controls
65 lines (64 loc) · 1.61 KB
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
const js = require('@eslint/js')
const globals = require('globals')
const stylistic = require('@stylistic/eslint-plugin')
module.exports = [
js.configs.recommended,
{
files: ['lib/**/*.js', 'test/**/*.js', 'examples/**/*.js'],
languageOptions: {
ecmaVersion: 2019,
globals: {
...globals.node,
...globals.es2015,
}
},
plugins: {
'@stylistic': stylistic,
},
rules: {
'no-prototype-builtins': 'off',
'no-setter-return': 'off',
'require-await': 'error',
'no-shadow': 'error',
'no-var': 'error',
'@stylistic/max-len': ['error', 120],
'@stylistic/semi': ['error', 'never'],
'eqeqeq': ['error', 'smart'],
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
'prefer-const': 'error',
'no-throw-literal': 'error',
'no-unused-expressions': ['error', { allowShortCircuit: true }],
'@stylistic/object-curly-spacing': ['error', 'always'],
'no-unused-vars': ['error', { caughtErrors: 'none' }],
'no-useless-assignment': 0,
'preserve-caught-error': 0,
}
},
{
files: ['test/**/*.js'],
languageOptions: {
globals: {
...globals.mocha,
Backendless: true,
expect: true,
}
},
rules: {
'no-throw-literal': 'off',
'no-console': 'off',
}
},
{
files: ['examples/**/*.js'],
languageOptions: {
globals: {
Backendless: true,
}
},
rules: {
'no-console': 'off',
'no-unused-vars': 'off',
}
},
]