@naturalcycles/dev-lib 20.1.0 → 20.1.1

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/biome.jsonc CHANGED
@@ -33,17 +33,17 @@
33
33
  "recommended": true,
34
34
  "performance": {
35
35
  // "useTopLevelRegex": "error" // consider
36
- "noDelete": "off" // todo
36
+ "noDelete": "off" // oxlint
37
37
  },
38
38
  "correctness": {
39
- "useImportExtensions": "error",
39
+ "useImportExtensions": "off", // oxlint
40
40
  "useParseIntRadix": "off",
41
- "noUnusedFunctionParameters": "error",
41
+ "noUnusedFunctionParameters": "off", // oxlint
42
42
  // noUnusedImports + noUnusedVariables can replace eslint-plugin-unused-vars!
43
- "noUnusedImports": "error",
43
+ "noUnusedImports": "off", // oxlint
44
44
  "noUnusedVariables": {
45
45
  "fix": "none",
46
- "level": "error",
46
+ "level": "off", // oxlint
47
47
  "options": {}
48
48
  }
49
49
  },
@@ -55,9 +55,9 @@
55
55
  "noDoneCallback": "error",
56
56
  "useShorthandFunctionType": "error",
57
57
  "useShorthandAssign": "error",
58
- "useForOf": "error",
58
+ "useForOf": "off", // oxlint
59
59
  "useConsistentArrayType": "error",
60
- "noDefaultExport": "error",
60
+ "noDefaultExport": "off", // oxlint
61
61
  "noNonNullAssertion": "off",
62
62
  "useImportType": "error",
63
63
  "noParameterAssign": "off",
@@ -71,8 +71,8 @@
71
71
  "useSingleVarDeclarator": "error",
72
72
  "noInferrableTypes": "error",
73
73
  "noUselessElse": "error",
74
- "useArrayLiterals": "error",
75
- "noCommonJs": "error"
74
+ "useArrayLiterals": "error"
75
+ // "noCommonJs": "error" // oxlint
76
76
  },
77
77
  "suspicious": {
78
78
  "useNumberToFixedDigitsArgument": "error",
@@ -85,6 +85,7 @@
85
85
  "noGlobalIsNan": "off", // todo,
86
86
  "noThenProperty": "off",
87
87
  "noImportAssign": "off",
88
+ "noDoubleEquals": "off", // oxlint
88
89
  "noEmptyInterface": "off"
89
90
  },
