Skip to content

Commit 5bfe2f1

Browse files
committed
Rename lint:ts script to lint:code and add JS file linting support
1 parent 9e7e37c commit 5bfe2f1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
run: pnpm lint:md
5252

5353
- name: Run ESLint
54-
run: pnpm lint:ts
54+
run: pnpm lint:code
5555

5656
- name: Run tests
5757
run: pnpm test

.lintstagedrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const makeRelative = (file) => path.relative(process.cwd(), file);
1313
export default {
1414
// ignore 'globs' option from '.markdownlint-cli2.jsonc', and pass files as arguments
1515
'**/*.md': 'pnpm lint:md --no-globs',
16-
'**/*.js': 'eslint',
16+
'**/*.js': 'eslint --cache',
1717
'**/*.ts': [
1818
// Type-check only the staged TS files while still honoring tsconfig
1919
'tsc-files --noEmit',
@@ -22,6 +22,6 @@ export default {
2222
(files) => `vitest related --run ${files.map(makeRelative).join(' ')}`,
2323

2424
// Lint the staged TS files
25-
'eslint',
25+
'eslint --cache',
2626
],
2727
};

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
"check-types": "tsc",
3838
"clean": "rimraf dist",
3939
"coverage": "vitest --coverage",
40-
"lint": "pnpm check-types && pnpm lint:ts && pnpm lint:md",
40+
"lint": "pnpm check-types && pnpm lint:code && pnpm lint:md",
4141
"lint:md": "markdownlint-cli2 --config .markdownlint-cli2.jsonc",
42-
"lint:ts": "eslint . --cache --ext .ts",
42+
"lint:code": "eslint . --cache --ext .ts --ext .js",
4343
"prepare": "node .husky/install.js",
4444
"increment": "pnpm version patch --no-git-tag-version",
4545
"test": "vitest"

0 commit comments

Comments
 (0)