Skip to content

Commit

Permalink
build: improve lint-staged setup (#970)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlj95 authored Oct 20, 2024
1 parent 2bd6d44 commit 234deca
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
3 changes: 0 additions & 3 deletions .ci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ install:
# https://pnpm.io/cli/install#--frozen-lockfile
pnpm install --frozen-lockfile

lint-code:
pnpm run lint:code --max-warnings 0

lint-gh-actions:
ationlint

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup
uses: ./.github/actions/setup
- name: Run linter
run: cd .ci && make lint-code
run: pnpm run lint:code

github-actions:
name: GitHub Actions
Expand Down
8 changes: 4 additions & 4 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"*": ["pnpm run format"],
"projects/ngx-meta/src/**/*.ts": ["ng-lint-staged lint:code --fix --"],
"projects/ngx-meta/example-apps/**/*.ts": [
"ng-lint-staged lint:code --fix --"
"!(*.ts)": ["pnpm run format"],
"projects/ngx-meta/{src,e2e,example-apps,schematics}/**/*.ts": [
"ng-lint-staged lint:code --fix --",
"pnpm run format"
],
".github/**/*.{yml,yaml}": ["pnpm run lint:gh-actions"]
}
5 changes: 3 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@
"lintFilePatterns": [
"projects/ngx-meta/src/**/*.ts",
"projects/ngx-meta/src/**/*.html",
"projects/ngx-meta/e2e/**/*.ts",
"projects/ngx-meta/example-apps/**/*.ts",
"projects/ngx-meta/e2e/**/*.cy.ts",
"projects/ngx-meta/schematics/**/*.ts"
]
],
"maxWarnings": 0
}
}
}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"prepare": "husky",
"commitlint-edit-msg": "commitlint --verbose --edit",
"commitlint-last": "commitlint --verbose --from HEAD~1",
"ng-lint-staged": "ng-lint-staged lint --max-warnings 0 --fix --",
"cache-clean": "ng cache clean",
"commit": "pnpx @commitlint/prompt-cli",
"validate-codecov-yml": "curl -X POST --data-binary @codecov.yml https://codecov.io/validate",
Expand Down

0 comments on commit 234deca

Please sign in to comment.