From 50067178036d5b4f73638ac32344848d594edb97 Mon Sep 17 00:00:00 2001 From: xingyu Date: Wed, 21 Jun 2023 11:07:33 +0800 Subject: [PATCH] chore: eslint (cherry picked from commit 37c41aeecc509903518f9fa1d8db14239968ea8b) --- .eslintrc.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5efe82fd..5a7245ac 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,6 +1,4 @@ -// @ts-check -const { defineConfig } = require('eslint-define-config') -module.exports = defineConfig({ +module.exports = { root: true, env: { browser: true, @@ -21,7 +19,6 @@ module.exports = defineConfig({ extends: ['plugin:vue/vue3-recommended', 'prettier', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'], rules: { 'vue/script-setup-uses-vars': 'error', - 'vue/no-reserved-component-names': 'off', '@typescript-eslint/ban-ts-ignore': 'off', '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/no-explicit-any': 'off', @@ -34,8 +31,20 @@ module.exports = defineConfig({ '@typescript-eslint/ban-types': 'off', '@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-unused-vars': 'error', - 'no-unused-vars': 'error', + '@typescript-eslint/no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_' + } + ], + 'no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_' + } + ], 'space-before-function-paren': 'off', 'vue/attributes-order': 'off', @@ -61,4 +70,4 @@ module.exports = defineConfig({ ], 'vue/multi-word-component-names': 'off' } -}) +}