3.0.3 • Published 8 months ago
@zpcscc/configs v3.0.3
@zpcscc/configs
简介
通用配置库
安装
npm install --save-dev @zpcscc/configs
使用
eslint
.eslintrc.js
基础配置
module.exports = {
extends: [require.resolve('@zpcscc/configs/eslint-config')],
};
react的eslint配置
module.exports = {
extends: [require.resolve('@zpcscc/configs/eslint-config/react')],
};
补充配置
module.exports = {
// 由于使用了eslint-config-standard-with-typescript插件对ts的支持
// 部分规则需要tsconfig.json配置,需要在这里引入tsconfig.json文件
parserOptions: {
project: ['./tsconfig.json'],
},
};
tsconfig.json
tsconfig.json 文件中,也需要在 include 中引入.eslintrc.js 文件
{
"include": [".eslintrc.js"]
}
prettier
.prettierrc
'@zpcscc/configs/prettier-config';
.prettierrc.js
module.exports = {
...require('@zpcscc/configs/prettier-config'),
};
tsconfig
tsconfig.json
基础配置
{
"extends": "@zpcscc/configs/tsconfig/tsconfig.json",
}
commitlint
package.json
"scripts": {
"commit": "git add . && git-cz",
},
.czrc
{
"path": "@commitlint/cz-commitlint"
}
commitlint.config.js
module.exports = {
extends: ['@zpcscc/configs/commitlint-config'],
};
上述文件设置好后,提交代码时使用下列命令
npm run commit
若要默认使用git cz
则需全局安装相关依赖
npm i -g commitizen inquirer@8 @commitlint/cz-commitlint
types
types.d.ts
// 基础配置
/// <reference types="@zpcscc/configs/types" />
License
MIT © zpcscc
3.0.3
8 months ago
3.0.2
9 months ago
3.0.1
11 months ago
3.0.0
11 months ago
2.1.2
11 months ago
2.1.1
11 months ago
2.0.9
12 months ago
2.0.10
12 months ago
2.1.0
12 months ago
2.0.7
1 year ago
2.0.8
1 year ago
2.0.6
1 year ago
2.0.5
1 year ago
2.0.4
1 year ago
2.0.3
2 years ago
2.0.2
2 years ago
2.0.1
2 years ago
2.0.0
2 years ago