-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy patheslint.config.js
More file actions
60 lines (59 loc) · 1.75 KB
/
Copy patheslint.config.js
File metadata and controls
60 lines (59 loc) · 1.75 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
const js = require('@eslint/js');
const globals = require('globals');
const react = require('eslint-plugin-react');
const promise = require('eslint-plugin-promise');
// Held at ESLint 9: eslint-plugin-react still peers on ^9.7, so ESLint 10 fails
// to install without legacy-peer-deps.
module.exports = [
{ ignores: ['dist/**', 'data/**', 'lib/moment.js'] },
js.configs.recommended,
react.configs.flat.recommended,
{
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.webextensions
}
},
plugins: { promise },
settings: { react: { version: '15.4' } },
rules: {
'constructor-super': 'warn',
'eqeqeq': 'error',
'no-const-assign': 'warn',
'no-this-before-super': 'warn',
'no-undef': 'warn',
'no-unreachable': 'warn',
'no-unused-vars': 'warn',
'no-var': 'error',
'prefer-const': 'error',
'quotes': ['error', 'single', { avoidEscape: true }],
'semi': ['error', 'always'],
'valid-typeof': 'warn',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'promise/avoid-new': 'warn',
'promise/catch-or-return': 'error',
'promise/no-callback-in-promise': 'warn',
'promise/no-promise-in-callback': 'warn',
'promise/no-return-wrap': 'error',
'promise/param-names': 'error'
}
},
{
// src/ ships to users; the one deliberate logger opts out in place.
files: ['src/**/*.js'],
rules: { 'no-console': 'error' }
},
{
files: ['test/**/*.js'],
languageOptions: { globals: { ...globals.mocha } },
rules: {
'promise/avoid-new': 'off',
'promise/no-callback-in-promise': 'off'
}
}
];