@evanpurkhiser/oxc-config 0.7.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 -1
- package/src/react.mjs +9 -0
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
|
|
@@ -30,6 +39,22 @@ const common = {
|
|
|
30
39
|
'prefer-template': ['warn'],
|
|
31
40
|
'arrow-body-style': ['error', 'as-needed'],
|
|
32
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
|
+
|
|
33
58
|
// Disabled for TypeScript
|
|
34
59
|
'no-unused-expressions': ['off'],
|
|
35
60
|
|
|
@@ -43,6 +68,51 @@ const common = {
|
|
|
43
68
|
'typescript/no-unused-expressions': ['error'],
|
|
44
69
|
'typescript/no-useless-constructor': ['error'],
|
|
45
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'],
|
|
46
116
|
},
|
|
47
117
|
};
|
|
48
118
|
|
package/src/react.mjs
CHANGED
|
@@ -10,6 +10,15 @@ const react = {
|
|
|
10
10
|
'react/no-this-in-sfc': ['warn'],
|
|
11
11
|
'react/jsx-boolean-value': ['warn'],
|
|
12
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'],
|
|
13
22
|
},
|
|
14
23
|
};
|
|
15
24
|
|