添加 Typescript/集成eslint和prettier2.patch
This commit is contained in:
46
Typescript/集成eslint和prettier2.patch
Normal file
46
Typescript/集成eslint和prettier2.patch
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
diff --git a/eslint.config.mjs b/eslint.config.mjs
|
||||||
|
index a7be3cf..d1eb034 100644
|
||||||
|
--- a/eslint.config.mjs
|
||||||
|
+++ b/eslint.config.mjs
|
||||||
|
@@ -2,17 +2,10 @@
|
||||||
|
|
||||||
|
import eslint from '@eslint/js';
|
||||||
|
import tseslint from 'typescript-eslint';
|
||||||
|
-import prettier from 'eslint-plugin-prettier';
|
||||||
|
+import prettierConfig from 'eslint-config-prettier';
|
||||||
|
|
||||||
|
export default tseslint.config(
|
||||||
|
eslint.configs.recommended,
|
||||||
|
tseslint.configs.recommended,
|
||||||
|
- {
|
||||||
|
- plugins: {
|
||||||
|
- prettier,
|
||||||
|
- },
|
||||||
|
- rules: {
|
||||||
|
- 'prettier/prettier': 'error',
|
||||||
|
- },
|
||||||
|
- }
|
||||||
|
+ prettierConfig
|
||||||
|
);
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/package.json b/package.json
|
||||||
|
index 30b1f40..7bc29f9 100644
|
||||||
|
--- a/package.json
|
||||||
|
+++ b/package.json
|
||||||
|
@@ -12,7 +12,7 @@
|
||||||
|
"tauri:dev": "tauri dev",
|
||||||
|
"tauri:build": "tauri build",
|
||||||
|
"format": "prettier --write \"{src,tests}/**/*.{js,jsx,ts,tsx}\"",
|
||||||
|
- "prepare": "husky install"
|
||||||
|
+ "prepare": "husky install"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@emotion/react": "^11.14.0",
|
||||||
|
@@ -57,6 +57,7 @@
|
||||||
|
"@unocss/reset": "^65.4.3",
|
||||||
|
"@vitejs/plugin-react": "^4.3.4",
|
||||||
|
"eslint": "^9.23.0",
|
||||||
|
+ "eslint-config-prettier": "^10.1.1",
|
||||||
|
"eslint-plugin-prettier": "^5.2.6",
|
||||||
|
"husky": "^9.1.7",
|
||||||
|
"lint-staged": "^15.5.0",
|
||||||
Reference in New Issue
Block a user