@wistia/oxlint-config 0.9.0 → 0.9.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/rules/unicorn.mjs +18 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wistia/oxlint-config",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "Wistia's Oxlint configurations",
5
5
  "packageManager": "yarn@4.14.1",
6
6
  "type": "module",
package/rules/unicorn.mjs CHANGED
@@ -61,7 +61,18 @@ export const unicornRules = {
61
61
 
62
62
  // Enforce specific import styles per module
63
63
  // https://oxc.rs/docs/guide/usage/linter/rules/unicorn/import-style.html
64
- 'unicorn/import-style': 'error',
64
+ // Override built-in defaults: this rule ships preferring default imports
65
+ // for `chalk`, `path`, and `node:path`. We require named imports instead.
66
+ 'unicorn/import-style': [
67
+ 'error',
68
+ {
69
+ styles: {
70
+ 'node:path': { named: true, default: false },
71
+ path: { named: true, default: false },
72
+ chalk: { named: true, default: false },
73
+ },
74
+ },
75
+ ],
65
76
 
66
77
  // Require `new` when creating an object using a built-in constructor
67
78
  // https://oxc.rs/docs/guide/usage/linter/rules/unicorn/new-for-builtins.html
@@ -278,7 +289,10 @@ export const unicornRules = {
278
289
 
279
290
  // Disallow useless `case` in `switch` statements
280
291
  // https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-useless-switch-case.html
281
- 'unicorn/no-useless-switch-case': 'error',
292
+ // Decision: an empty `case` listed alongside `default` documents that the
293
+ // value is a known, expected input rather than an unhandled fallthrough,
294
+ // which is useful for exhaustive switches over discriminated unions.
295
+ 'unicorn/no-useless-switch-case': 'off',
282
296
 
283
297
  // Disallow explicit `undefined` arguments and default parameter values
284
298
  // https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-useless-undefined.html
@@ -379,7 +393,8 @@ export const unicornRules = {
379
393
 
380
394
  // Prefer `globalThis` over `window` / `self` / `global`
381
395
  // https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-global-this.html
382
- 'unicorn/prefer-global-this': 'error',
396
+ // Decision: we should consider enabling this in the future but it will involve a lot of refactoring
397
+ 'unicorn/prefer-global-this': 'off',
383
398
 
384
399
  // Prefer `import.meta.{dirname,filename}` over CJS-equivalent constructions
385
400
  // https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-import-meta-properties.html