From 9a99bc48e3e037642a7c4b5313110fc302aa57b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Mon, 30 May 2022 00:25:01 +0900 Subject: [PATCH] chore: enable reportUnusedDisableDirectives (#8384) --- .eslintrc.cjs | 3 ++- packages/plugin-vue/src/template.ts | 1 - .../src/node/__tests__/plugins/importGlob/fixture-a/index.ts | 1 - .../vite/src/node/__tests__/plugins/importGlob/parse.test.ts | 1 - packages/vite/src/node/plugins/css.ts | 4 +--- 5 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 629aedd122aae4..83650e4dd24926 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -159,5 +159,6 @@ module.exports = defineConfig({ 'no-restricted-globals': ['error', 'require', '__dirname', '__filename'] } } - ] + ], + reportUnusedDisableDirectives: true }) diff --git a/packages/plugin-vue/src/template.ts b/packages/plugin-vue/src/template.ts index 107dfc2d163495..6fcbefa056fefe 100644 --- a/packages/plugin-vue/src/template.ts +++ b/packages/plugin-vue/src/template.ts @@ -42,7 +42,6 @@ export async function transformTemplateAsModule( /** * transform the template directly in the main SFC module */ -// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function transformTemplateInMain( code: string, descriptor: SFCDescriptor, diff --git a/packages/vite/src/node/__tests__/plugins/importGlob/fixture-a/index.ts b/packages/vite/src/node/__tests__/plugins/importGlob/fixture-a/index.ts index 4fed8828e5f418..5a3f6d487ff154 100644 --- a/packages/vite/src/node/__tests__/plugins/importGlob/fixture-a/index.ts +++ b/packages/vite/src/node/__tests__/plugins/importGlob/fixture-a/index.ts @@ -1,6 +1,5 @@ import '../../../../../../types/importMeta' -/* eslint-disable @typescript-eslint/comma-dangle */ export interface ModuleType { name: string } diff --git a/packages/vite/src/node/__tests__/plugins/importGlob/parse.test.ts b/packages/vite/src/node/__tests__/plugins/importGlob/parse.test.ts index aaa03ebef8f8ef..7f9c181037b450 100644 --- a/packages/vite/src/node/__tests__/plugins/importGlob/parse.test.ts +++ b/packages/vite/src/node/__tests__/plugins/importGlob/parse.test.ts @@ -269,7 +269,6 @@ describe('parse negatives', async () => { }) it('template', async () => { - // eslint-disable-next-line no-template-curly-in-string expect( await runError('import.meta.glob(`hi ${hey}`)') ).toMatchInlineSnapshot( diff --git a/packages/vite/src/node/plugins/css.ts b/packages/vite/src/node/plugins/css.ts index a8112d48658091..c177e5a665f731 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -16,9 +16,7 @@ import colors from 'picocolors' import MagicString from 'magic-string' import type * as PostCSS from 'postcss' import type Sass from 'sass' -// We need to disable check of extraneous import which is buggy for stylus, -// and causes the CI tests fail, see: https://github.com/vitejs/vite/pull/2860 -import type Stylus from 'stylus' // eslint-disable-line node/no-extraneous-import +import type Stylus from 'stylus' import type Less from 'less' import type { Alias } from 'types/alias' import { formatMessages, transform } from 'esbuild'