1.6.1 • Published 5 years ago

@forgleaner/eslint-config v1.6.1

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

eslint-config

build commitizen prettier download npm semantic

eslint插件配置,包含js、ts、vue通用规则

基于 eslint-config-standard.

Install

npm i @forgleaner/eslint-config -D

使用

添加以下代码到 .eslintrc.js

module.exports = {
  "extends": "@forgleaner/eslint-config"
}

添加对ts和vue文件的规则支持

添加以下代码到 .eslintrc.js

// 如果您的项目使用 typescript,添加 ts 配置
const tslint = require('@forgleaner/eslint-config/ts');
// const vueJSlint = require('@forgleaner/eslint-config/vue-js');
// 如果您的项目使用 vue+typescript,推荐使用 vue-ts 配置
const vueTSlint = require('@forgleaner/eslint-config/vue-ts');

module.exports = {
  extends: '@forgleaner/eslint-config',
  overrides: [
    tslint,
    // vueJSlint,
    vueTSlint
  ]
}

或者可以在您的项目中使用此插件针对 prettier 的部分配置

添加以下代码到 package.json

{ 
  ...
  "prettier": "@forgleaner/eslint-config/.prettierrc"
}