-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
64 lines (64 loc) · 2.6 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
module.exports = {
env: {
es6: true,
browser: true,
node: true,
},
extends: ['airbnb', 'airbnb-typescript'],
plugins: ['babel', 'import', 'jsx-a11y', 'react', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: './tsconfig.json',
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
rules: {
'linebreak-style': 'off', // Неправильно работает в Windows.
'arrow-parens': 'off', // Несовместимо с prettier
'object-curly-newline': 'off', // Несовместимо с prettier
'no-mixed-operators': 'off', // Несовместимо с prettier
'arrow-body-style': 'off', // Это - не наш стиль?
'function-paren-newline': 'off', // Несовместимо с prettier
'no-plusplus': 'off',
'space-before-function-paren': 0, // Несовместимо с prettier
'max-len': ['error', 100, 2, { ignoreUrls: true }], // airbnb позволяет некоторые пограничные случаи
'no-alert': 'error', // airbnb использует предупреждение
'no-param-reassign': 'off', // Это - не наш стиль?
indent: 'off',
'@typescript-eslint/indent': ['error'],
radix: 'off', // parseInt, parseFloat и radix выключены. Мне это не нравится.
'react/require-default-props': 'off', // airbnb использует уведомление об ошибке
'react/forbid-prop-types': 'off', // airbnb использует уведомление об ошибке
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.tsx'] }], // airbnb использует .jsx
'prefer-destructuring': 'off',
'react/no-find-dom-node': 'off', // Я этого не знаю
'react/no-did-mount-set-state': 'off',
'react/no-unused-prop-types': 'off', // Это всё ещё работает нестабильно
'react/jsx-one-expression-per-line': 'off',
'react/react-in-jsx-scope': 'off',
'jsx-a11y/anchor-is-valid': ['error', { components: ['Link'], specialLink: ['to'] }],
'jsx-a11y/label-has-for': [
2,
{
required: {
every: ['id'],
},
},
], // для ошибки вложенных свойств htmlFor элементов label
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
'import/no-named-as-default': 0,
},
};