-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
136 lines (135 loc) · 3.78 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:you-dont-need-lodash-underscore/compatible',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:react/recommended',
'plugin:react-perf/recommended',
'standard-react',
'plugin:jsx-a11y/recommended',
'plugin:@typescript-eslint/recommended' // Uses the recommended rules from @typescript-eslint/eslint-plugin
// 'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
// 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
// 'prettier/react',
// 'prettier/standard',
// 'prettier/@typescript-eslint'
],
plugins: [
'you-dont-need-lodash-underscore',
'json',
'dependencies',
'babel',
'import',
'filenames',
'jsx-a11y',
'html',
'ascii',
'promise',
'react',
'optimize-regex',
'react-perf',
'standard',
'no-inferred-method-name',
'react-functional-set-state',
'@typescript-eslint'
// 'prettier'
],
env: {
browser: true,
es6: true
},
globals: {
__DEV__: false,
__PROD__: false,
__PLAYER_DEBUG__: false,
__BASENAME__: false,
google: true
},
settings: {
ecmascript: 6,
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx']
},
'import/resolver': {
// use <root>/path/to/folder/tsconfig.json
'typescript': {
'directory': './tsconfig.json'
}
},
react: {
version: 'detect'
}
},
rules: {
'ascii/valid-name': 2,
'optimize-regex/optimize-regex': 'warn',
'filenames/no-index': 0,
'filenames/match-regex': [2, '^[a-z0-9-.]+$', true],
'filenames/match-exported': 'off', // [2, ['camel', 'kebab', null]],
'template-curly-spacing': ['error', 'never'],
indent: ['error', 2],
'dependencies/case-sensitive': 1,
'dependencies/no-cycles': 1,
'dependencies/no-unresolved': 0,
'dependencies/require-json-ext': 1,
'react-functional-set-state/no-this-state-props': 2,
'no-void': 2,
'no-restricted-globals': 2,
'no-use-before-define': 2,
'func-names': 1,
'guard-for-in': 2,
'no-restricted-syntax': 2,
'jsx-a11y/label-has-for': 'off',
'no-console': 'off',
// 'react/no-typos': 'off',
'max-len': 'off',
'no-nested-ternary': 'off',
camelcase: [
2,
{
properties: 'never'
}
],
'react-redux/prefer-separate-component-file': 'off',
'react/destructuring-assignment': 'off',
'babel/no-invalid-this': 1,
'babel/semi': 0,
'spaced-comment': 0,
'brace-style': 0,
'no-trailing-spaces': 0,
'import/default': 2,
'import/no-unresolved': [
2,
{
commonjs: true,
amd: true
}
],
'import/named': 'off',
'import/namespace': 2,
'import/export': 2,
'import/no-duplicates': 0,
'import/imports-first': 2,
'semi': ['error', 'never'],
'quote': 'single',
// 'prettier/prettier': ['error', {trailingComma: 'none', semi: false, singleQoute: true, printWidth: 80, tabWidth: 2, parser: 'typescript'}],
// @typescript-eslint rule overrides
"indent": "off",
'@typescript-eslint/indent': ["error", 2],
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-non-null-assertion': 1
},
parserOptions: {
'ecmaVersion': 2018,
'sourceType': 'module',
'ecmaFeatures': {
jsx: true
},
'useJSXTextNode': true,
'project': './tsconfig.json',
'tsconfigRootDir': './'
}
}