0.0.4 • Published 2 years ago

@dzo/eslint-config-esdz v0.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

ESLint 规范

个人前端 ESLint 规范,目前支持vue|react

安装

npm install @dzo/eslint-config-esdz -D
# OR
yarn add @dzo/eslint-config-esdz --dev

使用

在你的工程根目录下创建一个.eslintrc.js配置文件

配置如下:

  • 基础配置
module.exports = {
  extends: ['@dzo/esdz']
}
  • vue
module.exports = {
  extends: ['@dzo/esdz/vue']
}
  • react
module.exports = {
  extends: ['@dzo/esdz/react']
}

:::caution 如果项目之前安装过 ESLint 相关的包,建议卸载,避免引入不必要的包。如eslinteslint-plugin-vue@babel/eslint-parser@typescript-eslint/eslint-plugin@typescript-eslint/parser@vue/eslint-config-typescripteslint-config-react-appeslint-plugin-import等,直接在 package.json 搜索eslint,相关的包全部卸载 :::

版本更新 0.0.2 修改"semi": "error", "always",必须分号结束 0.0.3 新增prettier.js配置文件 0.0.4 修改space-before-function-paren配置