From 33ba630f6a57565bb539183810efa10ea237aee5 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Thu, 26 Feb 2026 14:17:11 +0000 Subject: [PATCH] refactor: centralize ESLint file targeting within `eslint.config.mjs` to process only TypeScript files and ignore JavaScript files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is needed as the glob is no longer being parsed from the CLI. ``` Run pnpm lint --cache-strategy content > @angular/devkit-repo@22.0.0-next.0 lint /home/runner/work/angular-cli/angular-cli > eslint --cache --max-warnings=0 "**/*.@(ts|mts|cts)" --cache-strategy content Oops! Something went wrong! :( ESLint: 10.0.2 No files matching the pattern "**/*.@(ts|mts|cts)" were found. Please check for typing mistakes in the pattern.  ELIFECYCLE  Command failed with exit code 2. ``` --- eslint.config.mjs | 8 +++++++- package.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 89f9fa72243b..cd0a12c4aa6d 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -10,9 +10,9 @@ import { fixupConfigRules, fixupPluginRules } from '@eslint/compat'; import { FlatCompat } from '@eslint/eslintrc'; import js from '@eslint/js'; import stylistic from '@stylistic/eslint-plugin'; +import header from '@tony.ganchev/eslint-plugin-header'; import typescriptEslint from '@typescript-eslint/eslint-plugin'; import tsParser from '@typescript-eslint/parser'; -import header from '@tony.ganchev/eslint-plugin-header'; import _import from 'eslint-plugin-import'; import globals from 'globals'; @@ -23,8 +23,14 @@ const compat = new FlatCompat({ }); export default [ + { + files: ['**/*.ts', '**/*.mts', '**/*.cts'], + }, { ignores: [ + '**/*.js', + '**/*.mjs', + '**/*.cjs', '**/bazel-out', '**/dist-schema', 'goldens/public-api', diff --git a/package.json b/package.json index d7d2d017e354..1675bd17610d 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "test": "bazel test //packages/...", "build": "pnpm -s admin build", "build-schema": "bazel build //... --build_tag_filters schema --symlink_prefix dist-schema/", - "lint": "eslint --cache --max-warnings=0 \"**/*.@(ts|mts|cts)\"", + "lint": "eslint --cache --max-warnings=0", "templates": "pnpm -s admin templates", "validate": "pnpm -s admin validate", "postinstall": "husky",