0.1.2 • Published 9 months ago
@configurajs/eslint v0.1.2
功能
- 📦 支持 javascript 预设
- 📦 支持 typescript 预设
- 📦 支持 vue(2 和 3) 预设
- 📦 支持 react 预设
- 📦 支持 vitest 预设
- 📦 支持 jsx 预设
- 📦 支持 eslint comments 预设
- 📦 支持覆盖 eslint 配置
快速开始
安装
# npm
npm i @configurajs/eslint -D
# yarn
yarn add @configurajs/eslint -D
# pnpm
pnpm add @configurajs/eslint -D
用法
// eslint.config.js
import { defineConfig } from '@configurajs/eslint'
export default defineConfig()
或
// eslint.config.js
const { defineConfig } = require('@configurajs/eslint')
module.exports = defineConfig()
切换框架预设
切换框架预设需要通过手动设置。
Vue2
// eslint.config.js
import { defineConfig } from '@configurajs/eslint'
export default defineConfig({
vue: { version: 2 },
})
React
// eslint.config.js
import { defineConfig } from '@configurajs/eslint'
export default defineConfig({
vue: false,
react: true,
})
更多选项
// prettier.config.js
import { defineConfig } from '@configurajs/eslint'
export default defineConfig({ ... })
export interface DefineConfigOptions {
/**
* 启用 TypeScript 支持
* @default true
*/
ts?: boolean
/**
* 启用 JSX 支持
* @default true
*/
jsx?: boolean
/**
* 启用 Vue 支持,默认为版本 3
* @default true
*/
vue?: boolean | { version: 2 | 3 }
/**
* 启用 React 支持
* @default false
*/
react?: boolean
/**
* 启用 Vitest 支持
* @default true
*/
vitest?: boolean
/**
* 启用 eslint 注释支持
* @default true
*/
comments?: boolean
/**
* 自定义规则
*/
rules?: Linter.RulesRecord
/**
* 忽略文件
*/
ignores?: string[]
/**
* 覆盖 eslint 配置
*/
overrides?: Linter.Config[]
}
贡献者
更新日志
协议
项目参考
本项目架构参考自 antfu-eslint-config。
0.1.2
9 months ago
0.1.1
9 months ago
0.1.1-alpha.1737089812329
9 months ago
0.1.0
9 months ago
0.0.14
9 months ago
0.0.13
9 months ago
0.0.12
9 months ago
0.0.11
9 months ago
0.0.11-alpha.1736268281589
9 months ago
0.0.11-alpha.1736267504522
9 months ago
0.0.11-alpha.1736267206310
9 months ago
0.0.11-alpha.1736266867704
9 months ago
0.0.11-alpha.1736266309972
9 months ago
0.0.11-alpha.1736265002970
9 months ago
0.0.11-alpha.1736264534608
9 months ago
0.0.10
9 months ago
0.0.9
9 months ago
0.0.9-alpha.1736263561966
9 months ago
0.0.8
9 months ago
0.0.7
9 months ago
0.0.6
9 months ago
0.0.5
9 months ago
0.0.4
9 months ago
0.0.3
9 months ago
0.0.2
9 months ago
0.0.1
10 months ago