-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.cjs
77 lines (73 loc) · 1.86 KB
/
index.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
module.exports = {
extends: ['xo-react', 'plugin:@next/next/recommended'],
rules: {
// JSX
'jsx-quotes': ['error', 'prefer-single'],
// React
'react/boolean-prop-naming': [
'warn',
{
validateNested: true,
},
],
'react/forbid-component-props': 'off',
'react/function-component-definition': [
'error',
{
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
},
],
'react/jsx-closing-bracket-location': [
'error',
{
nonEmpty: 'tag-aligned',
selfClosing: false,
},
],
'react/jsx-closing-tag-location': 'off',
'react/jsx-curly-brace-presence': [
'error',
{
props: 'never',
// This allows <style jsx>{`…`}</style>
children: 'ignore',
},
],
'react/jsx-first-prop-new-line': 'off',
'react/jsx-handler-names': 'off',
'react/jsx-max-props-per-line': 'off',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-tag-spacing': [
'error',
{
closingSlash: 'never',
beforeSelfClosing: 'always',
afterOpening: 'never',
},
],
'react/jsx-no-duplicate-props': [
'error',
{
// This allows material-ui’s usage of inputProps and InputProps together:
// <TextField inputProps={{…}} InputProps={{…}} /> errors otherwise.
ignoreCase: false,
},
],
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'react/require-default-props': [
'warn',
{
forbidDefaultForRequired: true,
functions: 'defaultArguments',
},
],
// Unicorn
// Next.js does not support node protocol imports yet
'unicorn/prefer-node-protocol': 'off',
// N
// Do not use the process import in Next.js
'n/prefer-global/process': 'off',
},
}