Skip to content

Commit

Permalink
chore: pre-commit/push checks
Browse files Browse the repository at this point in the history
  • Loading branch information
LauRoxx committed May 3, 2023
1 parent a8fbefc commit d9a5c5a
Show file tree
Hide file tree
Showing 8 changed files with 346 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
[*.md, *.mdx]
max_line_length = off
trim_trailing_whitespace = false
11 changes: 10 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"files": [
"*.spec.ts",
"*.spec.tsx",
"*.spec.js",
"*.spec.jsx",
"*.test.ts",
"*.test.tsx",
"*.test.js",
"*.test.jsx"
],
"extends": ["plugin:@nrwl/nx/typescript"],
"env": {},
"rules": {}
Expand Down
4 changes: 2 additions & 2 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
npx --no -- commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged --relative
5 changes: 5 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint:affected
yarn test:affected
5 changes: 5 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
'*.{js,ts,tsx}': ['yarn nx affected --target=lint --fix --files', 'prettier --write'],
'*.json': ['prettier --write'],
'*.{md, mdx}': ['prettier --write'],
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"create:package": "nx generate @availity/nx-generator:nx-generator ${0}",
"create:plugin": "nx g @nrwl/nx-plugin:plugin ${0}",
"lint:affected": "nx affected --target=lint",
"prepare": "is-ci || husky install",
"postinstall": "is-ci || husky install",
"publish:affected": "nx affected --target=publish",
"publish:affected:canary": "nx affected --target=publish:canary",
"start:storybook": "nx storybook element-storybook",
Expand Down Expand Up @@ -76,6 +76,7 @@
"jest-environment-jsdom-global": "^4.0.0",
"jsdom": "~20.0.3",
"jsonc-eslint-parser": "^2.1.0",
"lint-staged": "^13.2.2",
"nx": "15.6.2",
"prettier": "^2.6.2",
"react-test-renderer": "18.2.0",
Expand Down
Loading

0 comments on commit d9a5c5a

Please sign in to comment.