oxlint-config-standard
v0.1.1
Published
Shareable oxlint config based on standard / neostandard
Maintainers
Readme
oxlint-config-standard
Shareable oxlint configuration based on neostandard.
Overview
This package provides an .oxlintrc.json configuration file that approximates the neostandard ESLint configuration as closely as possible for oxlint. Since oxlint focuses on linting (not formatting), this configuration includes only the linting rules from neostandard.
Installation
npm install --save-dev oxlint-config-standard oxlintUsage
Create a .oxlintrc.json in your project root:
{
"extends": ["./node_modules/oxlint-config-standard/.oxlintrc.json"]
}Note: Unlike ESLint, oxlint's
extendsfield requires an explicit file path (only.jsonformat is supported). You cannot use npm package names like"oxlint-config-standard"directly.
What's Included
This configuration maps the following neostandard rule categories to oxlint:
Core ESLint Rules
- Correctness rules: Rules that catch outright wrong or useless code (e.g.,
no-debugger,no-const-assign) - Best practices: Rules for idiomatic patterns (e.g.,
eqeqeq,curly,no-eval) - Modernization:
no-varset to "warn" (matches neostandard's modernization config) - Suspicious patterns: Rules for likely wrong code (e.g.,
no-extend-native,no-extra-bind)
Plugin Rules
- Import rules: Module import/export rules (e.g.,
import/first,import/no-duplicates) - Node.js rules: Node-specific rules (e.g.,
node/no-new-require) - Promise rules: Promise best practices (e.g.,
promise/param-names) - React/JSX rules: React and JSX rules (e.g.,
react/jsx-key,react/no-children-prop)
What's NOT Included
Stylistic/Formatting Rules
Oxlint focuses on linting, not formatting. The following neostandard rules are not included because they're formatting-related:
- All
@stylistic/*rules (indentation, spacing, quotes, semicolons, etc.) - Use oxfmt, Prettier, or Biome for formatting
Unsupported Rules
Some neostandard rules don't have oxlint equivalents (~21 linting rules total):
Core ESLint Rules (13 rules):
camelcase- Naming convention enforcementobject-shorthand- ES6 object literal shorthanddot-notation- Available but turned OFF in neostandard modernization configno-dupe-args- Duplicate function parameters (covered by parser)no-octal- Octal literalsno-octal-escape- Octal escape sequencesno-undef-init- Initializing to undefinedno-unmodified-loop-condition- Loop conditions that never changeno-unreachable-loop- Unreachable loop detectionno-use-before-define- Variable hoisting issuesone-var- Variable declaration styleprefer-const- Const over let preferenceprefer-regex-literals- Regex literal notation
Node.js Plugin Rules (5 rules):
n/handle-callback-err- Callback error handlingn/no-callback-literal- Callback literal checksn/no-deprecated-api- Deprecated Node.js APIs (set to 'warn' in modernization)n/no-path-concat- Path concatenation with **dirname/**filenamen/process-exit-as-throw- Treat process.exit() as throw
React Plugin Rules (3 rules):
react/jsx-uses-react- Not needed in React 17+ with new JSX transformreact/jsx-uses-vars- Variable usage tracking in JSXreact/no-deprecated- Deprecated React APIs
Import Plugin Rules:
import-x/export- Export validation- Some other advanced import-x rules
Note: The above count excludes 60+ @stylistic/* formatting rules which are intentionally not supported.
Environment & Globals
The configuration sets:
- Environment: ES2022 + Node.js
- Globals:
document,navigator,window(readonly)
This matches neostandard's default environment configuration.
Note: Like neostandard, this configuration includes both Node.js and browser globals in a single config. This means:
- Browser globals (
document,navigator,window) are available even in Node.js code - Node.js rules are active even in browser code
This is the same approach used by neostandard (which includes a // TODO: Should only be active for server side scripts comment). While not ideal for strictly typed environments, it works for most isomorphic JavaScript projects.
Future versions may include separate configs for Node.js-only, browser-only, and isomorphic SSR code.
Differences from neostandard
- No formatting rules: Use a separate formatter for code style
- Fewer plugin rules: Some neostandard plugin rules aren't available in oxlint yet
- React rules included by default: The JSX/React rules are included (you can disable them if not needed)
- No TypeScript-specific config: Oxlint handles TypeScript automatically
Rule Count
This configuration enables 132 rules total.
Neostandard's linting rules (excluding formatting):
- 110 base rules (from
base.js) - 21 React rules (from
jsx.js) - Total: 131 linting rules
Our coverage:
- We implement 110 of neostandard's 131 linting rules (84% coverage)
- We're missing 21 unsupported rules (listed above)
- We have 132 total rules because setting
"categories": { "correctness": "error" }enables 22 additional correctness rules from oxlint that aren't explicitly in neostandard's config
Result: This config is actually stricter than neostandard in some areas (more correctness rules), while missing some rules due to oxlint limitations.
Excluded from count: Neostandard also has ~74 formatting rules (@stylistic/*) which are intentionally not included since oxlint focuses on linting, not formatting.
Testing
Run oxlint with this configuration:
npx oxlint .Performance
Oxlint is significantly faster than ESLint (typically 50-100x faster) because it's written in Rust. This makes it ideal for large codebases and CI/CD pipelines.
Contributing
If you find rules that should be added or adjusted, please open an issue or PR.
License
MIT
