Skip to content

Commit 48dadb5

Browse files
committed
feat(mono): 初始化项目结构(changelog-needed)
ISSUES CLOSED: none
1 parent 98d1111 commit 48dadb5

18 files changed

+9655
-0
lines changed

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.eslintignore
2+
node_modules
3+
.vscode
4+
.idea
5+
dist
6+
.eslintrc.cjs

.eslintrc.cjs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
const { defineConfig } = require('eslint-define-config')
2+
3+
module.exports = defineConfig({
4+
// ESLint 一旦发现配置文件中有 "root": true,它就会停止在父级目录中寻找。
5+
root: true,
6+
// 解析器
7+
parser: 'vue-eslint-parser',
8+
parserOptions: {
9+
// 解析器
10+
parser: '@typescript-eslint/parser',
11+
// js的版本
12+
ecmaVersion: 2020,
13+
// 模块化方案
14+
sourceType: 'module',
15+
ecmaFeatures: {
16+
jsx: true,
17+
},
18+
},
19+
// 启用的规则
20+
extends: ['plugin:vue/vue3-recommended', 'plugin:@typescript-eslint/recommended', 'standard'],
21+
rules: {
22+
quotes: ['error', 'single'],
23+
'@typescript-eslint/ban-ts-ignore': 'off',
24+
'@typescript-eslint/explicit-function-return-type': 'off',
25+
'@typescript-eslint/no-explicit-any': 'off',
26+
'@typescript-eslint/no-var-requires': 'off',
27+
'@typescript-eslint/no-empty-function': 'off',
28+
'@typescript-eslint/no-use-before-define': 'off',
29+
'@typescript-eslint/ban-ts-comment': 'off',
30+
'@typescript-eslint/ban-types': 'off',
31+
'@typescript-eslint/no-non-null-assertion': 'off',
32+
'@typescript-eslint/explicit-module-boundary-types': 'off',
33+
'@typescript-eslint/no-unused-vars': [
34+
'error',
35+
{
36+
argsIgnorePattern: '^h$',
37+
varsIgnorePattern: '^h$',
38+
},
39+
],
40+
'no-use-before-define': 'off',
41+
'no-unused-vars': [
42+
'error',
43+
{
44+
argsIgnorePattern: '^h$',
45+
varsIgnorePattern: '^h$',
46+
},
47+
],
48+
'no-tabs': 'off',
49+
indent: 'off',
50+
'vue/custom-event-name-casing': 'off',
51+
'vue/html-indent': 'off',
52+
'vue/max-attributes-per-line': 'off',
53+
'vue/html-self-closing': 'off',
54+
'vue/singleline-html-element-content-newline': 'off',
55+
'vue/multi-word-component-names': 'off',
56+
'space-before-function-paren': 'off',
57+
'comma-dangle': 'off',
58+
},
59+
})

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit "$1"

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm run lint-staged

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shamefully-hoist = true

.prettierignore

Whitespace-only changes.

.prettierrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"printWidth": 150,
3+
"tabWidth": 2,
4+
"useTabs": true,
5+
"semi": false,
6+
"singleQuote": true,
7+
"quoteProps": "as-needed",
8+
"jsxSingleQuote": false,
9+
"trailingComma": "es5",
10+
"bracketSpacing": true,
11+
"jsxBracketSameLine": false,
12+
"arrowParens": "always",
13+
"rangeStart": 0,
14+
"requirePragma": false,
15+
"insertPragma": false,
16+
"proseWrap": "preserve",
17+
"htmlWhitespaceSensitivity": "css",
18+
"vueIndentScriptAndStyle": false,
19+
"endOfLine": "auto"
20+
}

changelogs/mono.md

Whitespace-only changes.

commitlint.config.cjs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const fs = require('fs')
2+
const path = require('path')
3+
module.exports = {
4+
extends: ['monorepo'],
5+
// 定义规则类型
6+
rules: {
7+
'header-max-length': [0, 'always'],
8+
// scope 不允许为空,保证CHANGELOG正常写入,release的命名格式为xxx-tagname,tagname和scope保持一致
9+
'scope-empty': [2, 'never'],
10+
'scope-enum': [2, 'always', [...fs.readdirSync(path.join(__dirname, 'packages')), 'mono']],
11+
'type-enum': [2, 'always', ['build', 'ci', 'chore', 'feat', 'fix', 'refactor', 'style', 'test', 'config', 'docs']],
12+
'close-issue-needed': [2, 'always'],
13+
},
14+
plugins: [
15+
{
16+
rules: {
17+
'close-issue-needed': (msg) => {
18+
const ISSUES_CLOSED = 'ISSUES CLOSED:'
19+
return [msg.raw.includes(ISSUES_CLOSED), 'Your commit message must contain ISSUES message']
20+
},
21+
},
22+
},
23+
],
24+
}

0 commit comments

Comments
 (0)