Skip to content

Commit

Permalink
build: introduct simple-git-hooks and lint-staged
Browse files Browse the repository at this point in the history
- remove commitizen
- rewrite npm scripts
  • Loading branch information
iorate committed Feb 5, 2022
1 parent 4a1c3f2 commit 83d0fc3
Show file tree
Hide file tree
Showing 5 changed files with 256 additions and 555 deletions.
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
/.yarn
/dist
/website/.docusaurus
/website/build
47 changes: 26 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
"name": "ublacklist",
"version": "0.0.0",
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"devDependencies": {
"@codemirror/commands": "^0.19.6",
"@codemirror/gutter": "^0.19.9",
Expand All @@ -30,10 +25,8 @@
"@typescript-eslint/parser": "^5.8.1",
"aggregate-error": "^3.1.0",
"colord": "^2.9.2",
"commitizen": "^4.2.4",
"copy-webpack-plugin": "^10.2.0",
"csstype": "^2.6.19",
"cz-conventional-changelog": "^3.3.0",
"dayjs": "^1.10.7",
"dotenv-webpack": "^7.0.3",
"esbuild": "^0.14.9",
Expand All @@ -54,6 +47,7 @@
"if-webpack-loader": "^2.0.0",
"is-mobile": "^3.0.0",
"jest": "^27.4.5",
"lint-staged": "^12.3.3",
"microstruct": "^1.0.0",
"mpsl": "^3.1.0",
"npm-run-all": "^4.1.5",
Expand All @@ -65,6 +59,7 @@
"semantic-release": "^17.4.7",
"semantic-release-chrome": "^1.1.3",
"semantic-release-firefox-add-on": "^0.2.8",
"simple-git-hooks": "^2.7.0",
"typescript": "^4.5.4",
"webpack": "^5.65.0",
"webpack-cli": "^4.9.1"
Expand All @@ -81,8 +76,7 @@
],
"ignorePatterns": [
"/.yarn",
"/dist",
"/website"
"/dist"
],
"overrides": [
{
Expand Down Expand Up @@ -151,6 +145,13 @@
]
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
],
"*.{json,md,yaml,yml}": "prettier --write"
},
"packageManager": "[email protected]",
"prettier": {
"arrowParens": "avoid",
Expand Down Expand Up @@ -201,20 +202,24 @@
"interpret@^2.2.0": "patch:interpret@npm:2.2.0#.yarn/patches/interpret-npm-2.2.0-3603a544e1"
},
"scripts": {
"_webpack": "webpack",
"clean": "rimraf dist",
"build": "npm-run-all \"_webpack --env browser={1:=chrome} --env mode={2:=development} --env typecheck={3:=notypecheck}\" --",
"postinstall": "simple-git-hooks",
"build": "npm-run-all \"webpack --env browser={1:=chrome} --env mode={2:=development} --env typecheck={3:=notypecheck}\" --",
"build-all": "run-p -l \"build chrome development typecheck\" \"build chrome production typecheck\" \"build chrome-mv3 development typecheck\" \"build chrome-mv3 production typecheck\" \"build firefox development typecheck\" \"build firefox production typecheck\" \"build safari development typecheck\" \"build safari production typecheck\"",
"watch": "npm-run-all \"_webpack --watch --env browser={1:=chrome} --env mode=development --env typecheck=notypecheck\" --",
"lint": "FORCE_COLOR=1 run-p -l \"lint:*\"",
"lint:eslint": "eslint .",
"lint:prettier": "prettier --check --loglevel warn .",
"lint:typecheck": "tsc --noEmit",
"fix": "FORCE_COLOR=1 run-s -l fix:eslint fix:prettier",
"fix:eslint": "eslint --fix .",
"fix:prettier": "prettier --write --loglevel warn .",
"watch": "npm-run-all \"webpack --watch --env browser={1:=chrome} --env mode=development --env typecheck=notypecheck\" --",
"clean": "rimraf dist",
"lint": "FORCE_COLOR=1 run-p -l lint-eslint lint-prettier lint-typecheck",
"lint-eslint": "eslint . --ignore-pattern /website",
"lint-prettier": "prettier --check --loglevel warn . !website",
"lint-typecheck": "tsc --noEmit",
"fix": "FORCE_COLOR=1 run-s -l fix-eslint fix-prettier",
"fix-eslint": "eslint --fix . --ignore-pattern /website",
"fix-prettier": "prettier --write --loglevel warn . !website",
"test": "jest",
"commit": "git-cz"
"g:prettier": "cd $INIT_CWD && prettier",
"webpack": "webpack"
},
"simple-git-hooks": {
"pre-commit": "yarn lint-staged"
},
"workspaces": [
"website"
Expand Down
2 changes: 2 additions & 0 deletions website/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.docusaurus
/build
20 changes: 14 additions & 6 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,24 @@
"npm-run-all": "^4.1.5",
"typescript": "^4.5.4"
},
"eslintConfig": {
"ignorePatterns": [
"*"
]
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json,md,mdx}": "prettier --write"
},
"private": true,
"scripts": {
"clear": "docusaurus clear",
"build": "docusaurus build",
"serve": "docusaurus serve",
"start": "docusaurus start",
"lint": "FORCE_COLOR=1 run-p -l \"lint:*\"",
"lint:prettier": "yarn workspace ublacklist prettier --check --loglevel warn website",
"lint:typecheck": "tsc",
"fix": "yarn fix:prettier",
"fix:prettier": "yarn workspace ublacklist prettier --write --loglevel warn website"
"clear": "docusaurus clear",
"lint": "FORCE_COLOR=1 run-p -l lint-prettier lint-typecheck",
"lint-prettier": "yarn g:prettier --check --loglevel warn .",
"lint-typecheck": "tsc",
"fix": "yarn fix-prettier",
"fix-prettier": "yarn g:prettier --write --loglevel warn ."
}
}
Loading

0 comments on commit 83d0fc3

Please sign in to comment.