forked from mozilla/perfcompare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
98 lines (97 loc) · 2.46 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
plugins: ['import', 'react'],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:jest/recommended',
'prettier',
],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
react: {
version: 'detect',
},
},
rules: {
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal'],
pathGroups: [
{
pattern: 'react',
group: 'external',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['react'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
overrides: [
{
// TypeScript linting
files: ['src/**/**/*.{ts,tsx}'],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
plugins: ['@typescript-eslint'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'airbnb-typescript',
'plugin:import/typescript',
],
rules: {
// https://github.com/typescript-eslint/typescript-eslint/issues/1824
'@typescript-eslint/indent': 'off',
},
},
{
// Typescript test files
files: ['src/__tests__/**/*.{ts,tsx}'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: { jsx: true },
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
plugins: ['jest'],
extends: ['plugin:jest/recommended', 'plugin:import/typescript'],
rules: {
// TODO: update tests to not use store directly and remove these overrides
// https://github.com/mozilla/perfcompare/issues/115
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
// test dependencies should only exist in devDependencies
'import/no-extraneous-dependencies': 'off',
},
},
{
// JavaScript linting
files: ['src/**/*.js', 'webpack/**/*.js'],
parser: 'espree',
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
},
},
],
}