Skip to content

Commit e2c5675

Browse files
authored
refactor: fix eslint errors (#1102)
* refactor: fix eslint errors * refactor: update `eslint` and `typescript-eslint` * ci: add lint to checks
1 parent 7e5d219 commit e2c5675

26 files changed

+283
-196
lines changed

.eslintrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const ERROR = 2
55
/* eslint-enable @typescript-eslint/no-unused-vars */
66

77
module.exports = {
8+
reportUnusedDisableDirectives: true,
89
parser: "@typescript-eslint/parser",
910
parserOptions: {
1011
ecmaVersion: 2020,
@@ -42,5 +43,7 @@ module.exports = {
4243
// jsx-ally
4344
"jsx-a11y/no-onchange": WARN,
4445
"import/no-anonymous-default-export": OFF,
46+
// next
47+
"@next/next/no-img-element": OFF,
4548
},
4649
}

.github/workflows/ci.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ env:
1212
HUSKY: 0
1313

1414
jobs:
15-
ci:
16-
name: CI
15+
check:
16+
name: Run ${{ matrix.script }} code check
1717
runs-on: ubuntu-latest
1818
timeout-minutes: 15
1919

20+
strategy:
21+
fail-fast: true
22+
matrix:
23+
script: [format, lint]
24+
2025
steps:
2126
- name: Checkout repo
2227
uses: actions/checkout@v4
@@ -34,6 +39,6 @@ jobs:
3439
shell: bash
3540
run: pnpm install --frozen-lockfile
3641

37-
- name: Format
42+
- name: Run ${{ matrix.script }}
3843
run: |
39-
pnpm run format
44+
pnpm run ${{ matrix.script }}

package.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@
3434
},
3535
"devDependencies": {
3636
"@next/bundle-analyzer": "^13.4.5",
37+
"@types/react": "^18.3.11",
3738
"@types/react-helmet": "^6.1.6",
38-
"@typescript-eslint/eslint-plugin": "^5.59.11",
39-
"@typescript-eslint/parser": "^5.59.11",
39+
"@typescript-eslint/eslint-plugin": "^8.18.0",
40+
"@typescript-eslint/parser": "^8.18.0",
4041
"cross-env": "^7.0.3",
41-
"eslint": "^8.42.0",
42+
"eslint": "^8.57.1",
4243
"eslint-config-next": "^13.4.5",
4344
"eslint-config-prettier": "^8.8.0",
4445
"eslint-plugin-jsx-a11y": "^6.7.1",
@@ -47,7 +48,7 @@
4748
"husky": "^8.0.3",
4849
"lint-staged": "^13.2.2",
4950
"prettier": "^3.4.2",
50-
"typescript": "^5.1.3"
51+
"typescript": "^5.6.3"
5152
},
5253
"keywords": [
5354
"react-hook-form",
@@ -60,7 +61,8 @@
6061
"dev": "next dev",
6162
"format": "prettier . --check",
6263
"format:fix": "prettier . --write",
63-
"lint": "next lint --fix",
64+
"lint": "next lint",
65+
"lint:fix": "next lint --fix",
6466
"now-build": "pnpm run build",
6567
"start": "next start",
6668
"typecheck": "tsc --noEmit",

0 commit comments

Comments
 (0)