@himynameisdave/oxlint-config 1.2.0 → 2.1.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/README.md CHANGED
@@ -29,18 +29,21 @@ pnpm add -D oxlint @himynameisdave/oxlint-config
29
29
  yarn add -D oxlint @himynameisdave/oxlint-config
30
30
  ```
31
31
 
32
- - Requires `oxlint >=1.78.0 <2`. Why that range, and how it moves: [Versioning & compatibility](#versioning--compatibility).
32
+ - Requires `oxlint >=1.85.0 <2`. Why that range, and how it moves: [Versioning & compatibility](#versioning--compatibility).
33
33
  - Type-aware linting requires TypeScript 7+ and a `strict` tsconfig.
34
34
 
35
35
  ## Configurations
36
36
 
37
- | Config | Import | What it is |
38
- | ------------ | ------------------------------------------ | --------------------------------------------------------------------- |
39
- | `base` | `@himynameisdave/oxlint-config/base` | Core JS/TS rules. No framework assumptions. Start here. |
40
- | `svelte` | `@himynameisdave/oxlint-config/svelte` | Svelte 5 (runes) overrides for `.svelte`/`.svelte.ts` files. |
41
- | `type-aware` | `@himynameisdave/oxlint-config/type-aware` | Rules needing type info. Requires `oxlint-tsgolint` + `--type-aware`. |
42
- | `vitest` | `@himynameisdave/oxlint-config/vitest` | Test-suite rules for Vitest projects (`.only` in CI, etc). |
43
- | _(default)_ | `@himynameisdave/oxlint-config` | Kitchen sink: all of the above. |
37
+ | Config | Import | What it is |
38
+ | ------------ | ------------------------------------------ | ---------------------------------------------------------------------------- |
39
+ | `base` | `@himynameisdave/oxlint-config/base` | Core JS/TS rules. No framework assumptions. Start here. |
40
+ | `bun` | `@himynameisdave/oxlint-config/bun` | All rules from the pinned bunisms plugin, as errors. Bun-targeted code only. |
41
+ | `svelte` | `@himynameisdave/oxlint-config/svelte` | Svelte 5 (runes) overrides for `.svelte`/`.svelte.ts` files. |
42
+ | `type-aware` | `@himynameisdave/oxlint-config/type-aware` | Rules needing type info. Requires `oxlint-tsgolint` + `--type-aware`. |
43
+ | `vitest` | `@himynameisdave/oxlint-config/vitest` | Test-suite rules for Vitest projects (`.only` in CI, etc). |
44
+ | _(default)_ | `@himynameisdave/oxlint-config` | Kitchen sink for Bun projects: all of the above. |
45
+
46
+ The default assumes your code targets Bun. For Node or browser projects, compose the individual presets without `bun`.
44
47
 
45
48
  ## Usage
46
49
 
@@ -91,27 +94,48 @@ oxlint -c oxlint.config.ts --deny-warnings
91
94
 
92
95
  Version bumps describe what a release does to _your_ CI:
93
96
 
94
- - **major**: structural change to what this package _is_. An oxlint major bump, a new plugin enabled, an entry point renamed or removed.
95
- - **minor**: rule decisions. New rules decided (usually after an oxlint release adds them), an existing rule flipped between `error` and `off`, or options tightened. New errors can appear in code that passed before.
97
+ - **major**: structural change to what this package _is_. An oxlint major bump, a new plugin enabled in an existing preset, an entry point or public rule name renamed or removed, or an incompatible runtime requirement.
98
+ - **minor**: rule decisions. New rules decided (usually after an oxlint release adds them), an existing rule flipped between `error` and `off`, options tightened, or a plugin update changes lint findings. New errors can appear in code that passed before.
96
99
  - **patch**: docs, comments, tooling. No behavior change.
97
100
 
98
101
  Rule churn is deliberately _not_ a major bump. A newly-decided rule and a rule flipped from `off` to `error` break your build in exactly the same way, so pretending one is riskier than the other would just inflate the major number without telling you anything. New errors are the point of the package.
99
102
 
100
103
  `^` accepts new errors on update. Don't want that? Use `~` (patch only) with a committed lockfile, and upgrade deliberately.
101
104
 
102
- **Supported oxlint: `>=1.78.0 <2`.** The floor is the version this release's rule inventory was certified against, so it moves whenever new rules are decided. Older oxlint skips rules it doesn't know instead of erroring, which means a stale binary quietly under-lints. The `<2` ceiling is there because an oxlint 2.0 needs a release here anyway.
105
+ **Supported oxlint: `>=1.85.0 <2`.** The floor is the version this release's rule inventory was certified against, so it moves whenever new rules are decided. Older oxlint skips rules it doesn't know instead of erroring, which means a stale binary quietly under-lints. The `<2` ceiling is there because an oxlint 2.0 needs a release here anyway.
103
106
 
104
107
  **Type-aware assumes a strict tsconfig.** The `type-aware` config expects `"strict": true`, and does its best work with `"noUncheckedIndexedAccess"`. Without them, rules like `typescript/no-unnecessary-condition` both over- and under-report.
105
108
 
106
109
  **Plugins you add start off.** Every category is `"off"` by design, so adding `plugins: ['react']` to your own config enables zero react rules until you name each one. Surprising once, then greppable forever.
107
110
 
111
+ ## Bun support and upstream updates
112
+
113
+ The `bun` preset enables the reviewed rules from [`eslint-plugin-bunisms`](https://github.com/himynameisdave/eslint-plugin-bunisms) as errors. The plugin is bundled as a runtime dependency, so consumers only need this config and Oxlint. Use it for code targeting Bun >=1.4.0.
114
+
115
+ ```ts
116
+ import { defineConfig } from 'oxlint';
117
+ import base from '@himynameisdave/oxlint-config/base';
118
+ import bun from '@himynameisdave/oxlint-config/bun';
119
+
120
+ export default defineConfig({
121
+ extends: [base, bun],
122
+ rules: {
123
+ // Keep a Node-compatible subprocess call where the application needs one.
124
+ 'bun/prefer-bun-spawn': 'off'
125
+ }
126
+ });
127
+ ```
128
+
129
+ The rule set is reviewed and updated with this package; upstream updates may add new lint errors. For Node or browser projects, compose the other presets without `bun`.
130
+
108
131
  ## Enabled plugins
109
132
 
110
- `typescript` · `unicorn` · `oxc` · `import` · `promise` · `node` · `jsdoc` (plus the core `eslint` rules) · `vitest` (via the opt-in `vitest` add-on)
133
+ - Core: `eslint`, `typescript`, `unicorn`, `oxc`, `import`, `promise`, `node`, `jsdoc`
134
+ - Add-ons: `vitest`, `bun` (both included in the default config)
111
135
 
112
136
  The `vitest` stance: test suites deserve the same rigor as app code. The flagship rule is `no-focused-tests`: a committed `it.only` makes CI silently green while skipping every other test. The add-on's rules only fire on test-shaped syntax, so extending it is harmless for non-test files. **Not for `bun:test` suites:** oxlint recognizes test functions by import source (`vitest`, `@jest/globals`) or bare globals, and `import { it } from 'bun:test'` is invisible to it (verified empirically; see `src/vitest.ts`). Bun-native suites get no lint coverage until oxlint supports `bun:test` upstream.
113
137
 
114
- The `jsdoc` stance: exported symbols should be documented; internal code doesn't have to be. Any JSDoc you _do_ write must be complete and descriptive (a partial `@param` list or a bare `@returns` errors), and types never go in JSDoc (TypeScript owns them). oxlint has no `require-jsdoc` rule yet, so _existence_ of docs on exports stays a review expectation until upstream ships one (this config will adopt it with `publicOnly` when it lands).
138
+ The `jsdoc` stance: exported symbols should be documented; internal code doesn't have to be. Any JSDoc you _do_ write must be complete and descriptive (a partial `@param` list or a bare `@returns` errors), and types never go in JSDoc (TypeScript owns them). [oxfmt](https://oxc.rs/docs/guide/usage/formatter.html) handles comment formatting. oxlint has no `require-jsdoc` rule yet, so _existence_ of docs on exports stays a review expectation until upstream ships one (this config will adopt it with `publicOnly` when it lands).
115
139
 
116
140
  ## Svelte support
117
141
 
@@ -150,7 +174,7 @@ export default defineConfig({
150
174
  });
151
175
  ```
