1.0.0 • Published 8 months ago

@hdchan/eslint-config v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

eslint-config

简介

eslint配置。

配置分为 basictypescriptvuereact 4个模块,分别对应场景:

  1. basic -- 纯js开发。
  2. typescript -- typescript开发,继承basic,如nodejs等。
  3. vue -- vue项目开发,继承typescript
  4. 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',
  ],
};