build: eslint plugin react-refresh

This commit is contained in:
AkaraChen 2024-10-22 13:49:39 +08:00
parent 0b8c896481
commit 3d165ec7d9
3 changed files with 18 additions and 5 deletions

View File

@ -7,6 +7,7 @@ import { fileURLToPath } from 'node:url'
import js from '@eslint/js' import js from '@eslint/js'
import { FlatCompat } from '@eslint/eslintrc' import { FlatCompat } from '@eslint/eslintrc'
import globals from 'globals' import globals from 'globals'
import reactRefresh from "eslint-plugin-react-refresh"
const __filename = fileURLToPath(import.meta.url) const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename) const __dirname = path.dirname(__filename)
@ -172,4 +173,16 @@ export default combine(
}, },
}, },
}, },
{
files: [
GLOB_TSX,
GLOB_JSX,
],
plugins: {
"react-refresh": reactRefresh,
},
rules: {
"react-refresh/only-export-components": "warn",
},
}
) )

View File

@ -152,7 +152,7 @@
"eslint": "^9.13.0", "eslint": "^9.13.0",
"eslint-config-next": "^15.0.0-canary.202", "eslint-config-next": "^15.0.0-canary.202",
"eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.12", "eslint-plugin-react-refresh": "^0.4.13",
"eslint-plugin-storybook": "^0.9.0", "eslint-plugin-storybook": "^0.9.0",
"husky": "^8.0.3", "husky": "^8.0.3",
"jest": "^29.7.0", "jest": "^29.7.0",

View File

@ -393,7 +393,7 @@ importers:
specifier: ^5.0.0 specifier: ^5.0.0
version: 5.0.0(eslint@9.13.0(jiti@1.21.6)) version: 5.0.0(eslint@9.13.0(jiti@1.21.6))
eslint-plugin-react-refresh: eslint-plugin-react-refresh:
specifier: ^0.4.12 specifier: ^0.4.13
version: 0.4.13(eslint@9.13.0(jiti@1.21.6)) version: 0.4.13(eslint@9.13.0(jiti@1.21.6))
eslint-plugin-storybook: eslint-plugin-storybook:
specifier: ^0.9.0 specifier: ^0.9.0
@ -12822,7 +12822,7 @@ snapshots:
debug: 4.3.7 debug: 4.3.7
enhanced-resolve: 5.17.1 enhanced-resolve: 5.17.1
eslint: 9.13.0(jiti@1.21.6) eslint: 9.13.0(jiti@1.21.6)
eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.21.6))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@9.13.0(jiti@1.21.6)) eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.21.6))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.21.6))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import-x@4.3.1(eslint@9.13.0(jiti@1.21.6))(typescript@4.9.5))(eslint-plugin-import@2.31.0)(eslint@9.13.0(jiti@1.21.6)))(eslint@9.13.0(jiti@1.21.6))
fast-glob: 3.3.2 fast-glob: 3.3.2
get-tsconfig: 4.8.1 get-tsconfig: 4.8.1
is-bun-module: 1.2.1 is-bun-module: 1.2.1
@ -12840,7 +12840,7 @@ snapshots:
dependencies: dependencies:
eslint: 9.13.0(jiti@1.21.6) eslint: 9.13.0(jiti@1.21.6)
eslint-module-utils@2.12.0(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.21.6))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@9.13.0(jiti@1.21.6)): eslint-module-utils@2.12.0(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.21.6))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.21.6))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import-x@4.3.1(eslint@9.13.0(jiti@1.21.6))(typescript@4.9.5))(eslint-plugin-import@2.31.0)(eslint@9.13.0(jiti@1.21.6)))(eslint@9.13.0(jiti@1.21.6)):
dependencies: dependencies:
debug: 3.2.7 debug: 3.2.7
optionalDependencies: optionalDependencies:
@ -12896,7 +12896,7 @@ snapshots:
doctrine: 2.1.0 doctrine: 2.1.0
eslint: 9.13.0(jiti@1.21.6) eslint: 9.13.0(jiti@1.21.6)
eslint-import-resolver-node: 0.3.9 eslint-import-resolver-node: 0.3.9
eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.21.6))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@9.13.0(jiti@1.21.6)) eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.21.6))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.11.0(eslint@9.13.0(jiti@1.21.6))(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import-x@4.3.1(eslint@9.13.0(jiti@1.21.6))(typescript@4.9.5))(eslint-plugin-import@2.31.0)(eslint@9.13.0(jiti@1.21.6)))(eslint@9.13.0(jiti@1.21.6))
hasown: 2.0.2 hasown: 2.0.2
is-core-module: 2.15.1 is-core-module: 2.15.1
is-glob: 4.0.3 is-glob: 4.0.3