chore: optimize pnpm version management and migrate from next lint to eslint cli (#24514)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
npm add -g pnpm@10.15.0
|
corepack enable
|
||||||
cd web && pnpm install
|
cd web && pnpm install
|
||||||
pipx install uv
|
pipx install uv
|
||||||
|
|
||||||
|
@@ -9,6 +9,7 @@ import tailwind from 'eslint-plugin-tailwindcss'
|
|||||||
import reactHooks from 'eslint-plugin-react-hooks'
|
import reactHooks from 'eslint-plugin-react-hooks'
|
||||||
import sonar from 'eslint-plugin-sonarjs'
|
import sonar from 'eslint-plugin-sonarjs'
|
||||||
import oxlint from 'eslint-plugin-oxlint'
|
import oxlint from 'eslint-plugin-oxlint'
|
||||||
|
import next from '@next/eslint-plugin-next'
|
||||||
|
|
||||||
// import reactRefresh from 'eslint-plugin-react-refresh'
|
// import reactRefresh from 'eslint-plugin-react-refresh'
|
||||||
|
|
||||||
@@ -63,12 +64,14 @@ export default combine(
|
|||||||
}),
|
}),
|
||||||
unicorn(),
|
unicorn(),
|
||||||
node(),
|
node(),
|
||||||
// use nextjs config will break @eslint/config-inspector
|
// Next.js configuration
|
||||||
// use `ESLINT_CONFIG_INSPECTOR=true pnpx @eslint/config-inspector` to check the config
|
|
||||||
// ...process.env.ESLINT_CONFIG_INSPECTOR
|
|
||||||
// ? []
|
|
||||||
{
|
{
|
||||||
|
plugins: {
|
||||||
|
'@next/next': next,
|
||||||
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
...next.configs.recommended.rules,
|
||||||
|
...next.configs['core-web-vitals'].rules,
|
||||||
// performance issue, and not used.
|
// performance issue, and not used.
|
||||||
'@next/next/no-html-link-for-pages': 'off',
|
'@next/next/no-html-link-for-pages': 'off',
|
||||||
},
|
},
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
"start": "cp -r .next/static .next/standalone/.next/static && cp -r public .next/standalone/public && cross-env PORT=$npm_config_port HOSTNAME=$npm_config_host node .next/standalone/server.js",
|
"start": "cp -r .next/static .next/standalone/.next/static && cp -r public .next/standalone/public && cross-env PORT=$npm_config_port HOSTNAME=$npm_config_host node .next/standalone/server.js",
|
||||||
"lint": "pnpx oxlint && pnpm eslint --cache --cache-location node_modules/.cache/eslint/.eslint-cache",
|
"lint": "pnpx oxlint && pnpm eslint --cache --cache-location node_modules/.cache/eslint/.eslint-cache",
|
||||||
"lint-only-show-error": "pnpx oxlint && pnpm eslint --cache --cache-location node_modules/.cache/eslint/.eslint-cache --quiet",
|
"lint-only-show-error": "pnpx oxlint && pnpm eslint --cache --cache-location node_modules/.cache/eslint/.eslint-cache --quiet",
|
||||||
"fix": "next lint --fix",
|
"fix": "eslint --fix .",
|
||||||
"eslint-fix": "eslint --cache --cache-location node_modules/.cache/eslint/.eslint-cache --fix",
|
"eslint-fix": "eslint --cache --cache-location node_modules/.cache/eslint/.eslint-cache --fix",
|
||||||
"eslint-fix-only-show-error": "eslint --cache --cache-location node_modules/.cache/eslint/.eslint-cache --fix --quiet",
|
"eslint-fix-only-show-error": "eslint --cache --cache-location node_modules/.cache/eslint/.eslint-cache --fix --quiet",
|
||||||
"eslint-complexity": "eslint --rule 'complexity: [error, {max: 15}]' --quiet",
|
"eslint-complexity": "eslint --rule 'complexity: [error, {max: 15}]' --quiet",
|
||||||
@@ -103,14 +103,14 @@
|
|||||||
"mime": "^4.0.4",
|
"mime": "^4.0.4",
|
||||||
"mitt": "^3.0.1",
|
"mitt": "^3.0.1",
|
||||||
"negotiator": "^0.6.3",
|
"negotiator": "^0.6.3",
|
||||||
"next": "~15.3.5",
|
"next": "15.5.0",
|
||||||
"next-themes": "^0.4.3",
|
"next-themes": "^0.4.3",
|
||||||
"pinyin-pro": "^3.25.0",
|
"pinyin-pro": "^3.25.0",
|
||||||
"qrcode.react": "^4.2.0",
|
"qrcode.react": "^4.2.0",
|
||||||
"qs": "^6.13.0",
|
"qs": "^6.13.0",
|
||||||
"react": "~19.1.0",
|
"react": "19.1.1",
|
||||||
"react-18-input-autosize": "^3.0.0",
|
"react-18-input-autosize": "^3.0.0",
|
||||||
"react-dom": "~19.1.0",
|
"react-dom": "19.1.1",
|
||||||
"react-easy-crop": "^5.1.0",
|
"react-easy-crop": "^5.1.0",
|
||||||
"react-error-boundary": "^4.1.2",
|
"react-error-boundary": "^4.1.2",
|
||||||
"react-headless-pagination": "^1.1.6",
|
"react-headless-pagination": "^1.1.6",
|
||||||
@@ -161,9 +161,9 @@
|
|||||||
"@happy-dom/jest-environment": "^17.4.4",
|
"@happy-dom/jest-environment": "^17.4.4",
|
||||||
"@mdx-js/loader": "^3.1.0",
|
"@mdx-js/loader": "^3.1.0",
|
||||||
"@mdx-js/react": "^3.1.0",
|
"@mdx-js/react": "^3.1.0",
|
||||||
"@next/bundle-analyzer": "^15.4.1",
|
"@next/bundle-analyzer": "15.5.0",
|
||||||
"@next/eslint-plugin-next": "~15.4.5",
|
"@next/eslint-plugin-next": "15.5.0",
|
||||||
"@next/mdx": "~15.3.5",
|
"@next/mdx": "15.5.0",
|
||||||
"@rgrove/parse-xml": "^4.1.0",
|
"@rgrove/parse-xml": "^4.1.0",
|
||||||
"@storybook/addon-essentials": "8.5.0",
|
"@storybook/addon-essentials": "8.5.0",
|
||||||
"@storybook/addon-interactions": "8.5.0",
|
"@storybook/addon-interactions": "8.5.0",
|
||||||
@@ -185,8 +185,8 @@
|
|||||||
"@types/negotiator": "^0.6.3",
|
"@types/negotiator": "^0.6.3",
|
||||||
"@types/node": "18.15.0",
|
"@types/node": "18.15.0",
|
||||||
"@types/qs": "^6.9.16",
|
"@types/qs": "^6.9.16",
|
||||||
"@types/react": "~19.1.8",
|
"@types/react": "19.1.11",
|
||||||
"@types/react-dom": "~19.1.6",
|
"@types/react-dom": "19.1.7",
|
||||||
"@types/react-slider": "^1.3.6",
|
"@types/react-slider": "^1.3.6",
|
||||||
"@types/react-syntax-highlighter": "^15.5.13",
|
"@types/react-syntax-highlighter": "^15.5.13",
|
||||||
"@types/react-window": "^1.8.8",
|
"@types/react-window": "^1.8.8",
|
||||||
@@ -200,7 +200,7 @@
|
|||||||
"code-inspector-plugin": "^0.18.1",
|
"code-inspector-plugin": "^0.18.1",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^9.32.0",
|
"eslint": "^9.32.0",
|
||||||
"eslint-config-next": "~15.4.5",
|
"eslint-config-next": "15.5.0",
|
||||||
"eslint-plugin-oxlint": "^1.6.0",
|
"eslint-plugin-oxlint": "^1.6.0",
|
||||||
"eslint-plugin-react-hooks": "^5.1.0",
|
"eslint-plugin-react-hooks": "^5.1.0",
|
||||||
"eslint-plugin-react-refresh": "^0.4.19",
|
"eslint-plugin-react-refresh": "^0.4.19",
|
||||||
@@ -223,8 +223,8 @@
|
|||||||
"uglify-js": "^3.19.3"
|
"uglify-js": "^3.19.3"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"@types/react": "~19.1.8",
|
"@types/react": "19.1.11",
|
||||||
"@types/react-dom": "~19.1.6",
|
"@types/react-dom": "19.1.7",
|
||||||
"string-width": "4.2.3"
|
"string-width": "4.2.3"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
|
1121
web/pnpm-lock.yaml
generated
1121
web/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user