-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
61 lines (60 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
const airbnbStyleRules = require('eslint-config-airbnb-base/rules/style');
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
env: {
browser: true,
es6: true,
},
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
self: 'readonly',
},
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
},
plugins: ['import', 'react', 'unused-imports'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'@typescript-eslint/consistent-type-imports':'error',
'unused-imports/no-unused-vars': [
'warn',
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_', ignoreRestSiblings: true },
],
'@typescript-eslint/default-param-last': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'class-methods-use-this': 'off',
'consistent-return': 'off',
'consistent-this': ['warn', 'self'],
curly: ['error', 'all'],
'func-names': 'error',
'import/no-unresolved': ['error', { caseSensitive: true }],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
'newlines-between': 'never',
pathGroups: [{ pattern: '@/**', group: 'internal' }],
pathGroupsExcludedImportTypes: ['type'],
},
],
'import/prefer-default-export': 'off',
'max-classes-per-file': 'off',
'max-len': ['error', { code: 120, ignoreStrings: true }],
'max-nested-callbacks': 'off',
'max-params': 'off',
'no-alert': 'error',
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-constant-condition': 'error',
'no-eq-null': 'off',
'no-nested-ternary': 'off',
'no-param-reassign': ['error', { props: true, ignorePropertyModificationsForRegex: ['^draft'] }],
'no-warning-comments': ['off'],
'no-plusplus':'off',
quotes: ['error', 'single', { ...airbnbStyleRules.rules.quotes[2], allowTemplateLiterals: false }],
},
};