forked from grafana/pyroscope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
72 lines (72 loc) · 1.82 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
module.exports = {
plugins: ['@typescript-eslint', 'css-modules'],
extends: [
'@grafana/eslint-config',
'plugin:import/recommended',
'plugin:import/typescript',
],
plugins: ['unused-imports'],
rules: {
'react/react-in-jsx-scope': 'error',
'react-hooks/exhaustive-deps': 'error',
'no-duplicate-imports': 'off',
'@typescript-eslint/naming-convention': [
'warn',
{ selector: 'function', format: ['PascalCase', 'camelCase'] },
],
'@typescript-eslint/no-duplicate-imports': 'error',
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'error',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
'import/no-relative-packages': 'error',
'no-restricted-imports': [
'error',
{
patterns: [
// Dialing back this restriction for now
// {
// group: ['../*', './*'],
// message:
// 'Usage of relative parent imports is not allowed. Please use absolute(use alias) imports instead.',
// },
],
},
],
'react/prop-types': ['off'],
},
env: {
browser: true,
jquery: true,
},
settings: {
'import/internal-regex': '^@webapp',
'import/resolver': {
node: {
extensions: ['.ts', '.tsx', '.es6', '.js', '.json', '.svg'],
},
typescript: {
project: 'tsconfig.json',
},
},
},
parserOptions: {
project: ['tsconfig.json'],
},
overrides: [
{
// For tests it's fine to import with ./myfile, since tests won't be overriden downstream
files: ['*.spec.tsx', '*.spec.ts'],
rules: {
'no-restricted-imports': 'off',
},
},
],
};