Skip to content

Commit

Permalink
Merge pull request #1143 from wantedly/chloe463/change/husky-and-lint…
Browse files Browse the repository at this point in the history
…-staged
  • Loading branch information
chloe463 authored Dec 12, 2024
2 parents a79246f + 4aa564c commit 8dddfd0
Show file tree
Hide file tree
Showing 5 changed files with 317 additions and 11 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:

steps:
- uses: actions/[email protected]
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
Expand Down Expand Up @@ -40,8 +42,11 @@ jobs:
- name: Build
run: yarn build

- name: Lint
run: yarn lint:ci
- name: Run ESLint
run: |
BASE_BRANCH=${GITHUB_BASE_REF:-master}
BASE_COMMIT=$(git merge-base HEAD origin/${BASE_BRANCH})
yarn lint-staged --concurrent=false --diff="${BASE_COMMIT}..HEAD" --verbose
- name: Test
run: yarn test
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn lint-staged --concurrent=false
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default [
...eslintConfigWantedly,
...eslintConfigWantedlyTs,
{
ignores: ["packages/**/lib/*.js"],
ignores: ["packages/**/lib/**/*.js"],
},
{
name: "overrides",
Expand Down
19 changes: 12 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
"@types/estree": "^1.0.6",
"@types/graphql": "^14.5.0",
"@types/jest": "^27.4.0",
"husky": "^9.1.7",
"jest": "^29.7.0",
"lerna": "^4.0.0",
"lint-staged": "^15.2.10",
"mock-fs": "^5.0.0",
"pacote": "^11.3.4",
"scaffdog": "^1.0.1",
Expand All @@ -20,23 +22,26 @@
"workspaces": [
"packages/*"
],
"frolint": {
"prettier": {
"config": "./.prettierrc"
}
"lint-staged": {
"*.{ts,tsx,js,mjs}": [
"yarn format",
"yarn lint"
],
"*.json": "yarn format"
},
"scripts": {
"postinstall": "lerna bootstrap",
"test": "FORCE_COLOR=1 lerna run --stream test",
"test:watch": "FORCE_COLOR=1 lerna exec --stream --ignore prettier-config-wantedly -- npm run test -- --watch",
"test:watch:frolint": "lerna exec \"npm run test -- --watch\" --scope frolint",
"test:update": "lerna run --stream test -- -u",
"lint": "frolint --branch master",
"lint:ci": "frolint --expect-no-errors",
"format": "prettier --write",
"lint": "eslint --cache",
"build": "lerna run build",
"build:watch": "lerna run --parallel build:watch",
"prerelease": "yarn install --force && yarn run build",
"release": "yarn changeset publish",
"clean": "yarn lerna clean -y && rm -r packages/*/lib"
"clean": "yarn lerna clean -y && rm -r packages/*/lib",
"prepare": "husky"
}
}
Loading

0 comments on commit 8dddfd0

Please sign in to comment.