@standard-config/oxlint 1.8.0 → 2.0.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
@@ -1,12 +1,42 @@
1
- [![](https://img.shields.io/npm/v/%40standard-config%2Foxlint)](https://www.npmjs.com/package/@standard-config/oxlint) [![](https://img.shields.io/github/actions/workflow/status/standard-config/oxlint/test.yaml)](https://github.com/standard-config/oxlint/actions/workflows/test.yaml) [![](https://img.shields.io/codecov/c/github/standard-config/oxlint)](https://codecov.io/github/standard-config/oxlint)
2
-
3
- # @standard-config/oxlint
4
-
5
- Curated Oxlint config with sensible defaults. Designed as a careful, environment-agnostic baseline for writing better TypeScript.
6
-
7
- - If you’re adopting Oxlint, this config will get you started right away.
8
- - If you’re migrating from [**xo**](https://github.com/xojs/xo), you’ll feel right at home.
9
- - For additional rules not yet implemented in Oxlint, see [**@standard-config/eslint**](https://github.com/standard-config/eslint).
1
+ <p align="center">
2
+ <a href="https://github.com/standard-config/oxlint">
3
+ <img
4
+ src="https://github.com/standard-config/.github/blob/main/.github/assets/standard-config-oxlint@3x.png?raw=true"
5
+ width="500"
6
+ alt=""
7
+ />
8
+ </a>
9
+ </p>
10
+
11
+ <h1 align="center">@standard&#8209;config/oxlint</h1>
12
+
13
+ <p align="center">Curated Oxlint config with sensible&nbsp;defaults.</p>
14
+
15
+ <p align="center">
16
+ <a href="https://npmx.dev/package/@standard-config/oxlint"
17
+ ><img
18
+ src="https://img.shields.io/npm/v/%40standard-config%2Foxlint?style=flat-square"
19
+ alt=""
20
+ /></a>
21
+ <a href="https://github.com/standard-config/oxlint/actions/workflows/test.yaml"
22
+ ><img
23
+ src="https://img.shields.io/github/actions/workflow/status/standard-config/oxlint/test.yaml?style=flat-square"
24
+ alt=""
25
+ /></a>
26
+ <a href="https://codecov.io/github/standard-config/oxlint"
27
+ ><img
28
+ src="https://img.shields.io/codecov/c/github/standard-config/oxlint?style=flat-square"
29
+ alt=""
30
+ /></a>
31
+ </p>
32
+
33
+ <div>&nbsp;</div>
34
+
35
+ ## Overview
36
+
37
+ Curated Oxlint config with sensible defaults. Designed as a careful, environment-agnostic baseline for writing better TypeScript. Comes with [supplemental configs](#supplemental-configs) that extend the core ruleset.
38
+
39
+ If you’re migrating from [**xo**](https://github.com/xojs/xo), you’ll feel right at home.
10
40
 
11
41
  ## Install
12
42
 
@@ -18,7 +48,7 @@ npm install --save-dev @standard-config/oxlint
18
48
  pnpm add --save-dev @standard-config/oxlint
19
49
  ```
20
50
 
21
- For [type-aware linting](https://oxc.rs/docs/guide/usage/linter/type-aware.html), make sure both `oxlint` and `oxlint-tsgolint` are installed.
51
+ For [type-aware linting](https://oxc.rs/docs/guide/usage/linter/type-aware.html), make sure `oxlint` and `oxlint-tsgolint` are both installed.
22
52
 
23
53
  ## Usage
24
54
 
@@ -44,20 +74,86 @@ export default defineConfig({
44
74
  });
45
75
  ```
46
76
 
47
- ### React
77
+ ### Supplemental Configs
78
+
79
+ While **@standard-config/oxlint** relies only on Oxlint’s core rules, the supplemental config packages extend the baseline rule coverage with additional plugins, including [JS plugins](https://oxc.rs/docs/guide/usage/linter/js-plugins.html).
80
+
81
+ <table>
82
+ <thead>
83
+ <tr>
84
+ <th
85
+ align="left"
86
+ width="450"
87
+ >
88
+ Package
89
+ </th>
90
+ <th
91
+ align="left"
92
+ width="300"
93
+ >
94
+ Core Plugins
95
+ </th>
96
+ <th
97
+ align="left"
98
+ width="300"
99
+ >
100
+ JS Plugins
101
+ </th>
102
+ </tr>
103
+ </thead>
104
+ <tbody>
105
+ <tr>
106
+ <th align="left">
107
+ <a href="https://github.com/standard-config/oxlint/tree/main/packages/oxlint-react">@standard&#8209;config/oxlint&#8209;react</a>
108
+ </th>
109
+ <td>
110
+ <code>react</code>
111
+ <br />
112
+ <code>react&#8209;perf</code>
113
+ <br />
114
+ <code>jsx&#8209;a11y</code>
115
+ </td>
116
+ <td>
117
+ <a href="https://eslint-react.xyz"><code>react&#8209;x</code></a>
118
+ </td>
119
+ </tr>
120
+ <tr>
121
+ <th align="left">
122
+ <a href="https://github.com/standard-config/oxlint/tree/main/packages/oxlint-stylistic">@standard&#8209;config/oxlint&#8209;stylistic</a>
123
+ </th>
124
+ <td>—</td>
125
+ <td>
126
+ <a href="https://eslint.style"><code>stylistic</code></a>
127
+ <br />
128
+ <a href="https://perfectionist.dev"><code>perfectionist</code></a>
129
+ </td>
130
+ </tr>
131
+ </tbody>
132
+ </table>
133
+
134
+ ## FAQ
135
+
136
+ ### Does this config require any specific TypeScript configuration?
48
137
 
49
- Standard Config includes a set of React-related rules that are off by default. You can enable them by setting `react: true` at the root of your config.
138
+ No, it works with any `tsconfig.json`. For matching compiler defaults, pair it with [**@standard-config/tsconfig**](https://github.com/standard-config/tsconfig), though it is not required.
139
+
140
+ ### Does this config enable any rule categories?
141
+
142
+ No. The config explicitly defines every enabled and disabled rule for each core plugin used. Any [`categories`](https://oxc.rs/docs/guide/usage/linter/config-file-reference.html#categories) you set will only apply to the plugins you enable.
50
143
 
51
144
  ```ts
52
145
  import { defineConfig } from '@standard-config/oxlint';
53
146
 
54
147
  export default defineConfig({
55
- react: true,
148
+ plugins: ['nextjs'],
149
+ categories: {
150
+ // Only applies to `next/*` rules
151
+ correctness: 'error',
152
+ suspicious: 'warn',
153
+ },
56
154
  });
57
155
  ```
58
156
 
59
- ## FAQ
60
-
61
157
  ### Can I use this config with Vite+?
62
158
 
63
159
  Absolutely. In your `vite.config.ts`:
@@ -68,9 +164,8 @@ import { defineConfig } from 'vite-plus';
68
164
 
69
165
  export default defineConfig({
70
166
  lint: defineOxlintConfig({
71
- react: true,
72
167
  rules: {
73
- /* Optional overrides */
168
+ // Optional overrides
74
169
  },
75
170
  }),
76
171
  });
@@ -78,7 +173,6 @@ export default defineConfig({
78
173
 
79
174
  ## Related
80
175
 
81
- - [**@standard-config/eslint**](https://github.com/standard-config/eslint)
82
176
  - [**@standard-config/prettier**](https://github.com/standard-config/prettier)
83
177
  - [**@standard-config/tsconfig**](https://github.com/standard-config/tsconfig)
84
178
 
package/dist/index.d.mts CHANGED
@@ -1,39 +1,77 @@
1
- import { OxlintConfig, OxlintOverride } from "oxlint";
1
+ import { ExternalPluginEntry, OxlintConfig, OxlintOverride } from "oxlint";
2
2
 
3
3
  //#region ../utilities/src/types/index.d.ts
4
- type LinterConfigEntry = Omit<OxlintConfig, 'files' | 'ignorePatterns' | 'overrides'>;
5
- type LinterConfigOverrideEntry = Omit<OxlintOverride, 'files'>;
6
- type StandardConfig = OxlintConfig & {
7
- /**
8
- * Enable React-specific rules.
9
- * @default false
10
- */
11
- react?: boolean;
12
- };
4
+ type OxlintConfigBaseEntry = Omit<OxlintConfig, 'categories' | 'files' | 'ignorePatterns' | 'overrides'>;
5
+ type OxlintConfigCoreBaseEntry = Omit<OxlintConfigBaseEntry, 'jsPlugins'>;
6
+ type OxlintConfigOverrideEntry = Omit<OxlintOverride, 'categories' | 'files' | 'jsPlugins' | 'plugins'>;
7
+ type OxlintConfigPluginEntry = Exclude<ExternalPluginEntry, string>;
13
8
  //#endregion
14
9
  //#region src/config-base/index.d.ts
15
- declare const config: LinterConfigEntry;
10
+ /**
11
+ * Base config entry containing core rules. No overrides included.
12
+ */
13
+ declare const config: OxlintConfigCoreBaseEntry;
16
14
  //#endregion
17
15
  //#region src/config-config-files/index.d.ts
18
- declare const config$1: LinterConfigOverrideEntry;
16
+ /**
17
+ * Optional config entry containing core rules that target config files.
18
+ * Intended for explicit overrides.
19
+ */
20
+ declare const config$1: OxlintConfigOverrideEntry;
21
+ //#endregion
22
+ //#region src/config-default/index.d.ts
23
+ /**
24
+ * Resolved Standard Config core entry.
25
+ */
26
+ declare const config$4: OxlintConfig;
19
27
  //#endregion
20
28
  //#region src/config-test-files/index.d.ts
21
- declare const config$3: LinterConfigOverrideEntry;
29
+ /**
30
+ * Optional config entry containing core rules that target test files. Intended
31
+ * for explicit overrides.
32
+ */
33
+ declare const config$2: OxlintConfigOverrideEntry;
22
34
  //#endregion
23
35
  //#region src/config-type-definitions/index.d.ts
24
- declare const config$4: LinterConfigOverrideEntry;
36
+ /**
37
+ * Optional config entry containing core rules that target type definition
38
+ * files. Intended for explicit overrides.
39
+ */
40
+ declare const config$3: OxlintConfigOverrideEntry;
25
41
  //#endregion
26
42
  //#region src/define-config/index.d.ts
27
- declare function defineConfig(...configs: StandardConfig[]): OxlintConfig;
43
+ declare function defineConfig(...configs: OxlintConfig[]): OxlintConfig;
28
44
  //#endregion
29
45
  //#region src/define-oxlint-config/index.d.ts
30
46
  /**
31
47
  * Alias for `defineConfig`.
32
48
  */
33
- declare function defineOxlintConfig(...configs: StandardConfig[]): OxlintConfig;
49
+ declare function defineOxlintConfig(...configs: OxlintConfig[]): OxlintConfig;
34
50
  //#endregion
35
- //#region ../oxlint-react/src/config-base/index.d.ts
36
- declare const config$2: LinterConfigOverrideEntry;
51
+ //#region ../utilities/src/resolve-plugin/index.d.ts
52
+ /**
53
+ * Resolve an external plugin specifier to a file path.
54
+ *
55
+ * @example
56
+ *
57
+ * ```ts
58
+ * import { resolvePlugin } from '@standard-config/oxlint';
59
+ * import { defineConfig } from 'oxlint';
60
+ *
61
+ * const config = defineConfig({
62
+ * jsPlugins: [
63
+ * resolvePlugin(
64
+ * 'react-x',
65
+ * '@eslint-react/eslint-plugin',
66
+ * ),
67
+ * ],
68
+ * rules: {
69
+ * 'react-x/refs': 'error',
70
+ * },
71
+ * });
72
+ * ```
73
+ */
74
+ declare function resolvePlugin(name: string, specifier: string): OxlintConfigPluginEntry;
37
75
  //#endregion
38
- export { config as configBase, config$1 as configConfigFiles, config$2 as configReact, config$3 as configTestFiles, config$4 as configTypeDefinitions, defineConfig, defineOxlintConfig };
76
+ export { config as configCoreBase, config$1 as configCoreConfigFiles, config$2 as configCoreTestFiles, config$3 as configCoreTypeDefinitions, config$4 as default, defineConfig, defineOxlintConfig, resolvePlugin };
39
77
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":["OxlintConfig","OxlintOverride","LinterConfigEntry","Omit","LinterConfigOverrideEntry","StandardConfig","react"],"sources":["../../utilities/src/types/index.d.ts","../src/config-base/index.ts","../src/config-config-files/index.ts","../src/config-test-files/index.ts","../src/config-type-definitions/index.ts","../src/define-config/index.ts","../src/define-oxlint-config/index.ts","../../oxlint-react/src/config-base/index.ts"],"mappings":";;;KAEYE,iBAAAA,GAAoBC,IAAAA,CAC/BH,YAAAA;AAAAA,KAIWI,yBAAAA,GAA4BD,IAAAA,CAAKF,cAAAA;AAAAA,KAEjCI,cAAAA,GAAiBL,YAAAA;;;;AAA7B;EAKCM,KAAAA;AAAAA;;;cCZK,MAAA,EAAQ,iBAAA;;;cCAR,QAAA,EAAQ,yBAAA;;;cCER,QAAA,EAAQ,yBAAA;;;cCFR,QAAA,EAAQ,yBAAA;;;iBCQU,YAAA,CAAA,GACpB,OAAA,EAAS,cAAA,KACV,YAAA;;;;ALVH;;iBMKwB,kBAAA,CAAA,GACpB,OAAA,EAAS,cAAA,KACV,YAAA;;;cCPG,QAAA,EAAQ,yBAAA"}
1
+ {"version":3,"file":"index.d.mts","names":["ExternalPluginEntry","OxlintConfig","OxlintOverride","OxlintConfigBaseEntry","Omit","OxlintConfigCoreBaseEntry","OxlintConfigOverrideEntry","OxlintConfigGlobSet","OxlintConfigPluginEntry","Exclude"],"sources":["../../utilities/src/types/index.d.ts","../src/config-base/index.ts","../src/config-config-files/index.ts","../src/config-default/index.ts","../src/config-test-files/index.ts","../src/config-type-definitions/index.ts","../src/define-config/index.ts","../src/define-oxlint-config/index.ts","../../utilities/src/resolve-plugin/index.ts"],"mappings":";;;KAEYG,qBAAAA,GAAwBC,IAAI,CACvCH,YAAAA;AAAAA,KAIWI,yBAAAA,GAA4BD,IAAI,CAC3CD,qBAAAA;AAAAA,KAIWG,yBAAAA,GAA4BF,IAAI,CAC3CF,cAAAA;AAAAA,KAMWM,uBAAAA,GAA0BC,OAAO,CAACT,mBAAAA;;;;;AAjB9C;cCGM,MAAA,EAAQ,yBA4vBb;;;;;AD/vBD;;cEIM,QAAA,EAAQ,yBAQb;;;;;AFZD;cGaM,QAAA,EAAQ,YAeZ;;;;;AH5BF;;cIIM,QAAA,EAAQ,yBAsIb;;;;;AJ1ID;;cKIM,QAAA,EAAQ,yBAWb;;;iBCQuB,YAAA,CAAA,GAAgB,OAAA,EAAS,YAAA,KAAiB,YAAY;;;;;ANvB9E;iBOIwB,kBAAA,CAAA,GACpB,OAAA,EAAS,YAAA,KACV,YAAY;;;;;APNf;;;;AACa;AAIb;;;;AACsB;AAItB;;;;AACe;AAMf;;;;AAAiE;iBQMzC,aAAA,CACvB,IAAA,UACA,SAAA,WACE,uBAAuB"}