@mniebling/lint-config
v0.4.0
Published
My personal linting configuration
Readme
@mniebling/lint-config
Autoformat on save is a useful time saver and integrating a formatter with AI tooling is very effective to get output code looking correct. However, Prettier is too opinionated; it wraps lines in weird ways and enforces some suboptimal patterns. This tradeoff is tolerable for writing code on a large team, but not for working on my personal projects.
See: https://antfu.me/posts/why-not-prettier
Installation
npm install --save-dev \
@mniebling/lint-config \
oxlint \
oxlint-tsgolint \
@stylistic/eslint-pluginUsage
Create an oxlint.config.ts in the project root:
import myConfig from '@mniebling/lint-config'
import { defineConfig } from 'oxlint'
export default defineConfig({
extends: [myConfig],
})Add the lint command to the scripts field in package.json:
"lint": "oxlint",For VSCode, set up auto fix on save in .vscode/settings.json.
Here's that setting and the others I typically use:
"editor.codeActionsOnSave": {
"source.fixAll.oxc": "explicit",
"source.organizeImports": "explicit"
},
"js/ts.tsdk.path": "node_modules/typescript/lib"Install the VSCode extension if needed: oxc.oxc-vscode
Extending the configuration
Project-specific rules can be added alongside extends and will override the shared config:
import myConfig from '@mniebling/lint-config'
import { defineConfig } from 'oxlint'
export default defineConfig({
extends: [myConfig],
rules: {
'no-console': 'warn',
},
})Type-aware linting
Type-aware linting is enabled via options.typeAware: true.
This requires oxlint-tsgolint to be installed and running alongside oxlint.
See the Oxlint type-aware linting docs for more info.
