This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
/
.eslintrc.js
65 lines (65 loc) · 1.54 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
module.exports = {
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/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: [
{
group: ['../*', './*'],
message:
'Usage of relative parent imports is not allowed. Please use absolute(use alias) imports instead.',
},
],
},
],
},
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',
},
},
],
};