@studiometa/oxlint-config
v0.2.0
Published
Shared oxlint configuration for Studio Meta projects
Maintainers
Readme
@studiometa/oxlint-config
Shared oxlint configuration for Studio Meta projects.
Mirrors the rules from @studiometa/eslint-config where oxlint supports them. Use it as a fast complement or replacement for ESLint.
Installation
npm install -D @studiometa/oxlint-config oxlintUsage
Create an oxlintrc.json file at the root of your project:
{
"extends": ["./node_modules/@studiometa/oxlint-config/oxlintrc.json"]
}Then run oxlint:
npx oxlintOverride rules
Add or override rules in your project config:
{
"extends": ["./node_modules/@studiometa/oxlint-config/oxlintrc.json"],
"rules": {
"no-console": "off"
}
}What's included
Categories
| Category | Level | Description |
|----------|-------|-------------|
| correctness | error | Code that is outright wrong or useless |
| suspicious | warn | Code that is most likely wrong or useless |
Plugins
- unicorn — Modern JavaScript best practices
- jsdoc — JSDoc comment validation
Rules
Best practices (from @studiometa/eslint-config):
curly: Require braces for all control statementseqeqeq: Require strict equality operatorsno-alert,no-eval: Disallow unsafe browser APIsno-empty-function: Disallow empty function bodiesno-var: Requireletorconstvars-on-top: Require variable declarations at the top of scopeyoda: Disallow Yoda conditions
JSDoc (matching eslint-plugin-jsdoc rules):
require-param,require-param-name,require-param-typerequire-returns,require-returns-typerequire-property,require-property-name,require-property-typecheck-property-names,check-tag-names
Unicorn (matching eslint-plugin-unicorn rules):
- Prefer modern DOM APIs (
querySelector,append,remove, etc.) - Prefer modern array methods (
find,flat,flatMap,some,includes) - Prefer modern string methods (
replaceAll,slice,startsWith,endsWith) - Disallow common anti-patterns (
instanceof Array,document.cookie, etc.)
Rules not available in oxlint
The following @studiometa/eslint-config rules have no oxlint equivalent and require ESLint:
dot-notation,no-implicit-coercion,no-implicit-globals,no-multi-spacesno-param-reassign,no-useless-return,object-shorthandprefer-const,prefer-template,strict,wrap-iifeunicorn/no-array-push-push,unicorn/prefer-at,unicorn/prefer-default-parametersunicorn/prefer-keyboard-event-key- Most
jsdoc/*formatting rules (check-alignment,multiline-blocks,no-multi-asterisks, etc.)
See oxlintrc.json for the complete rule list.
License
MIT © Studio Meta
