1.0.0 • Published 8 months ago
@hdchan/eslint-config v1.0.0
eslint-config
简介
eslint
配置。
配置分为 basic
、 typescript
、 vue
、 react
4
个模块,分别对应场景:
basic
-- 纯js开发。typescript
-- typescript开发,继承basic
,如nodejs
等。vue
-- vue项目开发,继承typescript
。react
-- react项目开发,继承typescript
。
安装
npm install eslint @hdchan/eslint-config --save-dev
// or
yarn add eslint @hdchan/eslint-config -D
配置文件.eslintrc.js
// vue 项目使用
module.exports = {
root: true,
extends: [
'@hdchan/eslint-config/vue',
],
};
// js 项目使用
module.exports = {
root: true,
extends: [
'@hdchan/eslint-config/basic',
],
};
// typescript 项目使用
module.exports = {
root: true,
extends: [
'@hdchan/eslint-config/typescript',
],
};
// react 项目使用
module.exports = {
root: true,
extends: [
'@hdchan/eslint-config/react',
],
};