mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
refactor: fix husky and lint-staged setup (#1654)
This commit is contained in:
parent
7beed26cf6
commit
1e5859425f
12
.eslintrc
12
.eslintrc
@ -3,10 +3,7 @@
|
||||
"node": true,
|
||||
"jest": true
|
||||
},
|
||||
"extends": [
|
||||
"airbnb-typescript/base",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"extends": ["airbnb-typescript/base", "plugin:prettier/recommended"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2019,
|
||||
@ -32,10 +29,7 @@
|
||||
"new-cap": [
|
||||
"error",
|
||||
{
|
||||
"capIsNewExceptions": [
|
||||
"Router",
|
||||
"Mitm"
|
||||
]
|
||||
"capIsNewExceptions": ["Router", "Mitm"]
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -56,5 +50,5 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"ignorePatterns": ["**/docs/api/oas/", "examples/**"]
|
||||
"ignorePatterns": ["**/docs/api/oas/", "examples/**", "scripts/**"]
|
||||
}
|
||||
|
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npx lint-staged
|
11
package.json
11
package.json
@ -36,7 +36,7 @@
|
||||
"build:watch": "tsc -w",
|
||||
"prebuild": "yarn run clean",
|
||||
"build": "yarn run copy-templates && tsc --pretty",
|
||||
"prepare": "yarn run build",
|
||||
"prepare": "node scripts/husky-install && yarn run build",
|
||||
"test": "NODE_ENV=test PORT=4243 jest",
|
||||
"test:unit": "NODE_ENV=test PORT=4243 jest --testPathIgnorePatterns=src/test/e2e/**",
|
||||
"test:docker": "./scripts/docker-postgres.sh",
|
||||
@ -180,18 +180,13 @@
|
||||
"json-schema": "^0.4.0"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"*.{js,ts}": [
|
||||
"eslint --fix"
|
||||
],
|
||||
"*.{json,css,md}": [
|
||||
"*.{json,yaml,md}": [
|
||||
"prettier --write"
|
||||
]
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"prettier": {
|
||||
"proseWrap": "never",
|
||||
"singleQuote": true,
|
||||
|
3
scripts/husky-install.js
Normal file
3
scripts/husky-install.js
Normal file
@ -0,0 +1,3 @@
|
||||
if (!process.env.CI) {
|
||||
require('husky').install();
|
||||
}
|
Loading…
Reference in New Issue
Block a user