meta: rework precommit linting for multiple packages

This commit is contained in:
Liam Fitzgerald 2021-07-01 14:11:18 +10:00
parent 1cd54a685c
commit 48befab2b6
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
12 changed files with 21 additions and 9 deletions

3
.eslintrc.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
ignorePatterns: ["**/*"]
};

1
.gitignore vendored
View File

@ -33,6 +33,7 @@ result-*
# NodeJS
node_modules
.eslintcache
# Haskell
.stack-work

1
.husky/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
_

View File

@ -1,10 +1,8 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
cd pkg/interface
command -v npx > /dev/null || {
exit 0
}
npx lint-staged
npx lint-staged

BIN
package-lock.json generated

Binary file not shown.

View File

@ -2,11 +2,20 @@
"name": "root",
"private": true,
"devDependencies": {
"lerna": "^4.0.0"
"eslint": "^7.29.0",
"husky": "^6.0.0",
"lerna": "^4.0.0",
"lint-staged": "^11.0.0"
},
"scripts": {
"watch-libs": "lerna run watch --no-private --parallel",
"build-libs": "lerna run build --no-private",
"test": "lerna run test"
"test": "lerna run test",
"prepare": "husky install .husky",
"bootstrap": "lerna bootstrap",
"build:prod": "lerna run build:prod"
},
"lint-staged": {
"*.{js,ts,tsx}": "eslint --cache --fix"
}
}

View File

@ -1,5 +1,5 @@
module.exports = {
extends: '@urbit',
extends: '@urbit/eslint-config',
env: {
'jest': true
}

View File

@ -81,7 +81,7 @@
"@types/yup": "^0.29.11",
"@typescript-eslint/eslint-plugin": "^4.15.0",
"@typescript-eslint/parser": "^4.24.0",
"@urbit/eslint-config": "file:../npm/eslint-config",
"@urbit/eslint-config": "^1.0.0",
"@welldone-software/why-did-you-render": "^6.1.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.6.3",
@ -120,10 +120,10 @@
"start": "webpack-dev-server --config config/webpack.dev.js",
"test": "tsc && jest",
"jest": "jest",
"prepare": "cd ../.. && husky install pkg/interface/.husky",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"chromatic": "chromatic --exit-zero-on-changes"
"chromatic": "chromatic --exit-zero-on-changes",
"hook-lint": "eslint --cache --fix"
},
"author": "",
"license": "MIT",