Skip to content

Commit 3a9d033

Browse files
committed
chore: add lint-staged husky
1 parent 82be2b1 commit 3a9d033

File tree

15 files changed

+7130
-2216
lines changed

15 files changed

+7130
-2216
lines changed

.eslintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/lambda/
2+
/scripts
3+
/config
4+
/dist
5+
.history
6+
.umi
7+
.mdoc
8+
.*
9+
mock

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: [require.resolve('@3lang3/fabric/dist/eslint')],
3+
};

.husky/commit-msg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
# commitlint config example
5+
# https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/config-conventional/index.js
6+
pnpm commitlint --edit $1

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
pnpm pretty-quick --staged

.prettierignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
**/*.svg
2+
package.json
3+
/dist
4+
.dockerignore
5+
.DS_Store
6+
.eslintignore
7+
*.png
8+
*.toml
9+
docker
10+
.editorconfig
11+
Dockerfile*
12+
.gitignore
13+
.prettierignore
14+
LICENSE
15+
.eslintcache
16+
*.lock
17+
yarn-error.log
18+
.history
19+
CNAME

.prettierrc.js

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
1+
const fabric = require('@3lang3/fabric');
2+
13
module.exports = {
2-
semi: true,
3-
singleQuote: true,
4-
trailingComma: 'all',
5-
printWidth: 80,
6-
proseWrap: 'never',
7-
endOfLine: 'lf',
8-
overrides: [
9-
{
10-
files: '.prettierrc',
11-
options: {
12-
parser: 'json',
13-
},
14-
},
15-
{
16-
files: 'document.ejs',
17-
options: {
18-
parser: 'html',
19-
},
20-
},
21-
],
22-
arrowParens: 'avoid',
4+
...fabric.prettier,
235
};

.stylelintrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const fabric = require('@3lang3/fabric');
2+
3+
module.exports = {
4+
...fabric.stylelint,
5+
};

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-conventional'] };

package.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,30 @@
22
"private": true,
33
"packageManager": "pnpm",
44
"scripts": {
5-
"clean": "rm -rf node_modules && rm -rf packages/**/node_modules"
5+
"clean": "rm -rf node_modules && rm -rf packages/**/node_modules",
6+
"prepare": "husky install",
7+
"lint-staged": "lint-staged",
8+
"lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx"
9+
},
10+
"lint-staged": {
11+
"./packages/**/*.less": "stylelint --syntax less",
12+
"./packages/**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
13+
"./packages/**/*.{js,jsx,tsx,ts,less,scss,styl,md,json}": [
14+
"prettier --write"
15+
]
616
},
717
"devDependencies": {
18+
"@commitlint/config-conventional": "^16.2.1",
19+
"commitlint": "^16.2.3",
20+
"eslint": "^8.13.0",
21+
"husky": "^7.0.4",
22+
"lint-staged": "^12.3.7",
823
"prettier": "^2.5.1",
24+
"pretty-quick": "^3.1.3",
25+
"stylelint": "^14.6.1",
926
"typescript": "^4.5.4"
27+
},
28+
"dependencies": {
29+
"@3lang3/fabric": "^0.0.0-dev1"
1030
}
1131
}

packages/cli-playground/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"compilerOptions": {
33
"target": "esnext",
44
"module": "esnext",
5+
"outDir": "./",
56
"moduleResolution": "node",
67
"importHelpers": true,
78
"jsx": "react",
89
"esModuleInterop": true,
910
"sourceMap": true,
1011
"pretty": true,
1112
"baseUrl": "./",
12-
"outDir": "./",
1313
"resolveJsonModule": true,
1414
"skipLibCheck": true,
1515
"allowSyntheticDefaultImports": true,

0 commit comments

Comments
 (0)