@wistia/oxlint-config 0.8.0 → 0.8.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.
- package/README.md +17 -1
- package/package.json +1 -1
- package/rules/base.mjs +2 -0
- package/rules/import.mjs +2 -21
package/README.md
CHANGED
|
@@ -163,4 +163,20 @@ export default defineConfig({
|
|
|
163
163
|
|
|
164
164
|
## ESLint parity
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
Differences between `@wistia/oxlint-config` and `@wistia/eslint-config`.
|
|
167
|
+
|
|
168
|
+
oxlint and ESLint use different rule name prefixes. This document uses the eslint-config names. See [Rule Name Mapping](#rule-name-mapping) at the bottom for prefix translations.
|
|
169
|
+
|
|
170
|
+
### Why some rules are ESLint-only
|
|
171
|
+
|
|
172
|
+
oxlint's jsPlugins feature can load ESLint plugins that export a standard `{ rules }` object. This works for packages like `eslint-plugin-import-x`, `eslint-plugin-storybook`, etc.
|
|
173
|
+
|
|
174
|
+
Several categories of rules cannot use this approach:
|
|
175
|
+
|
|
176
|
+
1. **Core ESLint rules** (e.g. `no-restricted-globals`, `camelcase`, `object-shorthand`). These are built into the `eslint` package, not exported as a plugin with a `{ rules }` object. `@eslint/js` only exports configs, not rules. There is no standalone ESLint plugin that re-exports core rules in the format oxlint's jsPlugins expect.
|
|
177
|
+
|
|
178
|
+
2. **Rules requiring ESLint parser services** (e.g. `@eslint-react/*`, `@typescript-eslint/*`). These call `getParserServices()` from `@typescript-eslint/utils` internally, which requires ESLint's parser infrastructure. oxlint's jsPlugin runner does not provide this.
|
|
179
|
+
|
|
180
|
+
3. **Rules requiring module resolution** (e.g. `import-x/no-unresolved`, `import-x/extensions`, `import-x/no-rename-default`). In ESLint, these rules use `eslint-import-resolver-typescript` to resolve TypeScript path aliases, barrel re-exports, and extensionless imports. The resolver is configured via ESLint's `settings['import-x/resolver']` — but oxlint's jsPlugin runner does not pass ESLint settings to plugins. Without a resolver, these rules can't find modules and produce thousands of false positives on every import.
|
|
181
|
+
|
|
182
|
+
4. **Old-style ESLint plugins** (e.g. `eslint-plugin-filenames`). These export rules as plain functions instead of objects with a `create` method. oxlint's jsPlugin runner requires the modern format (`{ meta, create }`).
|
package/package.json
CHANGED
package/rules/base.mjs
CHANGED
|
@@ -325,6 +325,8 @@ export const baseRules = {
|
|
|
325
325
|
|
|
326
326
|
// Disallow the use of console
|
|
327
327
|
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-console.html
|
|
328
|
+
// Decision: allow console methods that are commonly used for logging and error reporting,
|
|
329
|
+
// but disallow others that are often left in accidentally
|
|
328
330
|
'eslint/no-console': ['error', { allow: ['log', 'warn', 'error'] }],
|
|
329
331
|
|
|
330
332
|
// Disallow continue statements
|
package/rules/import.mjs
CHANGED
|
@@ -175,27 +175,8 @@ export const importRules = {
|
|
|
175
175
|
|
|
176
176
|
// Forbid the use of extraneous packages
|
|
177
177
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-extraneous-dependencies.md
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
{
|
|
181
|
-
devDependencies: [
|
|
182
|
-
'**/*{.,_}{test,vitest,spec,stories}.{js,jsx,ts,tsx}',
|
|
183
|
-
'**/oxfmt.config.*',
|
|
184
|
-
'**/.oxfmtrc.json*',
|
|
185
|
-
'**/vite.config.{ts,js,cjs,mjs,mts}',
|
|
186
|
-
'**/vitest.config.{ts,js,cjs,mjs,mts}',
|
|
187
|
-
'**/eslint.config.{js,cjs,mjs,mts}',
|
|
188
|
-
'**/.eslintrc.{js,cjs}',
|
|
189
|
-
'**/.stylelintrc.{cjs,js,json,yaml,yml}',
|
|
190
|
-
'**/stylelint.config.{cjs,mjs,mts,js}',
|
|
191
|
-
'**/esbuild.config.{js,cjs,mjs,mts}',
|
|
192
|
-
'**/tsup.config.{js,cjs,mjs,mts}',
|
|
193
|
-
'**/rollup.config.{js,cjs,mjs,mts}',
|
|
194
|
-
'**/rollup.config.*.{js,cjs,mjs,mts}',
|
|
195
|
-
],
|
|
196
|
-
optionalDependencies: false,
|
|
197
|
-
},
|
|
198
|
-
],
|
|
178
|
+
// Decision: this is better handled by knip
|
|
179
|
+
'import-x-js/no-extraneous-dependencies': 'off',
|
|
199
180
|
|
|
200
181
|
// Reports if a default export is renamed during import
|
|
201
182
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-rename-default.md
|