-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.js
89 lines (89 loc) · 2.38 KB
/
next.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
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: [
require.resolve('./base'),
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
],
env: {
node: true,
browser: true,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
React: true,
JSX: true,
},
settings: {
react: {
version: 'detect',
},
},
plugins: ['react', 'react-hooks', 'jsx-a11y'],
rules: {
'@typescript-eslint/consistent-type-imports': [
'warn',
{
disallowTypeAnnotations: true,
fixStyle: 'separate-type-imports',
prefer: 'type-imports',
},
],
'@typescript-eslint/naming-convention': [
'error',
{
format: ['PascalCase'],
selector: ['typeLike', 'enumMember'],
},
{
custom: {
match: false,
regex: '^I[A-Z]|^(Interface|Props|State)$',
},
format: ['PascalCase'],
selector: 'interface',
},
],
'@typescript-eslint/no-explicit-any': 'error',
'jsx-a11y/alt-text': ['warn', { elements: ['img'], img: ['Image'] }],
'jsx-a11y/aria-props': 'warn',
'jsx-a11y/aria-proptypes': 'warn',
'jsx-a11y/aria-unsupported-elements': 'warn',
'jsx-a11y/role-has-required-aria-props': 'warn',
'jsx-a11y/role-supports-aria-props': 'warn',
'react/button-has-type': 'warn',
'react/hook-use-state': 'warn',
'react/jsx-boolean-value': 'warn',
'react/jsx-fragments': 'warn',
'react/jsx-no-useless-fragment': ['warn', { allowExpressions: true }],
'react/jsx-pascal-case': 'warn',
'react/jsx-sort-props': 'warn',
'react/no-unknown-property': 'error',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react/self-closing-comp': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/rules-of-hooks': 'error',
},
overrides: [
{
files: ['src/**/{default,error,layout,loading,middleware,not-found,page,route}.{ts,tsx}'],
rules: {
'import/no-default-export': 'off',
'react/function-component-definition': 'off',
},
},
{
files: ['tailwind.config.{js,ts,cjs,mjs}', 'postcss.config.{js,ts,cjs,mjs}'],
rules: {
'import/no-default-export': 'off',
'@typescript-eslint/no-require-imports': 'off',
},
},
],
}