From f215db87e305cf3a996c363bb66d18f49d522cbc Mon Sep 17 00:00:00 2001 From: AkaraChen Date: Tue, 22 Oct 2024 11:36:42 +0800 Subject: [PATCH] build: fix eslint undef --- web/eslint.config.mjs | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/web/eslint.config.mjs b/web/eslint.config.mjs index c97b05fab4..3406f3ddcf 100644 --- a/web/eslint.config.mjs +++ b/web/eslint.config.mjs @@ -82,8 +82,10 @@ export default combine( }), unicorn(), node(), - // TODO: remove this when upgrade to nextjs 15 - compat.extends('next'), + ...process.env.ESLINT_CONFIG_INSPECTOR + ? [] + // TODO: remove this when upgrade to nextjs 15 + : [compat.extends('next')], { ignores: [ '**/node_modules/*', @@ -130,8 +132,16 @@ export default combine( // antfu migrate to eslint-plugin-unused-imports "unused-imports/no-unused-vars": "warn", "unused-imports/no-unused-imports": "warn", + }, - "no-undef": "error", + languageOptions: { + globals: { + ...globals.browser, + ...globals.es2025, + ...globals.node, + 'React': 'readable', + 'JSX': 'readable', + } } }, storybook, @@ -157,24 +167,8 @@ export default combine( ...globals.browser, ...globals.es2021, ...globals.node, - ...globals.jest + ...globals.jest, }, }, }, - { - files: [ - GLOB_JSX, - GLOB_TSX, - '**/hooks/*' - ], - languageOptions: { - globals: { - ...globals.browser, - ...globals.es2025, - ...globals.node, - 'React': 'readable', - 'JSX': 'readable', - } - } - } )