-
Notifications
You must be signed in to change notification settings - Fork 7
/
eslint.config.js
60 lines (55 loc) · 1.41 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
import hypothesisBase from 'eslint-config-hypothesis/base';
import hypothesisJSX from 'eslint-config-hypothesis/jsx';
import hypothesisTS from 'eslint-config-hypothesis/ts';
import globals from 'globals';
export default [
{
ignores: [
'.tox/**/*',
'.yalc/**/*',
'.yarn/**/*',
'build/**/*',
'**/vendor/**/*.js',
'**/coverage/**/*',
'docs/_build/*',
'via/static/js/**',
],
},
...hypothesisBase,
...hypothesisJSX,
...hypothesisTS,
// Icons
{
files: ['via/static/scripts/**/components/icons/*.tsx'],
rules: {
// preact uses kebab-cased SVG element attributes, which look like
// unknown properties to `eslint-plugin-react` (React uses camelCase
// for these properties)
'react/no-unknown-property': 'off',
},
},
// Additional rules that require type information. These can only be run
// on files included in the TS project by tsconfig.json.
{
files: ['via/static/scripts/*.{js,ts,tsx}'],
ignores: ['via/static/scripts/setup-tests.js', '**/test/*.js'],
rules: {
'@typescript-eslint/no-unnecessary-condition': 'error',
},
languageOptions: {
parserOptions: {
project: 'via/static/scripts/tsconfig.json',
},
},
},
// Code that runs in Node
{
files: ['*.js'],
ignores: ['via/**'],
languageOptions: {
globals: {
...globals.node,
},
},
},
];