90
91
  "complexity": {
@@ -140,9 +140,9 @@ export default {
140
140
  '@typescript-eslint/no-misused-new': 2,
141
141
  '@typescript-eslint/no-misused-spread': 2,
142
142
  '@typescript-eslint/no-non-null-asserted-optional-chain': 2,
143
- '@typescript-eslint/no-unused-expressions': 2,
143
+ '@typescript-eslint/no-unused-expressions': 0, // oxlint
144
144
  '@typescript-eslint/prefer-as-const': 2,
145
- '@typescript-eslint/prefer-for-of': 2,
145
+ '@typescript-eslint/prefer-for-of': 0, // oxlint
146
146
  '@typescript-eslint/prefer-function-type': 2,
147
147
  '@typescript-eslint/prefer-namespace-keyword': 2,
148
148
  '@typescript-eslint/promise-function-async': [
@@ -162,7 +162,7 @@ export default {
162
162
  },
163
163
  ],
164
164
  'constructor-super': 2,
165
- eqeqeq: [2, 'smart'],
165
+ // eqeqeq: [2, 'smart'], // oxlint
166
166
  'for-direction': 2,
167
167
  'getter-return': 2,
168
168
  'id-blacklist': [
@@ -189,10 +189,10 @@ export default {
189
189
  // 'import-x/order': 0, // disabled in favor of `simple-import-sort`
190
190
  // 'import-x/namespace': 0, // issues with e.g globby
191
191
  // 'import-x/no-unresolved': 0, // breaks for type-aliases, e.g '@/store'
192
- 'import-x/no-anonymous-default-export': 2,
193
- 'import-x/no-duplicates': [2, { 'prefer-inline': false }],
194
- 'import-x/export': 2,
195
- 'import-x/no-empty-named-blocks': 2,
192
+ 'import-x/no-anonymous-default-export': 0, // oxlint
193
+ 'import-x/no-duplicates': [0, { 'prefer-inline': false }], // oxlint
194
+ 'import-x/export': 2, // todo: oxlint when it matures
195
+ 'import-x/no-empty-named-blocks': 0, // oxlint
196
196
  // Disabling no-cycle as the slowest rule. Oxlint is to be adopted instead
197
197
  // 'import-x/no-cycle': [
198
198
  // 2,
@@ -203,12 +203,9 @@ export default {
203
203
  // },
204
204
  // ],
205
205
  'import-x/no-useless-path-segments': 2,
206
- 'import-x/no-default-export': 0, // biome
206
+ 'import-x/no-default-export': 0, // biome, oxlint
207
207
  // 'import-x/no-commonjs': 2, // biome `noCommonJs`
208
208
  // 'import-x/extensions': [2, 'always'], // biome useImportExtensions
209
- 'jsdoc/check-alignment': 2,
210
- // "jsdoc/check-indentation": "error",
211
- // 'jsdoc/newline-after-description': 2,
212
209
  'no-array-constructor': 0,
213
210
  'no-async-promise-executor': 2,
214
211
  'no-bitwise': 2,
@@ -298,7 +295,7 @@ export default {
298
295
  'no-useless-catch': 2,
299
296
  'no-useless-escape': 2,
300
297
  'no-useless-assignment': 2,
301
- 'no-unneeded-ternary': 2,
298
+ 'no-unneeded-ternary': 0, // oxlint
302
299
  'no-duplicate-imports': 0, // too many false-positives (with e.g import type + import on next line)
303
300
  'no-var': 2,
304
301
  'no-with': 2,
@@ -321,7 +318,7 @@ export default {
321
318
  'use-isnan': 2,
322
319
  'valid-typeof': 2,
323
320
  'no-await-in-loop': 0, // it's actually often ok
324
- 'no-extend-native': 2,
321
+ 'no-extend-native': 0, // oxlint
325
322
  'guard-for-in': 2,
326
323
  '@typescript-eslint/no-namespace': [
327
324
  2,
@@ -348,7 +345,7 @@ export default {
348
345
  '@typescript-eslint/no-empty-function': 0,
349
346
  '@typescript-eslint/no-var-requires': 0,
350
347
  '@typescript-eslint/no-require-imports': 0,
351
- '@typescript-eslint/no-explicit-any': 0,
348
+ '@typescript-eslint/no-explicit-any': 0, // oxlint
352
349
  '@typescript-eslint/no-non-null-assertion': 0,
353
350
  '@typescript-eslint/explicit-module-boundary-types': [
354
351
  2,
@@ -386,7 +383,7 @@ export default {
386
383
  'unicorn/better-regex': 0, // we still believe that [0-9] is clearer than [\d]
387
384
  'unicorn/no-object-as-default-parameter': 0, // doesn't allow e.g method (opt = { skipValidation: true })
388
385
  'unicorn/catch-error-name': [
389
- 2,
386
+ 0, // oxlint
390
387
  {
391
388
  name: 'err',
392
389
  ignore: [/^err\d*$/, /^_/],
@@ -448,7 +445,7 @@ export default {
448
445
  'max-params': [2, { max: 5 }],
449
446
  'no-else-return': 2,
450
447
  'no-sequences': 2,
451
- 'no-useless-concat': 2,
448
+ 'no-useless-concat': 0, // oxlint
452
449
  '@typescript-eslint/ban-tslint-comment': 2,
453
450
  '@typescript-eslint/explicit-function-return-type': [
454
451
  2,
@@ -9,10 +9,10 @@ import eslint from '@eslint/js'
9
9
  import tseslint from 'typescript-eslint'
10
10
  import eslintPluginUnicorn from 'eslint-plugin-unicorn'
11
11
  import eslintPluginVue from 'eslint-plugin-vue'
12
+ import eslintPluginOxlint from 'eslint-plugin-oxlint'
12
13
  import eslintPluginVitest from '@vitest/eslint-plugin'
13
14
  import eslintPluginImportX from 'eslint-plugin-import-x'
14
15
  import eslintPluginSimpleImportSort from 'eslint-plugin-simple-import-sort'
15
- import eslintPluginJsdoc from 'eslint-plugin-jsdoc'
16
16
  import eslintPluginStylistic from '@stylistic/eslint-plugin'
17
17
  import eslintRules from './eslint-rules.js'
18
18
  import eslintVueRules from './eslint-vue-rules.js'
@@ -105,7 +105,7 @@ function getConfig(tsconfigPath) {
105
105
  'import-x': eslintPluginImportX,
106
106
  // 'unused-imports': require('eslint-plugin-unused-imports'), // disabled in favor of biome rules
107
107
  'simple-import-sort': eslintPluginSimpleImportSort,
108
- jsdoc: eslintPluginJsdoc,
108
+ // jsdoc: eslintPluginJsdoc, // oxlint
109
109
  '@stylistic': eslintPluginStylistic,
110
110
  },
111
111
  languageOptions: {
@@ -131,6 +131,7 @@ function getConfig(tsconfigPath) {
131
131
  ...eslintVueRules.rules,
132
132
  ...eslintPrettierRules.rules, // disable eslint rules already covered by prettier
133
133
  ...eslintBiomeRules.rules, // disable eslint rules already covered by biome
134
+ ...eslintPluginOxlint.configs['flat/all'].rules, // disable eslint rules already covered by oxlint
134
135
  },
135
136
  }
136
137
  }
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "../node_modules/oxlint/configuration_schema.json",
2
3
  "plugins": [
3
4
  "oxc",
4
5
  "eslint",
@@ -32,12 +33,25 @@
32
33
  "no-unused-expressions": 2,
33
34
  "no-var": 2,
34
35
  "unicode-bom": 2,
36
+ "no-extend-native": 2,
37
+ "no-extra-bind": 2,
38
+ "no-new": 2,
39
+ "no-unexpected-multiline": 2,
40
+ "no-unneeded-ternary": 2,
41
+ "no-useless-concat": 2,
42
+ "no-useless-constructor": 2,
43
+ "preserve-caught-error": 2,
44
+ "eqeqeq": [2, "smart"],
35
45
  "import/extensions": [2, "always"],
36
46
  "import/no-amd": 2,
37
47
  "import/no-commonjs": 2,
38
48
  "import/no-cycle": 2,
39
49
  "import/no-default-export": 2,
40
50
  "import/no-webpack-loader-syntax": 2,
51
+ "import/no-duplicates": [2, { "prefer-inline": false }],
52
+ // "import/export": 2, // todo: adopt when it graduates
53
+ "import/no-empty-named-blocks": 2,
54
+ "import/no-absolute-path": 2,
41
55
  "oxc/bad-bitwise-operator": 2,
42
56
  "oxc/no-const-enum": 2,
43
57
  "promise/spec-only": 2,
@@ -60,6 +74,7 @@
60
74
  "checkMethodDeclarations": true
61
75
  }
62
76
  ],
77
+ "typescript/prefer-for-of": 2,
63
78
  "unicorn/no-anonymous-default-export": 2,
64
79
  "unicorn/no-array-reduce": [
65
80
  2,
@@ -72,6 +87,13 @@
72
87
  "unicorn/no-magic-array-flat-depth": 2,
73
88
  "unicorn/prefer-modern-math-apis": 2,
74
89
  "unicorn/prefer-node-protocol": 2,
90
+ "unicorn/catch-error-name": [
91
+ 2,
92
+ {
93
+ "name": "err",
94
+ "ignore": ["^err\\d*$", "^_"]
95
+ }
96
+ ],
75
97
  "vue/no-multiple-slot-args": 2
76
98
  },
77
99
  "settings": {
package/dist/lint.util.js CHANGED
@@ -142,9 +142,8 @@ export function runOxlint(fix = true) {
142
142
  args: [
143
143
  // '--report-unused-disable-directives',
144
144
  '--max-warnings=1',
145
- fix ? '--fix' : '--no-fix',
145
+ fix && '--fix',
146
146
  ].filter(_isTruthy),
147
- logFinish: false,
148
147
  shell: false,
149
148
  });
150
149
  }
@@ -281,7 +280,6 @@ export function runBiome(fix = true) {
281
280
  exec2.spawn(biomePath, {
282
281
  name: fix ? 'biome' : 'biome --no-fix',
283
282
  args: [`lint`, fix && '--write', fix && '--unsafe', '--no-errors-on-unmatched', ...dirs].filter(_isTruthy),
284
- logFinish: false,
285
283
  shell: false,
286
284
  });
287
285
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
3
  "type": "module",
4
- "version": "20.1.0",
4
+ "version": "20.1.1",
5
5
  "dependencies": {
6
6
  "@biomejs/biome": "^2",
7
7
  "@commitlint/cli": "^20",
@@ -15,7 +15,7 @@
15
15
  "@vitest/eslint-plugin": "^1",
16
16
  "eslint": "^9",
17
17
  "eslint-plugin-import-x": "^4",
18
- "eslint-plugin-jsdoc": "^60",
18
+ "eslint-plugin-oxlint": "^1",
19
19
  "eslint-plugin-simple-import-sort": "^12",
20
20
  "eslint-plugin-unicorn": "^61",
21
21
  "eslint-plugin-vue": "^10",