From cb59be9c5bf3958faae4b21d49de0522a14b6281 Mon Sep 17 00:00:00 2001 From: hieu-w Date: Tue, 13 Aug 2024 11:18:33 +0700 Subject: [PATCH] Update Eslint --- .eslintrc.js | 20 ++++++++++++--- .vscode/settings.json | 1 + demo/vue-app-new/.eslintrc.js | 45 ++++++---------------------------- demo/vue-app-new/tsconfig.json | 6 +---- 4 files changed, 27 insertions(+), 45 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index e3210ce62..733f61c2f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,11 +2,12 @@ require("@rushstack/eslint-patch/modern-module-resolution"); module.exports = { root: true, - extends: ["@toruslabs/eslint-config-typescript"], - parser: "@typescript-eslint/parser", + extends: ["@toruslabs/vue"], + parser: "vue-eslint-parser", parserOptions: { + parser: "@typescript-eslint/parser", sourceType: "module", - ecmaVersion: 11, + ecmaVersion: 2022, project: "./tsconfig.json", }, ignorePatterns: ["*.config.js", "*.d.ts", ".eslintrc.js"], @@ -16,4 +17,17 @@ module.exports = { node: true, mocha: true, }, + rules: { + camelcase: 0, + "import/extensions": [ + "error", + "ignorePackages", + { + js: "never", + jsx: "never", + ts: "never", + tsx: "never", + }, + ], + } }; diff --git a/.vscode/settings.json b/.vscode/settings.json index 17c2f427d..78a7e53c3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,5 @@ { + "editor.tabSize": 2, "editor.codeActionsOnSave": { "source.fixAll": "explicit" }, diff --git a/demo/vue-app-new/.eslintrc.js b/demo/vue-app-new/.eslintrc.js index 8ba55e3c0..659d5f5ea 100644 --- a/demo/vue-app-new/.eslintrc.js +++ b/demo/vue-app-new/.eslintrc.js @@ -4,38 +4,20 @@ module.exports = { root: true, extends: ["@toruslabs/vue"], parser: "vue-eslint-parser", + ignorePatterns: ["*.config.js", ".eslintrc.js"], parserOptions: { parser: "@typescript-eslint/parser", - ecmaVersion: 2022, sourceType: "module", + ecmaVersion: 2022, project: "./tsconfig.json", }, - ignorePatterns: ["*.cjs", "*.config.js", "vite.config.ts", "importLocales.js", "__generated__", ".eslintrc.js", "crisp.js"], + env: { + browser: true, + node: true, + mocha: true, + }, rules: { - "no-console": 0, - "vuejs-accessibility/form-control-has-label": 0, - "@typescript-eslint/no-explicit-any": 1, - "import/order": 0, - "class-methods-use-this": 0, camelcase: 0, - "vue/multi-word-component-names": 0, - "@typescript-eslint/naming-convention": [ - "error", - { - selector: "typeLike", - format: ["camelCase", "UPPER_CASE", "PascalCase"], - }, - ], - "mocha/no-global-tests": ["off"], - "prettier/prettier": [ - 2, - { - singleQuote: false, - printWidth: 150, - semi: true, - trailingComma: "es5", - }, - ], "import/extensions": [ "error", "ignorePackages", @@ -46,16 +28,5 @@ module.exports = { tsx: "never", }, ], - "no-underscore-dangle": 0, - "no-restricted-exports": 0, - "no-param-reassign": [2, { props: false }], - "vue/v-on-event-hyphenation": 0, - }, - settings: { - "import/resolver": { - typescript: { - project: "./tsconfig.json", - }, - }, }, -}; +}; \ No newline at end of file diff --git a/demo/vue-app-new/tsconfig.json b/demo/vue-app-new/tsconfig.json index 1f56b1a4f..4290d014c 100644 --- a/demo/vue-app-new/tsconfig.json +++ b/demo/vue-app-new/tsconfig.json @@ -25,11 +25,7 @@ "scripthost" ] }, - "include": [ - "src/*.vue", - "src/*.ts", - "src/*.tsx" - ], + "include": ["src"], "exclude": [ "node_modules" ]