@karasushin/eslint-config
v2.1.0
Published
[![npm package](https://img.shields.io/npm/v/@karasushin/eslint-config.svg)](https://www.npmjs.com/package/@karasushin/eslint-config)
Downloads
48
Readme
@karasushin/eslint-config
English / 简体中文
用法
安装
pnpm add -D eslint @karasushin/eslint-config
配置
在你的项目下创建一个 eslint.config.js
import { karasu } from '@karasushin/eslint'
export default karasu()
你也可以进行一些自定义配置
export default karasu({
typescript: true, // default true
react: true, // default false
markdown: true, // default false
})
添加 lint 脚本
添加以下内容到 package.json
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}
配置 VSCode
编辑 settings.json
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": "never"
},
"eslint.experimental.useFlatConfig": true,
"eslint.format.enable": true,
"eslint.validate": [
"html",
"javascript",
"javascriptreact",
"json",
"jsonc"
"markdown",
"typescript",
"typescriptreact",
]
}