Skip to content

Planner: ESLint lint is skipped when a changed .vue/.svelte/.md file is a type the ESLint config adds #241

Closed

Description

@FredApps

Description

narrowGateChecks decides whether an ESLint directory target (eslint src) covers a changed file by its extension, using only the JavaScript/TypeScript set (ESLINT_EXTENSIONS) or --ext. ESLint itself lints every file under a directory target that the config's files patterns reach (flat config) or that an eslintrc overrides[].files names. So when the config adds a file type, such as eslint-plugin-vue's flat/recommended (**/*.vue), @eslint/markdown or svelte-eslint-parser, a change to that type is treated as "not covered" and the lint check is skipped.

Impact

High, a wrongful skip. A Vue, Svelte or Markdown change that breaks lint passes the gate because the lint check never runs. That breaks the fail-closed rule: a skip must never hide a failure the real command would report.

Repro

const scripts = { lint: "eslint src" };
narrowGateChecks(discoverGateChecks(scripts).checks, {
  scripts,
  changes: [{ path: "src/App.vue", status: "modified" }],
  read: (p) => ({ "eslint.config.js": 'import vue from "eslint-plugin-vue";\nexport default [...vue.configs["flat/recommended"]];' })[p],
});

Failing output (upstream/main 40aa308)

src/App.vue lint SKIP eslint src | no changed file is in src

Expected: the check runs, for example NARROWED eslint src/App.vue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions