diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000000..7b3216310a --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + ignorePatterns: ["**/*"] +}; diff --git a/.gitignore b/.gitignore index 14e61e6a84..616865e341 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ result-* # NodeJS node_modules +.eslintcache # Haskell .stack-work diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000000..31354ec138 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/pkg/interface/.husky/post-checkout b/.husky/post-checkout similarity index 100% rename from pkg/interface/.husky/post-checkout rename to .husky/post-checkout diff --git a/pkg/interface/.husky/post-commit b/.husky/post-commit similarity index 100% rename from pkg/interface/.husky/post-commit rename to .husky/post-commit diff --git a/pkg/interface/.husky/post-merge b/.husky/post-merge similarity index 100% rename from pkg/interface/.husky/post-merge rename to .husky/post-merge diff --git a/pkg/interface/.husky/pre-commit b/.husky/pre-commit similarity index 72% rename from pkg/interface/.husky/pre-commit rename to .husky/pre-commit index 2d03534b23..56d4142421 100755 --- a/pkg/interface/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,10 +1,8 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -cd pkg/interface - command -v npx > /dev/null || { exit 0 } -npx lint-staged \ No newline at end of file +npx lint-staged diff --git a/pkg/interface/.husky/pre-push b/.husky/pre-push similarity index 100% rename from pkg/interface/.husky/pre-push rename to .husky/pre-push diff --git a/package-lock.json b/package-lock.json index f1b0dd2fa5..86cabfce3f 100644 Binary files a/package-lock.json and b/package-lock.json differ diff --git a/package.json b/package.json index 60a9760bb7..71ac8adf8a 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/pkg/interface/.eslintrc.js b/pkg/interface/.eslintrc.js index bcdb06a01c..5b94b855fc 100644 --- a/pkg/interface/.eslintrc.js +++ b/pkg/interface/.eslintrc.js @@ -1,5 +1,5 @@ module.exports = { - extends: '@urbit', + extends: '@urbit/eslint-config', env: { 'jest': true } diff --git a/pkg/interface/package.json b/pkg/interface/package.json index 39ceafe4c0..274bbd2e8a 100644 --- a/pkg/interface/package.json +++ b/pkg/interface/package.json @@ -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",