@evanpurkhiser/oxc-config 0.6.0 → 0.8.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/package.json +1 -1
- package/src/common.mjs +71 -13
- package/src/react.mjs +9 -3
package/package.json
CHANGED
package/src/common.mjs
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
const common = {
|
|
2
|
-
plugins: [
|
|
2
|
+
plugins: [
|
|
3
|
+
'eslint',
|
|
4
|
+
'typescript',
|
|
5
|
+
'unicorn',
|
|
6
|
+
'oxc',
|
|
7
|
+
'import',
|
|
8
|
+
'react',
|
|
9
|
+
'promise',
|
|
10
|
+
'node',
|
|
11
|
+
],
|
|
3
12
|
|
|
4
13
|
rules: {
|
|
5
14
|
// Best practices
|
|
@@ -8,10 +17,8 @@ const common = {
|
|
|
8
17
|
'no-caller': ['warn'],
|
|
9
18
|
'no-else-return': ['error', {allowElseIf: false}],
|
|
10
19
|
'no-extra-label': ['error'],
|
|
11
|
-
'no-floating-decimal': ['error'],
|
|
12
20
|
'no-implied-eval': ['error'],
|
|
13
21
|
'no-lone-blocks': ['error'],
|
|
14
|
-
'no-return-await': ['error'],
|
|
15
22
|
'no-self-compare': ['error'],
|
|
16
23
|
'no-sequences': ['error'],
|
|
17
24
|
'no-useless-call': ['warn'],
|
|
@@ -22,18 +29,8 @@ const common = {
|
|
|
22
29
|
eqeqeq: ['error'],
|
|
23
30
|
radix: ['warn'],
|
|
24
31
|
|
|
25
|
-
// Variables
|
|
26
|
-
'no-undef-init': ['warn'],
|
|
27
|
-
|
|
28
|
-
// Style (mostly handled by prettier/oxfmt)
|
|
29
|
-
'eol-last': ['error', 'always'],
|
|
30
|
-
'new-parens': ['error'],
|
|
31
|
-
'padded-blocks': ['warn', 'never'],
|
|
32
|
-
'spaced-comment': ['warn', 'always'],
|
|
33
|
-
|
|
34
32
|
// ECMAScript
|
|
35
33
|
'no-var': ['error'],
|
|
36
|
-
'prefer-arrow-callback': ['warn'],
|
|
37
34
|
'prefer-const': ['error'],
|
|
38
35
|
'prefer-destructuring': ['off'],
|
|
39
36
|
'prefer-numeric-literals': ['warn'],
|
|
@@ -42,6 +39,22 @@ const common = {
|
|
|
42
39
|
'prefer-template': ['warn'],
|
|
43
40
|
'arrow-body-style': ['error', 'as-needed'],
|
|
44
41
|
|
|
42
|
+
// Correctness
|
|
43
|
+
'no-template-curly-in-string': ['error'],
|
|
44
|
+
'no-throw-literal': ['error'],
|
|
45
|
+
'default-case-last': ['error'],
|
|
46
|
+
'prefer-promise-reject-errors': ['error'],
|
|
47
|
+
'no-extend-native': ['error'],
|
|
48
|
+
'preserve-caught-error': ['error'],
|
|
49
|
+
'no-implicit-coercion': ['warn'],
|
|
50
|
+
|
|
51
|
+
// Style cleanup
|
|
52
|
+
'object-shorthand': ['warn'],
|
|
53
|
+
'no-useless-rename': ['warn'],
|
|
54
|
+
'no-unneeded-ternary': ['warn'],
|
|
55
|
+
'prefer-object-spread': ['warn'],
|
|
56
|
+
'prefer-object-has-own': ['warn'],
|
|
57
|
+
|
|
45
58
|
// Disabled for TypeScript
|
|
46
59
|
'no-unused-expressions': ['off'],
|
|
47
60
|
|
|
@@ -55,6 +68,51 @@ const common = {
|
|
|
55
68
|
'typescript/no-unused-expressions': ['error'],
|
|
56
69
|
'typescript/no-useless-constructor': ['error'],
|
|
57
70
|
'typescript/array-type': ['error', {default: 'array-simple'}],
|
|
71
|
+
'typescript/consistent-type-imports': ['error'],
|
|
72
|
+
'typescript/no-import-type-side-effects': ['error'],
|
|
73
|
+
'typescript/no-non-null-asserted-optional-chain': ['error'],
|
|
74
|
+
'typescript/no-non-null-asserted-nullish-coalescing': ['error'],
|
|
75
|
+
'typescript/prefer-as-const': ['error'],
|
|
76
|
+
'typescript/ban-ts-comment': ['warn'],
|
|
77
|
+
'typescript/prefer-ts-expect-error': ['error'],
|
|
78
|
+
'typescript/prefer-enum-initializers': ['error'],
|
|
79
|
+
'typescript/prefer-literal-enum-member': ['error'],
|
|
80
|
+
'typescript/no-mixed-enums': ['error'],
|
|
81
|
+
'typescript/no-inferrable-types': ['warn'],
|
|
82
|
+
'typescript/consistent-generic-constructors': ['warn'],
|
|
83
|
+
|
|
84
|
+
// Imports
|
|
85
|
+
'import/no-duplicates': ['error'],
|
|
86
|
+
'import/no-self-import': ['error'],
|
|
87
|
+
'import/no-empty-named-blocks': ['error'],
|
|
88
|
+
'import/no-named-as-default': ['warn'],
|
|
89
|
+
'import/no-named-as-default-member': ['warn'],
|
|
90
|
+
'import/first': ['warn'],
|
|
91
|
+
|
|
92
|
+
// Unicorn
|
|
93
|
+
'unicorn/prefer-node-protocol': ['error'],
|
|
94
|
+
'unicorn/prefer-string-slice': ['warn'],
|
|
95
|
+
'unicorn/no-useless-undefined': ['warn'],
|
|
96
|
+
'unicorn/prefer-array-flat-map': ['warn'],
|
|
97
|
+
'unicorn/prefer-date-now': ['warn'],
|
|
98
|
+
'unicorn/prefer-regexp-test': ['warn'],
|
|
99
|
+
'unicorn/prefer-math-min-max': ['warn'],
|
|
100
|
+
'unicorn/prefer-string-replace-all': ['warn'],
|
|
101
|
+
'unicorn/prefer-number-properties': ['warn'],
|
|
102
|
+
'unicorn/no-instanceof-array': ['warn'],
|
|
103
|
+
'unicorn/no-typeof-undefined': ['warn'],
|
|
104
|
+
'unicorn/no-useless-promise-resolve-reject': ['warn'],
|
|
105
|
+
'unicorn/error-message': ['error'],
|
|
106
|
+
'unicorn/new-for-builtins': ['error'],
|
|
107
|
+
|
|
108
|
+
// Promise
|
|
109
|
+
'promise/no-new-statics': ['error'],
|
|
110
|
+
'promise/valid-params': ['error'],
|
|
111
|
+
'promise/param-names': ['warn'],
|
|
112
|
+
|
|
113
|
+
// Node
|
|
114
|
+
'node/no-new-require': ['error'],
|
|
115
|
+
'node/no-path-concat': ['error'],
|
|
58
116
|
},
|
|
59
117
|
};
|
|
60
118
|
|
package/src/react.mjs
CHANGED
|
@@ -6,13 +6,19 @@ const react = {
|
|
|
6
6
|
rules: {
|
|
7
7
|
'react-hooks/rules-of-hooks': ['error'],
|
|
8
8
|
'react-hooks/exhaustive-deps': ['warn'],
|
|
9
|
-
'react/prop-types': ['off'],
|
|
10
9
|
'react/display-name': ['off'],
|
|
11
|
-
'react/no-access-state-in-setstate': ['warn'],
|
|
12
10
|
'react/no-this-in-sfc': ['warn'],
|
|
13
|
-
'react/prefer-stateless-function': ['warn'],
|
|
14
11
|
'react/jsx-boolean-value': ['warn'],
|
|
15
12
|
'react/jsx-pascal-case': ['warn'],
|
|
13
|
+
'react/button-has-type': ['error'],
|
|
14
|
+
'react/jsx-no-target-blank': ['error'],
|
|
15
|
+
'react/jsx-no-constructed-context-values': ['warn'],
|
|
16
|
+
'react/no-array-index-key': ['warn'],
|
|
17
|
+
'react/jsx-no-useless-fragment': ['warn'],
|
|
18
|
+
'react/self-closing-comp': ['warn'],
|
|
19
|
+
'react/jsx-curly-brace-presence': ['warn'],
|
|
20
|
+
'react/jsx-fragments': ['warn'],
|
|
21
|
+
'react/forward-ref-uses-ref': ['warn'],
|
|
16
22
|
},
|
|
17
23
|
};
|
|
18
24
|
|