Skip to content

Commit

Permalink
ci: eslint and prettier lint automation using husky lint-staged gith…
Browse files Browse the repository at this point in the history
…ub-actions (#12)

* ci: eslint and prettier lint automation using husky lint-staged github-actions

* fix: error in prettier --check options

No parser could be inferred for file '.../.markdownlintignore' occured. So I fixed it.

* perf: made lint.yml using parallel operation
  • Loading branch information
lumirlumir authored Aug 7, 2024
1 parent b5aeab8 commit 7c1782f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ on:

jobs:
lint:
strategy:
matrix:
type:
- eslint
- prettier
- editorconfig
- markdownlint

runs-on: ubuntu-latest

steps:
Expand All @@ -30,8 +38,5 @@ jobs:
- name: Set up node_modules
run: npm ci

- name: Lint editorconfig
run: npm run lint-editorconfig --if-present

- name: Lint markdownlint
run: npm run lint-markdownlint --if-present
- name: Lint ${{ matrix.type }}
run: npm run lint-${{ matrix.type }} --if-present
3 changes: 3 additions & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# production
/build

# files
LICENSE
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
build
.markdownlintignore
package-lock.json
*.md
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@
"prettier": "^3.3.3"
},
"lint-staged": {
"*": "npx editorconfig-checker",
"*": [
"npx prettier --check",
"npx editorconfig-checker"
],
"*.js": "npx eslint",
"*.md": "npx markdownlint"
}
}

0 comments on commit 7c1782f

Please sign in to comment.