提交 095525f5 authored 作者: zengzhe's avatar zengzhe

feat: update

上级 e8ba2a0e
{
"name": "hi-rules",
"version": "1.0.0",
"description": "对eslint,prettier等配置文件进行统一管理,实现跨项目一致的开发体验",
"main": "index.js",
"author": "",
"license": "ISC",
"devDependencies": {
"prettier": "^1.16.1",
"@commitlint/cli": "^13.2.1",
"@commitlint/config-conventional": "^13.2.0",
"@babel/eslint-parser": "^7.18.9",
"@vue/eslint-config-prettier": "^7.0.0",
"babel-eslint": "10.1.0",
"eslint": "7.32.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-vue": "^8.0.3"
}
}
module.exports = {
extends: ['@commitlint/config-conventional'],
// 以下时我们自定义的规则
rules: {
'type-enum': [
2,
'always',
[
'bug', // 此项特别针对bug号,用于向测试反馈bug列表的bug修改情况
'feat', // 新功能(feature)
'fix', // 修补bug
'docs', // 文档(documentation)
'format', // 格式(不影响代码运行的变动)
'style', // 修改css样式
'refactor', // 重构(即不是新增功能,也不是修改bug的代码变动)
'test', // 增加测试
'chore', // 构建过程或辅助工具的变动
'revert', // feat(pencil): add ‘graphiteWidth’ option (撤销之前的commit)
'merge' // 合并分支, 例如: merge(前端页面): feature-xxxx修改线程地址
]
]
}
}
/*
* @Author: zengzhe
* @Date: 2023-01-05 16:59:53
* @LastEditors: zengzhe
* @LastEditTime: 2023-01-05 16:59:58
* @Description:
*/
module.exports = {
root: true,
env: {
node: true,
},
globals: {
Cropper: true,
BMap: true,
},
extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/prettier'],
plugins: ['vue', 'prettier'],
parserOptions: {
parser: 'babel-eslint',
},
rules: {
'prettier/prettier': 'error',
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
eqeqeq: 'off', // 关闭===代替==的告警
'no-loop-func': 'off', // 关闭,禁止在循环中出现 function 声明和表达式
'no-script-url': 'off', // 关闭a标签href无url的告警
'vue/script-setup-uses-vars': 'off',
'vue/multi-word-component-names': 'off',
'vue/no-mutating-props': 'off',
'vue/no-useless-template-attributes': 'off',
semi: [0, 'never'], // 允许使用分号
quotes: [1, 'single'],
'space-before-function-paren': 0,
'eol-last': 0,
'no-unused-vars': [2, { vars: 'all', args: 'after-used' }], //不能有声明后未被使用的变量或参数
'arrow-parens': [2, 'as-needed'], // 箭头函数如果只有一个参数不需要括号
},
}
/*
* @Author: zengzhe
* @Date: 2023-01-05 17:06:33
* @LastEditors: zengzhe
* @LastEditTime: 2023-01-05 17:06:51
* @Description:
*/
import eslint from './eslint.js'
import commitLint from './commitLint.js'
import prettier from './prettier.js'
export default {
eslint,
commitLint,
prettier,
}
module.exports = {
printWidth: 80, // 每行代码长度(默认80)
tabWidth: 2, // 每个tab相当于多少个空格(默认2)
useTabs: false, // 是否使用tab进行缩进(默认false)
singleQuote: true, // 使用单引号(默认false)
semi: false, // 声明结尾使用分号(默认true)
trailingComma: 'none', // 多行使用拖尾逗号(默认none)
bracketSpacing: true, // 对象字面量的大括号间使用空格(默认true)
jsxBracketSameLine: false, // 多行JSX中的>放置在最后一行的结尾,而不是另起一行(默认false)
arrowParens: 'avoid', // 只有一个参数的箭头函数的参数是否带括号(默认avoid)
htmlWhitespaceSensitivity: 'ignore', // 空格不敏感。(开始标签、内容、结束标签各自单独一行)
endOfLine: 'auto',
// vueIndentScriptAndStyle: false, // 是否给vue中的 <script> and <style>标签加缩进
// embeddedLanguageFormatting: 'auto', // 是否格式化嵌入到JS中的html标记的代码段或者Markdown语法 auto-格式化 off-不格式化
// requirePragma: false, // 若为true,文件顶部加了 /*** @prettier */或/*** @format */的文件才会被格式化
// insertPragma: false, // 当requirePragma参数为true时,此参数为true将向@format标记后面添加一个换行符
// proseWrap: 'never', // 有效选项[always|never|preserve]。当Markdown文本超过printWidth时,是否换行,always-换行 never-不换行 preserve保持原样
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论