1.2.1-5 • Published 9 months ago
eslint-config-db v1.2.1-5
eslint-config-db
安装
使用 npm
安装
npm install --save-dev eslint-config-db eslint-plugin-prettier eslint-plugin-import
使用 yarn
安装
yarn add -D eslint-config-db eslint-plugin-prettier eslint-plugin-import
在项目中配置
在 eslint
配置文件中加入对应配置即可生效
普通项目
{
extends: ['db'],
}
react项目
{
extends: ['db/react'],
}
commit时启用代码检查
可以启用提交时检测代码来规范项目内的代码风格
只会检测有改动的,之前的文件不会去检测
执行 npx init-lint
,会自动进行设置
prettier
如果要使用 prettier
自动格式化,需要在根目录创建 .prettierrc.js
文件。
该文件用于覆盖系统默认配置,具体要实现自动格式化还要安装相应插件并设置默认格式化工具
// .prettierrc.js
const prettier = require('eslint-config-db/config/prettier')
module.exports = {
...prettier,
}
stylelint
如果使用 stylelint
来检查 css
样式,需要在根目录创建 .stylelintrc.js
文件。
// .stylelintrc.js
const stylelint = require('eslint-config-db/config/stylelint')
module.exports = {
...stylelint,
}
1.2.1-5
9 months ago
1.2.1-4
1 year ago
1.2.0
1 year ago
1.2.1-0
1 year ago
1.2.1-2
1 year ago
1.2.0-3
2 years ago
1.2.1-1
1 year ago
1.2.0-2
2 years ago
1.2.1-3
1 year ago
1.2.0-1
2 years ago
1.2.0-0
2 years ago
1.1.0-3
2 years ago
1.1.0-2
2 years ago
1.1.0-1
2 years ago
1.1.0-0
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago