Skip to content

suiyun39/eslint-config-rakko

Repository files navigation

eslint-config-rakko

自用 ESLint 规则集

npm GitHub Workflow Status

安装与使用

pnpm add -D eslint eslint-config-rakko

eslint.config.js

import { defineConfig } from 'eslint-config-rakko'

export default defineConfig({
  typescript: true,
  react: true,
})

规则集

名称 状态 启用方法
imports 实验中 默认启用
javascript 稳定 默认启用
stylistic 稳定 默认启用
typescript 实验中 配置 typescript: true
typescript-type-aware 实验中 配置 typescript.project
node 实验中 配置 node: true
react 实验中 配置 react: true
react-extra 稳定 配置 react: true
solid 实验中 配置 solid: true
unicorn 实验中 配置 unicorn: true

覆盖配置

可通过 overrides 覆盖各规则集中的配置,示例如下:

import { defineConfig } from 'eslint-config-rakko'

export default defineConfig({
  overrides: {
    'javascript': {
      rules: { 'no-console': 'off' },
    },
    'typescript': {
      rules: { '@typescript-eslint/no-shadow': 'off' },
    },
  },
})

参考与感谢