lvjiaxuan / eslint-config

My personal ESLint config presets.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm code style

All rules inherit from @antfu/eslint-config.

Features

  1. Add my @lvjiaxuan/eslint-plugin.
  2. Auto-detect tsconfig.json and its references if TypeScript is enabled, which means enabling type-aware rules.
  3. Add my @lvjiaxuan/eslint-plugin-oxlint.

Usage

Follow antfu's.

Disable tsconfig.json auto-detected

// eslint.config.js
import lv from '@lvjiaxuan/eslint-config'

export default lv({
  typescript: {
    notDetectTsconfig: true
  }
})

With OXLint

A number of rules will be taken care of by OXLint to reduce ESLint's burden.

Note

The rules settings of antfu's will be overwritten.

// eslint.config.js
import lv from '@lvjiaxuan/eslint-config'

export default lv({
  oxlint: true // equals to `{ deny: 'correctness' }`.
})

Check the type OXLintOptions detail on here.

Tip

  1. Categories of OXLint.
  2. Rules supported by OXLint.

Modify lint scritp:

// package.json
{
  "scripts": {
-    "lint": "eslint ."
+    "lint": "npx oxlint . && eslint",
+    "lintf": "npx oxlint . --fix && eslint --fix"
  }
}

About

My personal ESLint config presets.

License:MIT License


Languages

Language:TypeScript 99.3%Language:JavaScript 0.7%