From b07cf788c97f54d5a0ade0c9cc5c19fee862eb0f Mon Sep 17 00:00:00 2001 From: neobooru <50623835+neobooru@users.noreply.github.com> Date: Sun, 5 Feb 2023 01:09:52 +0100 Subject: [PATCH] Improve eslint --- .eslintrc.cjs | 43 +++++++++++++++++++++++-------------------- package.json | 3 ++- pnpm-lock.yaml | 4 +++- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 5d806f5..2b682c8 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,23 +1,26 @@ module.exports = { - "env": { - "browser": true, - "es2021": true - }, - "extends": [ - "eslint:recommended", - "plugin:vue/vue3-essential", - "plugin:@typescript-eslint/recommended" + env: { + browser: true, + es2021: true, + }, + extends: ["eslint:recommended", "plugin:vue/vue3-essential", "plugin:@typescript-eslint/recommended"], + parser: "vue-eslint-parser", + parserOptions: { + ecmaVersion: "latest", + parser: "@typescript-eslint/parser", + sourceType: "module", + }, + plugins: ["vue", "@typescript-eslint"], + rules: { + semi: ["error", "always"], + "no-undef": "off", + "@typescript-eslint/no-unused-vars": [ + "warn", + { + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + caughtErrorsIgnorePattern: "^_", + }, ], - "parserOptions": { - "ecmaVersion": "latest", - "parser": "@typescript-eslint/parser", - "sourceType": "module" - }, - "plugins": [ - "vue", - "@typescript-eslint" - ], - "rules": { - semi: ["error", "always"], - } + }, }; diff --git a/package.json b/package.json index 430ffd9..7bfd4d7 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "chokidar": "^3.5.3", "cross-env": "^7.0.3", "crx": "^5.0.1", - "eslint": "^8.28.0", + "eslint": "^8.32.0", "eslint-plugin-vue": "^9.9.0", "esno": "^0.16.3", "fs-extra": "^10.1.0", @@ -64,6 +64,7 @@ "vite": "^3.2.4", "vitest": "^0.25.3", "vue": "^3.2.45", + "vue-eslint-parser": "^9.1.0", "web-ext": "^7.5.0", "webextension-polyfill": "^0.10.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b3758f1..3996bd8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19,7 +19,7 @@ specifiers: chokidar: ^3.5.3 cross-env: ^7.0.3 crx: ^5.0.1 - eslint: ^8.28.0 + eslint: ^8.32.0 eslint-plugin-vue: ^9.9.0 esno: ^0.16.3 fs-extra: ^10.1.0 @@ -37,6 +37,7 @@ specifiers: vite: ^3.2.4 vitest: ^0.25.3 vue: ^3.2.45 + vue-eslint-parser: ^9.1.0 web-ext: ^7.5.0 webextension-polyfill: ^0.10.0 @@ -79,6 +80,7 @@ devDependencies: vite: 3.2.5_ovmyjmuuyckt3r3gpaexj2onji vitest: 0.25.8_jsdom@20.0.3+sass@1.57.1 vue: 3.2.45 + vue-eslint-parser: 9.1.0_eslint@8.32.0 web-ext: 7.5.0 webextension-polyfill: 0.10.0