@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/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: 'off',
8
- },
9
- env: {
10
- builtin: true,
5
+ correctness: 'error',
6
+ suspicious: 'error',
7
+ pedantic: 'error',
8
+ perf: 'error',
11
9
  },
12
- overrides: [
13
- {
14
- files: [GLOBS.JS, GLOBS.TS],
15
- rules: {
16
- 'react/button-has-type': 'error',
17
- 'react/checked-requires-onchange-or-readonly': 'error',
18
- 'react/forward-ref-uses-ref': 'error',
19
- 'react/function-component-definition': [
20
- 'error',
21
- {
22
- namedComponents: 'function-declaration',
23
- unnamedComponents: 'arrow-function',
24
- },
25
- ],
26
- 'react/hook-use-state': [
27
- 'error',
28
- {
29
- allowDestructuredState: true,
30
- },
31
- ],
32
- 'react/iframe-missing-sandbox': 'error',
33
- 'react/no-array-index-key': 'error',
34
- 'react/no-children-prop': 'error',
35
- 'react/no-danger': 'error',
36
- 'react/no-danger-with-children': 'error',
37
- 'react/no-did-update-set-state': 'error',
38
- 'react/no-direct-mutation-state': 'error',
39
- 'react/no-find-dom-node': 'error',
40
- 'react/no-is-mounted': 'error',
41
- 'react/no-namespace': 'error',
42
- 'react/no-object-type-as-default-prop': 'error',
43
- 'react/no-redundant-should-component-update': 'error',
44
- 'react/no-render-return-value': 'error',
45
- 'react/no-string-refs': [
46
- 'error',
47
- {
48
- noTemplateLiterals: true,
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
- plugins: ['react'],
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;