-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
69 lines (69 loc) · 2.11 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
// 'project': './tsconfig.json', // Required to have rules that rely on Types.
// 'tsconfigRootDir': './'
sourceType: 'module',
ecmaVersion: 8,
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
},
},
extends: [
'plugin:@typescript-eslint/recommended', // Out of the box Typescript rules
'plugin:jest/recommended',
'standard', // Out of the box StandardJS rules
'standard-react',
'standard-jsx',
'prettier',
],
plugins: [
'@typescript-eslint', // Let's us override rules below.
'prettier',
],
rules: {
'@typescript-eslint/no-use-before-define': 'off', // Allows us to hoist variables and functions which I am a fan of, functions not variables that is.
'@typescript-eslint/no-explicit-any': 'off', // Too strict for my case, sometimes I need an any type
'@typescript-eslint/interface-name-prefix': [
2,
{
prefixWithI: 'always',
},
],
'@typescript-eslint/member-delimiter-style': [
'error',
{
// Prevents us from using any delimiter for interface properties.
multiline: {
delimiter: 'none',
requireLast: false,
},
singleline: {
delimiter: 'comma',
requireLast: false,
},
},
],
'@typescript-eslint/indent': 'off', // This is the job of StandardJS, they are competing rules so we turn off the Typescript one.
// 'no-unused-vars': 'off', // On the fence about using this one, sometimes we import a package that is never used directly.
'node/no-unsupported-features/es-syntax': 'off', // Allows us to use Import and Export keywords.
'prettier/prettier': [
'error',
{
semi: false,
singleQuote: true,
trailingComma: 'es5',
},
],
// 'sort-imports': [
// 'error',
// {
// ignoreCase: false,
// ignoreDeclarationSort: false,
// ignoreMemberSort: false,
// memberSyntaxSortOrder: ['all', 'single', 'multiple', 'none'],
// },
// ],
},
}