This repository has been archived by the owner on Dec 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
.eslintrc.js
74 lines (74 loc) · 1.71 KB
/
.eslintrc.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
module.exports = {
root: true,
env: {
jest: true,
browser: true,
node: true,
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
ecmaFeatures: {
modules: true,
},
project: './tsconfig.json',
},
plugins: ['react', 'jsx-a11y'],
extends: [
'@guardian/eslint-config',
'plugin:react/recommended',
'plugin:jsx-a11y/strict',
'plugin:@guardian/source-foundations/recommended',
'plugin:@guardian/source-react-components/recommended',
'plugin:storybook/recommended',
],
rules: {
'jsx-a11y/label-has-for': 'off',
'react/react-in-jsx-scope': 'off',
},
settings: {
'import/resolver': {
typescript: {},
},
react: {
version: 'detect',
},
},
ignorePatterns: ['dist', 'coverage'],
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
extends: ['@guardian/eslint-config-typescript'],
rules: {
'@typescript-eslint/no-unused-vars': 'error',
},
},
{
files: ['**/*.stories.tsx'],
rules: {
// storybook require this
'import/no-default-export': 'off',
},
},
{
// these are only internal files, so we don't need to check them so
// rigorously they often use things like JSON which are `any`s too,
// we can be more lenient
files: ['scripts/**/*', 'lib/**/*'],
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
{
files: ['**/*.test.ts', '**/*.test.tsx'],
rules: {
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
},
},
],
};