From d9b83e4e8215168dda03b04168d7e30ce5fe779f Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 10 Jul 2023 18:52:51 +0800 Subject: Fix ts type errors. --- FrontEnd/.eslintrc.js | 39 ----------------------------------- FrontEnd/.eslintrc.mjs | 39 +++++++++++++++++++++++++++++++++++ FrontEnd/src/@types/non-ts-files.d.ts | 4 ++++ 3 files changed, 43 insertions(+), 39 deletions(-) delete mode 100644 FrontEnd/.eslintrc.js create mode 100644 FrontEnd/.eslintrc.mjs create mode 100644 FrontEnd/src/@types/non-ts-files.d.ts (limited to 'FrontEnd') diff --git a/FrontEnd/.eslintrc.js b/FrontEnd/.eslintrc.js deleted file mode 100644 index 61db0dd4..00000000 --- a/FrontEnd/.eslintrc.js +++ /dev/null @@ -1,39 +0,0 @@ -export default { - root: true, - env: { - browser: true, - es2022: true, - }, - extends: [ - "eslint:recommended", - "plugin:react/recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - "plugin:prettier/recommended", - "plugin:react-hooks/recommended", - ], - parser: "@typescript-eslint/parser", - parserOptions: { - tsconfigRootDir: __dirname, - project: ["./tsconfig.json"], - }, - plugins: ["react", "@typescript-eslint", "react-hooks"], - settings: { - react: { - version: "detect", - }, - }, - rules: { - "react/prop-types": "off", - "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }], - "@typescript-eslint/explicit-function-return-type": [ - "warn", - { - allowExpressions: true, - allowTypedFunctionExpressions: true, - allowHigherOrderFunctions: true, - }, - ], - }, -}; diff --git a/FrontEnd/.eslintrc.mjs b/FrontEnd/.eslintrc.mjs new file mode 100644 index 00000000..61db0dd4 --- /dev/null +++ b/FrontEnd/.eslintrc.mjs @@ -0,0 +1,39 @@ +export default { + root: true, + env: { + browser: true, + es2022: true, + }, + extends: [ + "eslint:recommended", + "plugin:react/recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "plugin:prettier/recommended", + "plugin:react-hooks/recommended", + ], + parser: "@typescript-eslint/parser", + parserOptions: { + tsconfigRootDir: __dirname, + project: ["./tsconfig.json"], + }, + plugins: ["react", "@typescript-eslint", "react-hooks"], + settings: { + react: { + version: "detect", + }, + }, + rules: { + "react/prop-types": "off", + "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }], + "@typescript-eslint/explicit-function-return-type": [ + "warn", + { + allowExpressions: true, + allowTypedFunctionExpressions: true, + allowHigherOrderFunctions: true, + }, + ], + }, +}; diff --git a/FrontEnd/src/@types/non-ts-files.d.ts b/FrontEnd/src/@types/non-ts-files.d.ts new file mode 100644 index 00000000..9f43dc9b --- /dev/null +++ b/FrontEnd/src/@types/non-ts-files.d.ts @@ -0,0 +1,4 @@ +declare module "*.png" { + const url: string; + export default url; +} -- cgit v1.2.3