From de4c139859e7523c7d9c4d736554e0a588c0dcfe Mon Sep 17 00:00:00 2001 From: wanjinhao1 <394959433@qq.com> Date: Fri, 30 Oct 2026 09:14:54 +0800 Subject: [PATCH] Fix #16368: stop exporting ESLINT_FLAGS so ESLint does not parse it as feature flags GNU make exports command-line variables as environment variables to recipes. ESLint 9.39+ reads the ESLINT_FLAGS environment variable to enable feature flags, so passing ESLINT_FLAGS='--quiet' on the make command line (as the CI lint retry does) made ESLint fail with "Unknown flag '--quiet'". Unexport the variable so it is only used to build the ESLint command-line options. --- tools/make/lib/lint/javascript/eslint.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/make/lib/lint/javascript/eslint.mk b/tools/make/lib/lint/javascript/eslint.mk index 49624a7a4ee4..66bcabd08846 100644 --- a/tools/make/lib/lint/javascript/eslint.mk +++ b/tools/make/lib/lint/javascript/eslint.mk @@ -36,6 +36,12 @@ eslint_flags := \ # Define user-supplied command-line options: ESLINT_FLAGS ?= +# Ensure the `ESLINT_FLAGS` variable is not exported to the environment of invoked commands: +# +# - ESLint 9.39+ reads the `ESLINT_FLAGS` environment variable to enable feature flags (e.g., `unstable_native_nodejs_ts_config`) and throws `Unknown flag` for anything unrecognized. +# - GNU `make` exports command-line variables as environment variables to recipes, so `make ESLINT_FLAGS=--quiet` would otherwise cause `--quiet` to be interpreted as a feature flag instead of a command-line option. +unexport ESLINT_FLAGS + ifeq ($(AUTOFIX),true) eslint_flags += --fix endif