Skip to content

Commit af7542f

Browse files
committed
♻️ chore: update lint and deps
1 parent 045f7cb commit af7542f

File tree

16 files changed

+7552
-6135
lines changed

16 files changed

+7552
-6135
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# https://editorconfig.org/
12
root = true
23

34
[*]

.husky/commit-msg

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
npx --no -- commitlint --edit $1
5-
npx @jannajs/lint emojify $1
2+
npx --no -- @jannajs/lint emojify $1

.husky/pre-commit

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
4-
npx lint-staged
1+
npx --no -- lint-staged

.vscode/settings.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
2-
// Enable the ESlint flat config support
3-
"eslint.experimental.useFlatConfig": true,
2+
3+
"eslint.options": {
4+
"flags": ["unstable_ts_config"]
5+
},
46

57
// Disable the default formatter, use eslint instead
68
"prettier.enable": false,

commitlint.config.ts

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { UserConfig } from '@commitlint/types'
22

33
const config: UserConfig = {
4+
// ref: https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional
5+
// ref: https://www.conventionalcommits.org/en/v1.0.0/#summary
46
extends: ['@commitlint/config-conventional'],
57
// [Question] how to extend and override config-conventional settings:
68
// https://github.com/conventional-changelog/commitlint/issues/2232
@@ -9,22 +11,21 @@ const config: UserConfig = {
911
2,
1012
'always',
1113
[
12-
'build',
13-
'chore',
14-
'ci',
15-
'docs',
1614
'feat',
1715
'fix',
18-
'perf',
19-
'refactor',
20-
'revert',
16+
'docs',
2117
'style',
18+
'refactor',
19+
'perf',
2220
'test',
23-
// custom
24-
'release',
21+
'build',
22+
'ci',
23+
'chore',
24+
'revert',
2525
],
2626
],
2727
},
28+
// ref: https://commitlint.js.org/#/reference-prompt
2829
prompt: {
2930
questions: {
3031
type: {
@@ -87,12 +88,7 @@ const config: UserConfig = {
8788
revert: {
8889
description: 'Reverts a previous commit',
8990
title: 'Reverts',
90-
emoji: '⏪️',
91-
},
92-
release: {
93-
description: 'Release a package version',
94-
title: 'Release',
95-
emoji: '🔖',
91+
emoji: '🗑',
9692
},
9793
},
9894
},

docs/pages/404.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ function Component404() {
99
<h1>404</h1>
1010
<p>Page not found</p>
1111
<button
12+
type='button'
1213
onClick={() =>
1314
navigate('/', {
1415
replace: true,

docs/pages/_theme.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import './global.css'
2-
31
import React from 'react'
42
import { createTheme, defaultSideNavs } from 'vite-pages-theme-doc'
53

6-
import type { Theme } from 'vite-plugin-react-pages'
74
import Component404 from './404'
85

6+
import type { Theme } from 'vite-plugin-react-pages'
7+
8+
import './global.css'
9+
910
const theme: Theme = (props) => {
1011
const { loadedData, loadState } = props
1112

package.json

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "pkg-name",
33
"type": "module",
44
"version": "0.0.0",
5+
"packageManager": "[email protected]",
56
"description": "",
67
"author": "Yuns <[email protected]>",
78
"license": "MIT",
@@ -31,10 +32,8 @@
3132
"build": "tsc && vite build --config vite.lib.config.ts",
3233
"preview": "vite preview --config vite.docs.config.ts",
3334
"prepare": "husky install",
34-
"lint-staged": "lint-staged",
35-
"lint-staged:lint": "eslint",
36-
"lint": "eslint .",
37-
"lint:fix": "eslint --fix .",
35+
"lint": "eslint --flag unstable_ts_config .",
36+
"lint:fix": "eslint --flag unstable_ts_config .",
3837
"test": "vitest --config vite.lib.config.ts",
3938
"test:ui": "vitest --config vite.lib.config.ts --ui",
4039
"coverage": "vitest run --config vite.lib.config.ts --coverage"
@@ -44,52 +43,49 @@
4443
"react-dom": ">=16.9.0"
4544
},
4645
"devDependencies": {
47-
"@antfu/eslint-config": "^2.6.2",
46+
"@antfu/eslint-config": "^2.27.1",
4847
"@changesets/cli": "^2.27.1",
49-
"@commitlint/cli": "^18.4.4",
50-
"@commitlint/config-conventional": "^18.4.4",
51-
"@commitlint/types": "^18.4.4",
52-
"@jannajs/lint": "3.0.0-next.3",
48+
"@commitlint/cli": "^19.4.0",
49+
"@commitlint/config-conventional": "^19.2.2",
50+
"@commitlint/types": "^19.0.3",
51+
"@eslint-react/eslint-plugin": "^1.12.1",
52+
"@jannajs/lint": "3.0.0-next.18",
5353
"@mdx-js/react": "^3.0.0",
54-
"@types/fs-extra": "^11.0.4",
5554
"@types/node": "^20.11.0",
5655
"@types/react": "^18.2.47",
5756
"@types/react-dom": "^18.2.18",
5857
"@types/react-router-dom": "^5.3.3",
5958
"@types/react-test-renderer": "^18.0.7",
60-
"@vitejs/plugin-react": "^4.2.1",
61-
"@vitest/coverage-v8": "^1.2.0",
62-
"@vitest/ui": "^1.2.0",
59+
"@vitejs/plugin-react": "^4.3.1",
60+
"@vitest/coverage-v8": "^2.0.5",
61+
"@vitest/ui": "^2.0.5",
6362
"autoprefixer": "^10.4.16",
64-
"eslint": "npm:[email protected]",
65-
"eslint-plugin-format": "^0.1.0",
66-
"eslint-plugin-react": "^7.33.2",
67-
"eslint-plugin-react-hooks": "^4.6.0",
68-
"eslint-plugin-react-refresh": "^0.4.5",
69-
"eslint-ts-patch": "^8.56.0-0",
70-
"fs-extra": "^11.2.0",
71-
"husky": "^8.0.3",
72-
"lint-staged": "^15.2.0",
63+
"eslint": "9.9.0",
64+
"eslint-plugin-format": "^0.1.2",
65+
"eslint-plugin-react-hooks": "5.1.0-rc-fb9a90fa48-20240614",
66+
"eslint-plugin-react-refresh": "^0.4.11",
67+
"husky": "^9.1.5",
68+
"lint-staged": "^15.2.9",
7369
"postcss": "^8.4.33",
7470
"react": "^18.2.0",
7571
"react-dom": "^18.2.0",
7672
"react-router-dom": "^6.21.2",
7773
"react-test-renderer": "^18.2.0",
7874
"rimraf": "^5.0.5",
7975
"serve": "^14.2.1",
80-
"tailwindcss": "^3.4.1",
81-
"tslib": "^2.6.2",
76+
"tailwindcss": "^3.4.10",
77+
"tslib": "^2.6.3",
8278
"typescript": "^5.3.3",
83-
"unplugin-auto-import": "^0.17.3",
84-
"vite": "^5.0.11",
85-
"vite-pages-theme-doc": "^4.1.7",
86-
"vite-plugin-dts": "^3.7.0",
87-
"vite-plugin-react-pages": "^4.1.6",
88-
"vite-tsconfig-paths": "^4.2.3",
89-
"vitest": "^1.2.0"
79+
"unplugin-auto-import": "^0.18.2",
80+
"vite": "^5.4.2",
81+
"vite-pages-theme-doc": "^5.0.0",
82+
"vite-plugin-dts": "^4.0.3",
83+
"vite-plugin-react-pages": "^5.0.0",
84+
"vite-tsconfig-paths": "^5.0.1",
85+
"vitest": "^2.0.5"
9086
},
9187
"lint-staged": {
92-
"*": "npm run lint-staged:lint"
88+
"*": "eslint --flag unstable_ts_config --fix"
9389
},
9490
"publishConfig": {
9591
"registry": "https://registry.npmjs.org",

0 commit comments

Comments
 (0)