@forgleaner/eslint-config
v1.6.1
Published
ESLint Config for JavaScript Style with.
Downloads
15
Readme
eslint-config
eslint插件配置,包含js、ts、vue通用规则
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"
}