152
176
 
153
- `eslint/no-unused-labels` is _not_ in that list: as of oxlint 1.76 it doesn't fire inside `.svelte` files at all (it does in `.ts`). Add it if a future oxlint starts flagging `$:`.
177
+ `eslint/no-unused-labels` is _not_ in that list: as of oxlint 1.85 it doesn't fire inside `.svelte` files at all (it does in `.ts`). Add it if a future oxlint starts flagging `$:`.
154
178
 
155
179
  SvelteKit route files need no override. `unicorn/filename-case` skips the leading `+` and checks the rest, so `+page.svelte`, `+layout.server.ts` and friends all pass. Only genuinely bad casing after the `+` (`+Bad_Name.ts`) errors.
156
180
 
package/dist/base.d.ts CHANGED
@@ -169,7 +169,7 @@ declare const _default: {
169
169
  'eslint/no-ternary': "off";
170
170
  'eslint/no-useless-computed-key': "error";
171
171
  'eslint/object-shorthand': "error";
172
- 'eslint/one-var': ["error", string];
172
+ 'eslint/one-var': ["error", "never"];
173
173
  'eslint/operator-assignment': "error";
174
174
  'eslint/prefer-arrow-callback': "error";
175
175
  'eslint/prefer-const': "error";
package/dist/bun.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Bun-targeted code: every rule in the pinned bunisms version is an error.
3
+ * Resolve from this package so consumers need no separate plugin installation.
4
+ */
5
+ declare const _default: {
6
+ jsPlugins: {
7
+ name: string;
8
+ specifier: string;
9
+ }[];
10
+ rules: {
11
+ 'bun/prefer-bun-file': "error";
12
+ 'bun/prefer-bun-write': "error";
13
+ 'bun/prefer-bun-spawn': "error";
14
+ 'bun/prefer-bun-shell': "error";
15
+ 'bun/no-dotenv': "error";
16
+ 'bun/prefer-import-meta-dir': "error";
17
+ 'bun/prefer-import-meta-main': "error";
18
+ 'bun/prefer-import-meta-path': "error";
19
+ 'bun/prefer-bun-crypto-hasher': "error";
20
+ 'bun/prefer-fetch': "error";
21
+ 'bun/prefer-import-meta-resolve': "error";
22
+ 'bun/no-late-module-mock': "error";
23
+ };
24
+ };
25
+ export default _default;
package/dist/bun.js ADDED
@@ -0,0 +1,52 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ import { defineConfig } from 'oxlint';
3
+ /**
4
+ * Bun-targeted code: every rule in the pinned bunisms version is an error.
5
+ * Resolve from this package so consumers need no separate plugin installation.
6
+ */
7
+ export default defineConfig({
8
+ jsPlugins: [
9
+ {
10
+ name: 'bun',
11
+ specifier: fileURLToPath(import.meta.resolve('eslint-plugin-bunisms'))
12
+ }
13
+ ],
14
+ rules: {
15
+ // Bun.file keeps file reads on Bun's native file API.
16
+ // https://github.com/himynameisdave/eslint-plugin-bunisms/blob/main/docs/rules/prefer-bun-file.md
17
+ 'bun/prefer-bun-file': 'error',
18
+ // Bun.write provides the native write path for Bun-targeted applications.
19
+ // https://github.com/himynameisdave/eslint-plugin-bunisms/blob/main/docs/rules/prefer-bun-write.md
20
+ 'bun/prefer-bun-write': 'error',
21
+ // Bun's subprocess APIs integrate directly with its runtime and streams.
22
+ // https://github.com/himynameisdave/eslint-plugin-bunisms/blob/main/docs/rules/prefer-bun-spawn.md
23
+ 'bun/prefer-bun-spawn': 'error',
24
+ // Bun Shell is the cross-platform API for shell-oriented process execution.
25
+ // https://github.com/himynameisdave/eslint-plugin-bunisms/blob/main/docs/rules/prefer-bun-shell.md
26
+ 'bun/prefer-bun-shell': 'error',
27
+ // Bun loads environment files automatically, making dotenv redundant.
28
+ // https://github.com/himynameisdave/eslint-plugin-bunisms/blob/main/docs/rules/no-dotenv.md
29
+ 'bun/no-dotenv': 'error',
30
+ // Bun exposes the current module directory directly.
31
+ // https://github.com/himynameisdave/eslint-plugin-bunisms/blob/main/docs/rules/prefer-import-meta-dir.md
32
+ 'bun/prefer-import-meta-dir': 'error',
33
+ // Bun exposes an entrypoint check directly on import.meta.
34
+ // https://github.com/himynameisdave/eslint-plugin-bunisms/blob/main/docs/rules/prefer-import-meta-main.md
35
+ 'bun/prefer-import-meta-main': 'error',
36
+ // Bun exposes the current module path directly on import.meta.
37
+ // https://github.com/himynameisdave/eslint-plugin-bunisms/blob/main/docs/rules/prefer-import-meta-path.md
38
+ 'bun/prefer-import-meta-path': 'error',
39
+ // Bun's native CryptoHasher handles supported cryptographic digest chains.
40
+ // https://github.com/himynameisdave/eslint-plugin-bunisms/blob/main/docs/rules/prefer-bun-crypto-hasher.md
41
+ 'bun/prefer-bun-crypto-hasher': 'error',
42
+ // Fetch provides Bun's native promise-based HTTP client API.
43
+ // https://github.com/himynameisdave/eslint-plugin-bunisms/blob/main/docs/rules/prefer-fetch.md
44
+ 'bun/prefer-fetch': 'error',
45
+ // Bun ESM exposes module-relative resolution through import.meta.
46
+ // https://github.com/himynameisdave/eslint-plugin-bunisms/blob/main/docs/rules/prefer-import-meta-resolve.md
47
+ 'bun/prefer-import-meta-resolve': 'error',
48
+ // Static imports can run module side effects before a late Bun mock.
49
+ // https://github.com/himynameisdave/eslint-plugin-bunisms/blob/main/docs/rules/no-late-module-mock.md
50
+ 'bun/no-late-module-mock': 'error'
51
+ }
52
+ });
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  export { default as base } from './base.js';
2
+ export { default as bun } from './bun.js';
2
3
  export { default as svelte } from './svelte.js';
3
4
  export { default as typeAware } from './type-aware.js';
4
5
  export { default as vitest } from './vitest.js';
5
6
  /**
6
- * Kitchen sink: base + svelte + vitest + type-aware, in override-safe order.
7
+ * Kitchen sink for Bun: base + bun + svelte + vitest + type-aware, in override-safe order.
7
8
  * Requires `oxlint-tsgolint` installed (type-aware rules are on).
8
9
  *
9
10
  * For à la carte composition, extend the named exports instead:
@@ -172,7 +173,7 @@ declare const _default: {
172
173
  'eslint/no-ternary': "off";
173
174
  'eslint/no-useless-computed-key': "error";
174
175
  'eslint/object-shorthand': "error";
175
- 'eslint/one-var': ["error", string];
176
+ 'eslint/one-var': ["error", "never"];
176
177
  'eslint/operator-assignment': "error";
177
178
  'eslint/prefer-arrow-callback': "error";
178
179
  'eslint/prefer-const': "error";
@@ -557,6 +558,25 @@ declare const _default: {
557
558
  };
558
559
  })[];
559
560
  ignorePatterns: string[];
561
+ } | {
562
+ jsPlugins: {
563
+ name: string;
564
+ specifier: string;
565
+ }[];
566
+ rules: {
567
+ 'bun/prefer-bun-file': "error";
568
+ 'bun/prefer-bun-write': "error";
569
+ 'bun/prefer-bun-spawn': "error";
570
+ 'bun/prefer-bun-shell': "error";
571
+ 'bun/no-dotenv': "error";
572
+ 'bun/prefer-import-meta-dir': "error";
573
+ 'bun/prefer-import-meta-main': "error";
574
+ 'bun/prefer-import-meta-path': "error";
575
+ 'bun/prefer-bun-crypto-hasher': "error";
576
+ 'bun/prefer-fetch': "error";
577
+ 'bun/prefer-import-meta-resolve': "error";
578
+ 'bun/no-late-module-mock': "error";
579
+ };
560
580
  } | {
561
581
  overrides: {
562
582
  files: string[];
package/dist/index.js CHANGED
@@ -1,14 +1,16 @@
1
1
  import { defineConfig } from 'oxlint';
2
2
  import base from './base.js';
3
+ import bun from './bun.js';
3
4
  import svelte from './svelte.js';
4
5
  import typeAware from './type-aware.js';
5
6
  import vitest from './vitest.js';
6
7
  export { default as base } from './base.js';
8
+ export { default as bun } from './bun.js';
7
9
  export { default as svelte } from './svelte.js';
8
10
  export { default as typeAware } from './type-aware.js';
9
11
  export { default as vitest } from './vitest.js';
10
12
  /**
11
- * Kitchen sink: base + svelte + vitest + type-aware, in override-safe order.
13
+ * Kitchen sink for Bun: base + bun + svelte + vitest + type-aware, in override-safe order.
12
14
  * Requires `oxlint-tsgolint` installed (type-aware rules are on).
13
15
  *
14
16
  * For à la carte composition, extend the named exports instead:
@@ -19,5 +21,5 @@ export { default as vitest } from './vitest.js';
19
21
  * ```
20
22
  */
21
23
  export default defineConfig({
22
- extends: [base, svelte, vitest, typeAware]
24
+ extends: [base, bun, svelte, vitest, typeAware]
23
25
  });
@@ -22,7 +22,7 @@ export default defineConfig({
22
22
  // obj["key"] for a statically-known key is obj.key.
23
23
  'typescript/dot-notation': 'error',
24
24
  // NOTE: tsgolint also implements naming-convention and prefer-destructuring,
25
- // but oxlint 1.75 doesn't register those rule names yet — add them here once
25
+ // but oxlint 1.85 doesn't register those rule names yet — add them here once
26
26
  // they land upstream.
27
27
  // delete arr[i] leaves a hole, not a shorter array — splice/filter instead.
28
28
  'typescript/no-array-delete': 'error',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@himynameisdave/oxlint-config",
3
- "version": "1.2.0",
3
+ "version": "2.1.0",
4
4
  "description": "An opinionated oxlint config, by and for himynameisdave.",
5
5
  "keywords": [
6
6
  "config",
@@ -36,6 +36,10 @@
36
36
  "types": "./dist/base.d.ts",
37
37
  "default": "./dist/base.js"
38
38
  },
39
+ "./bun": {
40
+ "types": "./dist/bun.d.ts",
41
+ "default": "./dist/bun.js"
42
+ },
39
43
  "./svelte": {
40
44
  "types": "./dist/svelte.d.ts",
41
45
  "default": "./dist/svelte.js"
@@ -63,15 +67,19 @@
63
67
  "format:check": "oxfmt --check",
64
68
  "test": "bun run lint && bun run format:check && bun run check-coverage && bun run test:consumer"
65
69
  },
70
+ "dependencies": {
71
+ "eslint-plugin-bunisms": "0.10.0"
72
+ },
66
73
  "devDependencies": {
67
- "@types/bun": "^1.3.14",
68
- "oxfmt": "0.63.0",
69
- "oxlint": "1.78.0",
70
- "oxlint-tsgolint": "^7.0.2001",
74
+ "@types/bun": "^1.4.2",
75
+ "@types/node": "^26.1.1",
76
+ "oxfmt": "0.70.0",
77
+ "oxlint": "1.85.0",
78
+ "oxlint-tsgolint": "7.0.2003",
71
79
  "typescript": "^7.0.0"
72
80
  },
73
81
  "peerDependencies": {
74
- "oxlint": ">=1.78.0 <2",
82
+ "oxlint": ">=1.85.0 <2",
75
83
  "oxlint-tsgolint": ">=7.0.2001"
76
84
  },
77
85
  "peerDependenciesMeta": {
@@ -79,5 +87,5 @@
79
87
  "optional": true
80
88
  }
81
89
  },
82
- "packageManager": "bun@1.3.13"
90
+ "packageManager": "bun@1.4.2"
83
91
  }