zgz-eslint-config-test
v1.0.0-alpha.13
Published
eslint config for zcool
Downloads
2
Readme
@zcool/eslint-config
eslint config for zcool
Usage
安装
eslint
yarn add eslint -D
如果不同的
parser
- 如果项目为
JavaScript
项目,安装babel-eslint
- 如果项目为
TypeScript
项目,安装@typescript-eslint/parser
- 如果项目为
安装
@zcool/eslint-config
yarn -D add @zcool/eslint-config
添加
.eslintrc.js
文件,并集成不同的配置- 如果当前项目环境为
React + JavaScript
,添加以下内容:
module.exports = { extends: '@zcool/eslint-config/browser' }
- 如果当前项目环境为
React + TypeScript
,添加以下内容:
module.exports = { extends: '@zcool/eslint-config/browser-ts' }
- 如果当前项目环境为
Node.js + CommonJS
,添加以下内容:
module.exports = { extends: '@zcool/eslint-config/node' }
- 如果当前项目环境为
Node.js + TypeScript
,添加以下内容:
module.exports = { extends: '@zcool/eslint-config/node-ts' }
- 如果当前项目环境为
如果开发环境为vscode,可以安装vscode-eslint插件以获取更好的按开发体验。
TODO
- separate this package into multiple packages managed by lerna
- [ ] @zcool/eslint-config-browser
- [ ] @zcool/eslint-config-browser-ts
- [ ] @zcool/eslint-config-node
- [ ] @zcool/eslint-config-node-ts
- migrate babel-eslint to @babel/eslint-parser when it's ready