diff --git a/.eslintrc.json b/.eslintrc.json index 74ab4641..fabe0fbc 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -113,6 +113,10 @@ { "files": ["*.html"], "rules": {} + }, + { + "files": ["*.ts", "*.js", "*.json", "*.md"], + "extends": ["prettier"] } ] } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87e99fb4..e9851e77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,3 +32,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + CI: true + HUSKY: 0 diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 00000000..31354ec1 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..d0612ad3 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run pre-commit diff --git a/lint-staged.config.js b/lint-staged.config.js index 66c2448b..94ba3cd4 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1 +1 @@ -module.exports = { '*.{ts,json,md}': ['prettier --write', 'git add'] }; +module.exports = { '*.{ts,json,md,js}': ['eslint --fix', 'git add'] }; diff --git a/package.json b/package.json index 99616ee2..3d011f51 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,9 @@ "format": "nx format:write", "format:write": "nx format:write", "format:check": "nx format:check", - "precommit": "lint-staged", - "semantic-release": "semantic-release" + "pre-commit": "lint-staged", + "semantic-release": "semantic-release", + "prepare": "husky install" }, "dependencies": { "@angular/animations": "12.0.0", @@ -41,7 +42,7 @@ "@nrwl/angular": "12.0.3", "@nrwl/nx-cloud": "11.2.0", "@testing-library/dom": "7.29.4", - "@testing-library/user-event": "^12.0.11", + "@testing-library/user-event": "^13.1.9", "core-js": "^3.6.5", "rxjs": "^6.5.5", "tslib": "^2.0.0", @@ -70,16 +71,16 @@ "cpy-cli": "^3.1.1", "eslint": "^7.25.0", "eslint-config-prettier": "8.2.0", - "eslint-plugin-import": "latest", + "eslint-plugin-import": "^2.23.4", "eslint-plugin-jest": "^24.3.5", "eslint-plugin-jest-dom": "3.8.0", "eslint-plugin-testing-library": "^4.0.1", - "husky": "^4.2.5", + "husky": "^6.0.0", "jest": "^26.1.0", "jest-preset-angular": "8.4.0", "lint-staged": "^10.2.11", "ng-packagr": "12.0.0", - "prettier": "2.2.1", + "prettier": "^2.3.0", "rimraf": "^3.0.2", "semantic-release": "^17.1.1", "ts-jest": "26.5.4",