-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.js
95 lines (95 loc) · 3.25 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
module.exports = {
parser: '@typescript-eslint/parser',
ignorePatterns: ['node_modules', 'dist', '*.d.ts', 'coverage', 'jest.config.js'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:github/recommended',
'plugin:jsx-a11y/recommended',
'plugin:sonarjs/recommended',
'plugin:unicorn/recommended',
'prettier',
'react-app'
],
plugins: ['@typescript-eslint', 'github', 'jsx-a11y', 'prettier', 'sonarjs'],
overrides: [
{
files: ['*.test.ts'],
plugins: ['jest'],
extends: ['plugin:jest/recommended'],
globals: {
__dirname: true
},
rules: {
'unicorn/prefer-module': 'off' // To be able to use __dirname
}
}
],
rules: {
// OFF
'i18n-text/no-en': 'off',
'eslint-comments/no-unused-disable': 'off',
'filenames/match-regex': 'off',
'import/named': 'off', // doesn't work well
'import/namespace': 'off', // takes too long
'import/no-deprecated': 'off', // takes too long
'import/default': 'off', // takes too long
'import/no-named-as-default': 'off', // doesn't work well
'import/no-named-as-default-member': 'off', // takes too long
'import/no-unresolved': 'off',
'unicorn/no-null': 'off',
// ERRORS
'@typescript-eslint/no-unused-vars': 'error',
'import/extensions': [
'error',
'never',
{
json: 'always'
}
],
'import/order': [
'error',
{
groups: [
'builtin', // Node "builtin" modules, eg: import path from "path";
'external', // External modules, eg: import moment from "moment";
'internal', // Internal modules (absolute imports), eg: import {apiService} from "app/services/core";
['sibling', 'parent', 'index'], // Relative imports, eg: import foo from "../foo"; / import bar from "./bar"; / import main from "./";
'object', // "object"-imports (TypeScript only), eg: import log = console.log;
'type' // "type" imports (TypeScript only), eg: import type { Foo } from "foo";
],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true
}
}
],
'no-console': 'error',
'prettier/prettier': 'error',
'unicorn/filename-case': [
'error',
{
cases: {
camelCase: true,
pascalCase: true
}
}
],
'unicorn/prevent-abbreviations': [
'error',
{
replacements: {
prop: false,
props: false,
i: false,
str: false,
args: false,
doc: false,
docs: false
}
}
]
}
};