diff --git a/.eslintignore b/.eslintignore index 60feb237..8d68b1f0 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,3 @@ **/node_modules -build/ +**/build/ *.d.ts diff --git a/.eslintrc.js b/.eslintrc.js index 61851c83..5e4838ae 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,7 +22,7 @@ module.exports = { ], root: true, - plugins: ['jest', 'no-for-of-loops', 'no-function-declare-after-return', 'react', '@typescript-eslint'], + plugins: ['jest', 'no-function-declare-after-return', 'react', '@typescript-eslint'], parser: '@typescript-eslint/parser', parserOptions: { @@ -56,7 +56,6 @@ module.exports = { 'comma-dangle': ['error', 'only-multiline'], 'no-constant-condition': 'off', - 'no-for-of-loops/no-for-of-loops': 'error', 'no-function-declare-after-return/no-function-declare-after-return': 'error', }, globals: { diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 00000000..35ed753f --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run commitlint diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..9e415abc --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run lint-commit diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..e691697a --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +**/build +*.md +*.html \ No newline at end of file diff --git a/.prettierrc.js b/.prettierrc.js index c2622eaa..6d7ef14b 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -16,17 +16,17 @@ 'use strict'; module.exports = { - printWidth: 120, // 一行120字符数,如果超过会进行换行 - tabWidth: 2, // tab等2个空格 - useTabs: false, // 用空格缩进行 - semi: true, // 行尾使用分号 - singleQuote: true, // 字符串使用单引号 - quoteProps: 'as-needed', // 仅在需要时在对象属性添加引号 - jsxSingleQuote: false, // 在JSX中使用双引号 - trailingComma: 'es5', // 使用尾逗号(对象、数组等) - bracketSpacing: true, // 对象的括号间增加空格 - bracketSameLine: false, // 将多行JSX元素的>放在最后一行的末尾 - arrowParens: 'avoid', // 在唯一的arrow函数参数周围省略括号 - vueIndentScriptAndStyle: false, // 不缩进Vue文件中的