@jabworks/oxlint-config 0.1.0 → 0.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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +35 -16
  3. package/package.json +7 -7
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025-present Vi Minh Hieu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @jabworks/oxlint-config
2
2
 
3
- Opinionated [oxlint](https://oxc.rs/docs/guide/usage/linter/) presets ported from [`@jabworks/eslint-plugin`](../eslint-plugin). Each preset is a complete, JSON-serializable `.oxlintrc` object.
3
+ Opinionated [oxlint](https://oxc.rs/docs/guide/usage/linter/) presets ported from [`@jabworks/eslint-plugin`](../eslint-plugin).
4
4
 
5
5
  ## Presets
6
6
 
@@ -10,28 +10,47 @@ Opinionated [oxlint](https://oxc.rs/docs/guide/usage/linter/) presets ported fro
10
10
  - `next` — react + nextjs plugin, default-export overrides for Next.js special files, ignores `.next/`
11
11
  - `vitest` — standalone test-file override preset
12
12
 
13
+ ## Installation
14
+
15
+ ```bash
16
+ npm install -D oxlint oxlint-tsgolint @jabworks/oxlint-config
17
+ ```
18
+
13
19
  ## Usage
14
20
 
15
- `.oxlintrc.json` cannot extend an npm package, so serialize a preset:
21
+ ```ts
22
+ // oxlint.config.ts
23
+ import { next } from '@jabworks/oxlint-config';
24
+ import { defineConfig } from 'oxlint';
16
25
 
17
- ```js
18
- // scripts/generate-oxlintrc.mjs
19
- import { config } from '@jabworks/oxlint-config';
20
- import { writeFileSync } from 'node:fs';
26
+ export default defineConfig({
27
+ extends: [next],
28
+ });
29
+ ```
21
30
 
22
- writeFileSync(
23
- '.oxlintrc.json',
24
- JSON.stringify({ $schema: './node_modules/oxlint/configuration_schema.json', ...config.configs.next }, null, 2),
25
- );
31
+ ```jsonc
32
+ // package.json
33
+ {
34
+ "scripts": {
35
+ "lint": "oxlint --type-aware --deny-warnings"
36
+ }
37
+ }
26
38
  ```
27
39
 
28
- Then lint with:
40
+ > **Note:** `oxlint.config.ts` requires Node.js v22.18+ or v24+.
29
41
 
30
- ```bash
31
- oxlint --type-aware --deny-warnings
32
- ```
42
+ To compose or override, use the exported `mergeConfigs` helper:
43
+
44
+ ```ts
45
+ import { mergeConfigs, typescript } from '@jabworks/oxlint-config';
46
+ import { defineConfig } from 'oxlint';
33
47
 
34
- You can also compose presets with the exported `mergeConfigs` helper.
48
+ const custom = mergeConfigs(typescript, {
49
+ rules: { 'no-console': 'warn' },
50
+ });
51
+
52
+ export default defineConfig({ extends: [custom] });
53
+ ```
35
54
 
36
55
  ## Type-aware rules
37
56
 
@@ -39,7 +58,7 @@ The typescript preset enables type-aware rules (`typescript/no-misused-promises`
39
58
 
40
59
  ## Rules not ported from @jabworks/eslint-plugin
41
60
 
42
- Unsupported by oxlint 1.58 (verified with `oxlint --rules` and `@oxlint/migrate --details`):
61
+ Unsupported by oxlint 1.69 (verified with `oxlint --rules` and `@oxlint/migrate --details`):
43
62
 
44
63
  - Core: `no-floating-decimal`, `no-implied-eval`, `no-octal-escape`, `prefer-regex-literals`, `object-shorthand`, `no-unreachable-loop`, `camelcase`, `prefer-arrow-callback`, `no-undef-init`
45
64
  - Import: `newline-after-import`, `no-extraneous-dependencies`, `no-relative-packages`, `no-useless-path-segments`, `no-deprecated`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jabworks/oxlint-config",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
5
  "description": "Opinionated oxlint presets for JS, TS, React, Next.js, and Vitest, ported from @jabworks/eslint-plugin",
6
6
  "keywords": [
@@ -34,19 +34,19 @@
34
34
  "files": [
35
35
  "dist"
36
36
  ],
37
- "scripts": {
38
- "build": "tsdown"
39
- },
40
37
  "devDependencies": {
41
- "@jabworks/typescript-config": "workspace:*",
42
38
  "oxlint": "^1.69.0",
43
39
  "tsdown": "^0.21.7",
44
- "typescript": "^6.0.2"
40
+ "typescript": "^6.0.2",
41
+ "@jabworks/typescript-config": "0.0.0"
45
42
  },
46
43
  "peerDependencies": {
47
44
  "oxlint": ">=1.69.0"
48
45
  },
49
46
  "publishConfig": {
50
47
  "access": "public"
48
+ },
49
+ "scripts": {
50
+ "build": "tsdown"
51
51
  }
52
- }
52
+ }