oxlint-config-satya164
v0.1.2
Published
Personal Oxlint Config of @satya164
Readme
oxlint-config-satya164
This is my personal Oxlint config. I try to avoid rules which are purely stylistic and based on personal opinions. I'm trying to keep it non-intrusive and aimed towards catching actual errors.
Features
The config includes these plugins:
The config uses the overrides feature of oxlint to automatically adjust the config based on the filename. For example, TypeScript support is enabled for .ts and .tsx files, stricter rules are enabled for test files and more.
Usage
First, install the required packages:
npm install --save-dev oxlint oxlint-config-satya164Now create an oxlint.config.mts in your project root and extend the configs you need:
import { defineConfig } from 'oxlint';
import react from 'oxlint-config-satya164/react';
import recommended from 'oxlint-config-satya164/recommended';
export default defineConfig({
extends: [recommended, react],
});You can also enable type-aware rules:
import { defineConfig } from 'oxlint';
import recommended from 'oxlint-config-satya164/recommended';
import typechecked from 'oxlint-config-satya164/typechecked';
export default defineConfig({
extends: [recommended, typechecked],
});Type-aware rules require oxlint-tsgolint:
npm install --save-dev oxlint-tsgolintAvailable configs
recommended— Core JavaScript/TypeScript rules, import, promise, and unicorn rules.react— React and React hooks rules including JSX validation, DOM safety, and component best practices.typechecked— Strict type-checked TypeScript rules (requiresoxlint-tsgolint).vitest— Rules for Vitest test files.jest— Rules for Jest test files.
To lint your files, you can add the following script to your package.json:
"scripts": {
"lint": "oxlint"
}To show lint errors in your editor, install the Oxc extension for VSCode. Add the following in settings.json to enable auto-fix on save:
{
"editor.codeActionsOnSave": {
"source.fixAll.oxc": "always"
}
}On Mac OS, you can open settings.json file from Code > Preferences > Settings or via the keyboard shortcut ⌘,.
Happy linting 🎉
