@ver0/oxlint-config 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/configs/browser-globals.js +68 -0
- package/configs/browser.js +6 -78
- package/configs/javascript.js +118 -251
- package/configs/node.js +16 -36
- package/configs/react.js +76 -109
- package/configs/typescript.js +185 -497
- package/configs/vitest.js +1 -8
- package/package.json +2 -1
package/configs/react.js
CHANGED
|
@@ -1,117 +1,84 @@
|
|
|
1
|
-
import {GLOBS} from '../utils/globs.js';
|
|
2
|
-
|
|
3
1
|
/** @type {import('oxlint').OxlintConfig} */
|
|
4
2
|
const react = {
|
|
5
|
-
plugins: [],
|
|
3
|
+
plugins: ['react'],
|
|
6
4
|
categories: {
|
|
7
|
-
correctness: '
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
correctness: 'error',
|
|
6
|
+
suspicious: 'error',
|
|
7
|
+
pedantic: 'error',
|
|
8
|
+
perf: 'error',
|
|
11
9
|
},
|
|
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
|
-
'react/no-this-in-sfc': 'error',
|
|
52
|
-
'react/no-unescaped-entities': 'error',
|
|
53
|
-
'react/no-unknown-property': [
|
|
54
|
-
'error',
|
|
55
|
-
{
|
|
56
|
-
requireDataLowercase: true,
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
'react/no-unsafe': 'error',
|
|
60
|
-
'react/react-in-jsx-scope': 'off',
|
|
61
|
-
'react/self-closing-comp': 'error',
|
|
62
|
-
'react/state-in-constructor': ['error', 'never'],
|
|
63
|
-
'react/style-prop-object': [
|
|
64
|
-
'error',
|
|
65
|
-
{
|
|
66
|
-
allow: ['FormattedNumber'],
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
'react/void-dom-elements-no-children': 'error',
|
|
70
|
-
'react/jsx-boolean-value': 'error',
|
|
71
|
-
'react/jsx-key': [
|
|
72
|
-
'error',
|
|
73
|
-
{
|
|
74
|
-
checkFragmentShorthand: true,
|
|
75
|
-
checkKeyMustBeforeSpread: true,
|
|
76
|
-
warnOnDuplicates: true,
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
'react/jsx-no-comment-textnodes': 'error',
|
|
80
|
-
'react/jsx-no-constructed-context-values': 'error',
|
|
81
|
-
'react/jsx-no-duplicate-props': 'error',
|
|
82
|
-
'react/jsx-no-script-url': [
|
|
83
|
-
'error',
|
|
84
|
-
{
|
|
85
|
-
includeFromSettings: true,
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
'react/jsx-no-target-blank': [
|
|
89
|
-
'error',
|
|
90
|
-
{
|
|
91
|
-
warnOnSpreadAttributes: true,
|
|
92
|
-
forms: true,
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
'react/jsx-no-undef': 'error',
|
|
96
|
-
'react/jsx-no-useless-fragment': 'error',
|
|
97
|
-
'react/jsx-curly-brace-presence': [
|
|
98
|
-
'error',
|
|
99
|
-
{
|
|
100
|
-
props: 'never',
|
|
101
|
-
children: 'never',
|
|
102
|
-
propElementValues: 'always',
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
'react/jsx-fragments': ['error', 'syntax'],
|
|
106
|
-
'react/jsx-pascal-case': 'error',
|
|
107
|
-
'react/jsx-props-no-spread-multi': 'error',
|
|
108
|
-
'react/rules-of-hooks': 'error',
|
|
109
|
-
'react/exhaustive-deps': 'warn',
|
|
110
|
-
'react/display-name': 'off',
|
|
10
|
+
rules: {
|
|
11
|
+
'react/button-has-type': 'error',
|
|
12
|
+
'react/display-name': 'off',
|
|
13
|
+
'react/function-component-definition': [
|
|
14
|
+
'error',
|
|
15
|
+
{
|
|
16
|
+
namedComponents: 'function-declaration',
|
|
17
|
+
unnamedComponents: 'arrow-function',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
'react/hook-use-state': [
|
|
21
|
+
'error',
|
|
22
|
+
{
|
|
23
|
+
allowDestructuredState: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
'react/jsx-boolean-value': 'error',
|
|
27
|
+
'react/jsx-curly-brace-presence': [
|
|
28
|
+
'error',
|
|
29
|
+
{
|
|
30
|
+
props: 'never',
|
|
31
|
+
children: 'never',
|
|
32
|
+
propElementValues: 'always',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
'react/jsx-fragments': ['error', 'syntax'],
|
|
36
|
+
'react/jsx-key': [
|
|
37
|
+
'error',
|
|
38
|
+
{
|
|
39
|
+
checkFragmentShorthand: true,
|
|
40
|
+
checkKeyMustBeforeSpread: true,
|
|
41
|
+
warnOnDuplicates: true,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
'react/jsx-no-script-url': [
|
|
45
|
+
'error',
|
|
46
|
+
{
|
|
47
|
+
includeFromSettings: true,
|
|
111
48
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
49
|
+
],
|
|
50
|
+
'react/jsx-no-target-blank': [
|
|
51
|
+
'error',
|
|
52
|
+
{
|
|
53
|
+
warnOnSpreadAttributes: true,
|
|
54
|
+
forms: true,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
'react/jsx-pascal-case': 'error',
|
|
58
|
+
'react/no-danger': 'error',
|
|
59
|
+
'react/no-redundant-should-component-update': 'error',
|
|
60
|
+
'react/no-string-refs': [
|
|
61
|
+
'error',
|
|
62
|
+
{
|
|
63
|
+
noTemplateLiterals: true,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
'react/no-unknown-property': [
|
|
67
|
+
'error',
|
|
68
|
+
{
|
|
69
|
+
requireDataLowercase: true,
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
'react/react-in-jsx-scope': 'off',
|
|
73
|
+
'react/self-closing-comp': 'error',
|
|
74
|
+
'react/state-in-constructor': ['error', 'never'],
|
|
75
|
+
'react/style-prop-object': [
|
|
76
|
+
'error',
|
|
77
|
+
{
|
|
78
|
+
allow: ['FormattedNumber'],
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
115
82
|
};
|
|
116
83
|
|
|
117
84
|
export default react;
|