@naturalcycles/dev-lib 20.77.2 → 20.79.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.
@@ -60,14 +60,7 @@ if (eslintConfigPath) {
60
60
  let oxlintCmd = undefined
61
61
 
62
62
  if (oxlintConfigPath) {
63
- oxlintCmd = [
64
- 'oxlint',
65
- '--fix',
66
- '--fix-suggestions',
67
- '--fix-dangerously',
68
- '--no-error-on-unmatched-pattern',
69
- '--disable-nested-config',
70
- ]
63
+ oxlintCmd = ['oxlint', '--fix', '--no-error-on-unmatched-pattern', '--disable-nested-config']
71
64
  .filter(Boolean)
72
65
  .join(' ')
73
66
  }
@@ -25,8 +25,7 @@ const EVALUATED_ARGUMENTS = new Set([
25
25
  // a shared `overrides` entry, because `defineOxlintConfig` lets a consumer's `overrides` replace it
26
26
  const TEST_FILE_PATTERN = /\.(?:test|spec)\.[cm]?[jt]sx?$|\/(?:test|testing)\//
27
27
 
28
- // No `fix`/`suggest`: dev-lib runs oxlint with --fix-dangerously, which would apply them and leave
29
- // `_assert` unimported
28
+ // No `fix`: dev-lib runs oxlint with --fix, which would apply it and leave `_assert` unimported
30
29
  const preferAssertRule = {
31
30
  meta: {
32
31
  type: 'suggestion',
@@ -304,9 +304,9 @@ const linesBetweenClassMembersRule = {
304
304
  const sourceCode = context.sourceCode
305
305
  const mode = context.options?.[0] || 'always'
306
306
  const exceptAfterSingleLine =
307
- context.options?.[1]?.exceptAfterSingleLine !== undefined
308
- ? Boolean(context.options[1].exceptAfterSingleLine)
309
- : true
307
+ context.options?.[1]?.exceptAfterSingleLine === undefined
308
+ ? true
309
+ : Boolean(context.options[1].exceptAfterSingleLine)
310
310
  const exceptAfterOverload = true
311
311
 
312
312
  if (mode !== 'always') {
@@ -378,6 +378,8 @@ export const sharedConfig = {
378
378
  'unicorn/no-hex-escape': 2,
379
379
  'unicorn/no-instanceof-builtins': 2,
380
380
  'unicorn/no-lonely-if': 2,
381
+ // `if (!a) {} else {}` and `a !== b ? x : y` read better the other way round; autofixable
382
+ 'unicorn/no-negated-condition': 2,
381
383
  'unicorn/no-negation-in-equality-check': 2,
382
384
  'unicorn/no-new-buffer': 2,
383
385
  'unicorn/prefer-string-replace-all': 2,
@@ -405,7 +407,7 @@ export const sharedConfig = {
405
407
  'unicorn/no-array-fill-with-reference-type': 0, // flags `fill([])` even when the shared value is never mutated
406
408
  'unicorn/no-useless-switch-case': 2,
407
409
  'unicorn/prefer-array-flat': 2,
408
- // Its fix (applied by --fix-suggestions) is not equivalent: `re.test()` is stateful for /g
410
+ // Its suggested fix is not equivalent: `re.test()` is stateful for /g
409
411
  // and /y regexes, and `str.match(pattern)` with a string pattern becomes `pattern.test()`
410
412
  'unicorn/prefer-regexp-test': 0,
411
413
  'unicorn/throw-new-error': 2,
@@ -188,13 +188,7 @@ export function runOxlint(fix = true) {
188
188
  const oxlintPath = findPackageBinPath('oxlint', 'oxlint');
189
189
  exec2.spawn(oxlintPath, {
190
190
  name: ['oxlint', !fix && '--no-fix'].filter(Boolean).join(' '),
191
- args: [
192
- '--no-error-on-unmatched-pattern',
193
- '--disable-nested-config',
194
- fix && '--fix',
195
- fix && '--fix-suggestions',
196
- fix && '--fix-dangerously',
197
- ].filter(_isTruthy),
191
+ args: ['--no-error-on-unmatched-pattern', '--disable-nested-config', fix && '--fix'].filter(_isTruthy),
198
192
  shell: false,
199
193
  });
200
194
  return true;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/dev-lib",
3
3
  "type": "module",
4
- "version": "20.77.2",
4
+ "version": "20.79.0",
5
5
  "dependencies": {
6
6
  "prompts": "^2",
7
7
  "@naturalcycles/js-lib": "^15",