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
|
const overrides = {
eqeqeq: ['error', 'always', { null: 'ignore' }], // noisy
'id-length': 'off', // noisy
'no-console': 'off', // noisy
'no-eq-null': 'off', // noisy
'no-negated-condition': 'off', // noisy
'react/forbid-component-props': 'off', // noisy
'react/prop-types': 'off', // noisy
'canonical/sort-keys': 'off', // noisy
'unicorn/no-array-reduce': 'off', // noisy
'unicorn/prevent-abbreviations': 'off',
};
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: ['canonical/auto', 'canonical/browser', 'canonical/node'],
ignorePatterns: ['build', 'node_modules', 'package-lock.json'],
overrides: [
{
extends: [
'canonical',
'canonical/regexp',
'canonical/jsdoc',
'canonical/jsx-a11y',
'canonical/react',
'canonical/prettier',
],
files: ['*.jsx'],
parserOptions: {
babelOptions: {
parserOpts: {
plugins: ['jsx'],
},
},
},
rules: {
...overrides,
'react/no-set-state': 'off', // only useful when using state libs
},
},
{
extends: ['canonical/jest'],
files: '*.test.{js,jsx}',
},
],
root: true,
rules: {
...overrides,
'import/no-unassigned-import': [
'error',
{
allow: ['semantic-ui-less/semantic.less', '**/*.css'],
},
],
},
};
|