ss-config
v1.0.22
Published
react(eslint、prettier、stylelint、commitlint)配置包
Downloads
27
Maintainers
Readme
ss-config
介绍
公共配置包
- eslint-react-js
- eslint-react-ts
- eslint-vue-js
- eslint-vue-ts
- prettier
- stylelint-react
- stylelint-vue
- commitlint
- typescript-react
- typescript-vue
安装教程
npm install -D ss-config
使用说明
Eslint
eslint-react-js
// .eslintrc.js
module.exports = {
extends: [require.resolve("ss-config/lib/eslint/js/react-config")],
};
eslint-react-ts
// .eslintrc.js
module.exports = {
extends: [require.resolve("ss-config/lib/eslint/ts/react-config")],
};
可扩展rules规则
{
"rules": {
"@typescript-eslint/no-explicit-any": "error"
//...
}
}
eslint-vue-js
// .eslintrc.js
module.exports = {
extends: [require.resolve("ss-config/lib/eslint/js/vue-config")],
};
eslint-vue-ts
// .eslintrc.js
module.exports = {
extends: [require.resolve("ss-config/lib/eslint/ts/vue-config")],
};
可扩展rules规则
{
"rules": {
"@typescript-eslint/no-explicit-any": "error"
//...
}
}
Prettier
// .prettierrc.js
const prettier = require("ss-config/lib/stylelint");
module.exports = {
...prettier,
};
Stylelint
stylelint-react
//stylelint.config.js
module.exports = {
extends: [require.resolve("ss-config/lib/stylelint/react-config")],
};
可扩展rules规则
{
"rules": {
"color-no-invalid-hex": null
}
}
stylelint-vue
//stylelint.config.js
module.exports = {
extends: [require.resolve("ss-config/lib/stylelint/vue-config")],
};
可扩展rules规则
{
"rules": {
"color-no-invalid-hex": null
}
}
Commitlint
// commitlint.config.js
module.exports = {
extends: [require.resolve("ss-config/lib/commitlint")],
};
scripts-参考
{
"scripts": {
"lint": "eslint \"./src/**/*.{ts,tsx}\"",
"fix": "eslint \"./src/**/*.{ts,tsx}\" --fix",
"lint:prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\" --end-of-line auto",
"lint:style": "stylelint \"./src/**/*.{css,scss,less}\""
}
}