1.2.5 • Published 3 months ago
eslint-config-handpear v1.2.5
eslint-config-handpear
Handpear ESLint 规则
一套适用于 React/Vue/Typescript 项目的 ESLint 配置规范。
基础规则
安装
pnpm add -D eslint @babel/core @babel/eslint-parser eslint-config-handpear
使用
module.exports = {
extends: ["handpear"],
};
Typescript
安装
pnpm add --save-dev eslint typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-handpear
module.exports = {
// 按顺序引入
extends: ["handpear", "handpear/typescript"],
parserOptions: {
// 你的 tsconfig.json 路径
project: "./tsconfig.json",
},
};
使用
React
安装
pnpm add --save-dev eslint @babel/core @babel/eslint-parser @babel/preset-react@latest eslint-plugin-react eslint-config-handpear
使用
module.exports = {
// 按顺序引入
extends: ["handpear", "handpear/react"],
};
React Typescript
安装
pnpm add --save-dev eslint typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-react eslint-config-handpear
使用
module.exports = {
// 按顺序引入
extends: ["handpear", "handpear/typescript", "handpear/react"],
parserOptions: {
// 你的 tsconfig.json 路径
project: "./tsconfig.json",
},
};
Vue
安装
pnpm add --save-dev eslint @babel/core @babel/eslint-parser vue-eslint-parser eslint-plugin-vue eslint-config-handpear
使用
module.exports = {
// 按顺序引入
extends: ["handpear", "handpear/vue"],
};
Vue Typescript
安装
pnpm add --save-dev @babel/core @babel/eslint-parser @typescript-eslint/eslint-plugin @typescript-eslint/parser @vue/eslint-config-typescript eslint eslint-config-handpear eslint-plugin-vue vue-eslint-parser
使用
module.exports = {
// 按顺序引入
extends: ["handpear", "handpear/typescript", "handpear/vue"],
parserOptions: {
// 你的 tsconfig.json 路径
project: "./tsconfig.json",
},
};
相关链接
License
Copyright (c) 2023-present, Handpear