-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
106 lines (104 loc) · 2.44 KB
/
eslint.config.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
import { FlatCompat } from '@eslint/eslintrc'
import ts from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import importPlugin from 'eslint-plugin-import'
import reactPlugin from 'eslint-plugin-react'
const compat = new FlatCompat()
export default [
...compat.extends('eslint-config-google').map((config) => ({
...config,
ignores: ['dist/**/*'],
})),
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
ignores: ['dist/**/*', 'node_modules/**/*'],
languageOptions: { parser: tsParser },
plugins: {
'@typescript-eslint': ts,
import: importPlugin,
react: reactPlugin,
},
rules: {
...ts.configs['recommended'].rules,
...ts.configs['eslint-recommended'].rules,
semi: [
'error',
'never',
],
quotes: [
'error',
'single',
],
'require-jsdoc': 'off',
'array-element-newline': [
'error',
'consistent',
],
'object-curly-spacing': [
'error',
'always',
],
'object-curly-newline': [
'error',
{
consistent: true,
},
],
'quote-props': [
'error',
'as-needed',
],
'react/prop-types': 'off',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'react/display-name': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: false,
},
],
'import/no-unresolved': 'off',
'import/no-named-as-default-member': 'off',
'import/namespace': [
'off',
{ allowComputed: true },
],
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
pathGroupsExcludedImportTypes: [
'react',
],
pathGroups: [
{
pattern: 'react',
group: 'builtin',
position: 'before',
},
{
pattern: '/**',
group: 'internal',
position: 'after',
},
],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
},
]