-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
81 lines (79 loc) · 2.16 KB
/
.eslintrc.cjs
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
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'standard-with-typescript',
'plugin:@next/next/recommended',
'next/core-web-vitals',
'plugin:tailwindcss/recommended',
],
overrides: [
{
env: {
node: true,
},
files: [
'.eslintrc.{js,cjs}',
],
parserOptions: {
sourceType: 'script',
},
},
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json'],
},
parser: '@typescript-eslint/parser',
plugins: [
'react',
],
rules: {
'@typescript-eslint/comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'only-multiline',
generics: 'ignore',
}],
'@typescript-eslint/explicit-function-return-type': ['off'],
'@typescript-eslint/no-misused-promises': ['off'],
'@typescript-eslint/strict-boolean-expressions': ['off'],
'@typescript-eslint/no-unsafe-argument': ['off'],
'@typescript-eslint/consistent-type-assertions': ['off'],
'react/jsx-curly-newline': ['warn'],
'react/jsx-indent': ['warn', 2, {
checkAttributes: true,
indentLogicalExpressions: true,
}],
'react/prop-types': ['off'],
'react/jsx-indent-props': ['warn', 2],
'react/jsx-closing-bracket-location': ['warn', 'tag-aligned'],
'jsx-quotes': ['warn', 'prefer-double'],
'react/jsx-curly-spacing': ['warn', { when: 'never', children: true }],
'react/jsx-tag-spacing': ['warn', {
closingSlash: 'never',
beforeSelfClosing: 'always',
afterOpening: 'never',
beforeClosing: 'never',
}],
'react/self-closing-comp': 'warn',
'react/jsx-fragments': 'warn',
'react/jsx-equals-spacing': ['warn', 'never'],
'react/jsx-sort-props': ['warn', {
callbacksLast: true,
shorthandFirst: true,
reservedFirst: true,
}],
'react/jsx-curly-brace-presence': ['warn', {
}],
'@next/next/no-img-element': ['off'],
'tailwindcss/classnames-order': ['warn', {
callees: ['classnames', 'clsx', 'cn'],
}],
},
}