@naturalcycles/dev-lib 20.1.1 → 20.1.2
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/cfg/eslint-rules.js +4 -0
- package/cfg/lint-staged.config.js +1 -1
- package/cfg/oxlint.config.json +8 -6
- package/dist/lint.util.js +2 -2
- package/package.json +1 -1
package/cfg/eslint-rules.js
CHANGED
|
@@ -381,6 +381,10 @@ export default {
|
|
|
381
381
|
'unicorn/prefer-spread': 0, // fails on joiSchema.concat() which is not an array!
|
|
382
382
|
'unicorn/prefer-structured-clone': 0, // no real advantage, plus in most of the cases we want JSON to remove undefined, etc.
|
|
383
383
|
'unicorn/better-regex': 0, // we still believe that [0-9] is clearer than [\d]
|
|
384
|
+
'unicorn/no-for-loop': 0, // oxlint has similar
|
|
385
|
+
'unicorn/no-array-reduce': 0, // oxlint
|
|
386
|
+
'unicorn/no-accessor-recursion': 0, // oxlint
|
|
387
|
+
'unicorn/no-anonymous-default-export': 0, // oxlint
|
|
384
388
|
'unicorn/no-object-as-default-parameter': 0, // doesn't allow e.g method (opt = { skipValidation: true })
|
|
385
389
|
'unicorn/catch-error-name': [
|
|
386
390
|
0, // oxlint
|
|
@@ -65,7 +65,7 @@ if (eslintConfigPath) {
|
|
|
65
65
|
let oxlintCmd = undefined
|
|
66
66
|
|
|
67
67
|
if (oxlintConfigPath) {
|
|
68
|
-
oxlintCmd = ['oxlint', '--fix', '--max-warnings=1'].filter(Boolean).join(' ')
|
|
68
|
+
oxlintCmd = ['oxlint', '--fix', '--fix-suggestions', '--max-warnings=1'].filter(Boolean).join(' ')
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
const stylelintExists =
|
package/cfg/oxlint.config.json
CHANGED
|
@@ -52,8 +52,14 @@
|
|
|
52
52
|
// "import/export": 2, // todo: adopt when it graduates
|
|
53
53
|
"import/no-empty-named-blocks": 2,
|
|
54
54
|
"import/no-absolute-path": 2,
|
|
55
|
+
"import/no-named-as-default": 2,
|
|
56
|
+
"import/no-named-as-default-member": 0,
|
|
57
|
+
"import/no-self-import": 2,
|
|
58
|
+
"import/no-unassigned-import": 0,
|
|
55
59
|
"oxc/bad-bitwise-operator": 2,
|
|
56
60
|
"oxc/no-const-enum": 2,
|
|
61
|
+
"oxc/approx-constant": 2,
|
|
62
|
+
"oxc/misrefactored-assign-op": 2,
|
|
57
63
|
"promise/spec-only": 2,
|
|
58
64
|
"typescript/explicit-function-return-type": [2, { "allowExpressions": true }],
|
|
59
65
|
// "typescript/explicit-module-boundary-types": [2, {"allowArgumentsExplicitlyTypedAsAny": true}]
|
|
@@ -76,12 +82,7 @@
|
|
|
76
82
|
],
|
|
77
83
|
"typescript/prefer-for-of": 2,
|
|
78
84
|
"unicorn/no-anonymous-default-export": 2,
|
|
79
|
-
"unicorn/no-array-reduce":
|
|
80
|
-
2,
|
|
81
|
-
{
|
|
82
|
-
"allowSimpleOperations": true
|
|
83
|
-
}
|
|
84
|
-
],
|
|
85
|
+
"unicorn/no-array-reduce": 2,
|
|
85
86
|
"unicorn/no-document-cookie": 2,
|
|
86
87
|
"unicorn/no-length-as-slice-end": 2,
|
|
87
88
|
"unicorn/no-magic-array-flat-depth": 2,
|
|
@@ -94,6 +95,7 @@
|
|
|
94
95
|
"ignore": ["^err\\d*$", "^_"]
|
|
95
96
|
}
|
|
96
97
|
],
|
|
98
|
+
"unicorn/no-accessor-recursion": 2,
|
|
97
99
|
"vue/no-multiple-slot-args": 2
|
|
98
100
|
},
|
|
99
101
|
"settings": {
|
package/dist/lint.util.js
CHANGED
|
@@ -138,11 +138,11 @@ export function runOxlint(fix = true) {
|
|
|
138
138
|
}
|
|
139
139
|
const oxlintPath = findPackageBinPath('oxlint', 'oxlint');
|
|
140
140
|
exec2.spawn(oxlintPath, {
|
|
141
|
-
name: ['
|
|
141
|
+
name: ['oxlint', !fix && '--no-fix'].filter(Boolean).join(' '),
|
|
142
142
|
args: [
|
|
143
143
|
// '--report-unused-disable-directives',
|
|
144
144
|
'--max-warnings=1',
|
|
145
|
-
fix && '--fix',
|
|
145
|
+
fix && '--fix --fix-suggestions',
|
|
146
146
|
].filter(_isTruthy),
|
|
147
147
|
shell: false,
|
|
148
148
|
});
|