-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
90 lines (89 loc) · 2.2 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
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path')
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: [
'@typescript-eslint',
'simple-import-sort',
'sort-keys-custom-order-fix',
'unused-imports',
'typescript-sort-keys',
],
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/naming-convention': [
'error',
{
format: ['PascalCase'],
prefix: ['I'],
selector: 'interface',
},
{
format: ['PascalCase'],
prefix: ['T'],
selector: 'typeAlias',
},
{
format: ['camelCase'],
selector: ['variable'],
},
{
format: ['camelCase'],
selector: ['variable'],
},
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'no-restricted-imports': [
'error',
{
paths: [
{
message:
"To reduce bundle size, import only the required lodash function. Example: import get from 'lodash/get'",
name: 'lodash',
},
],
},
],
'object-shorthand': ['error', 'always'],
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
'sort-keys-custom-order-fix/sort-keys-custom-order-fix': [
'error',
'custom',
{
caseSensitive: true,
natural: true,
orderBy: 'asc',
},
],
'typescript-sort-keys/interface': ['error', 'asc', { caseSensitive: true, natural: false, requiredFirst: false }],
'unused-imports/no-unused-imports-ts': 'error',
},
settings: {
react: {
version: 'detect',
},
},
}