Skip to content

fix: route .vue files to ESLint under qlty when the Vue layer is enabled - #215

Merged
sinemacula-ben merged 1 commit into
masterfrom
fix/vue-under-qlty
Nov 17, 2026
Merged

sinemacula-ben merged 1 commit into
masterfrom
fix/vue-under-qlty

Conversation

@sinemacula-ben

Copy link
Copy Markdown
Contributor

Closes #210.

Under qlty, ESLint never got .vue files. Its eslint plugin only takes JavaScript and TypeScript, and qlty has no vue file type, so a repo on the Vue layer linted no single-file components in the hooks, in CI or on qlty Cloud.

The fix is opt-in through the README rather than the shared source. Without the Vue layer's parser, ESLint can't parse a .vue file, so routing them for every consumer would break repos that have .vue files but don't use the layer.

Changes

  • README, ESLint through Qlty:
    • The Vue example now adds [file_types.vue] and widens [plugins.definitions.eslint] file_types.
    • Both examples now set package_file = "package.json" on the eslint plugin. The old snippet only set package_filters, and with no package file the sandbox never installs the shared package, so the config failed to load.
  • scripts/test-vue-policy.sh: builds a throwaway consumer from the README's Vue block verbatim, npm packs this repo into it, runs qlty check and asserts that vue/no-use-v-if-with-v-for and vue/require-v-for-key fire on a component. The tarball is named after its hash, so a local rerun can't pick up a stale qlty sandbox.
  • CI: a new vue-policy job in the Tests workflow.

Verification

  • The new script passes.
  • It fails against the README on master (the shared package isn't installed) and with the two routing blocks removed (the component isn't linted).
  • qlty check --all --no-cache, qlty fmt and qlty smells are clean.
  • PHPUnit (262) and Vitest (592) pass.

YAML has the same gap and is left for a separate change. The base layer applies comment-line-wrap to .yml, but qlty never hands YAML to ESLint either. Turning that on would change lint coverage for every consumer, so it needs its own test.

qlty's eslint plugin is only handed JavaScript and TypeScript, so a repo
on the Vue layer linted no single-file components. The README now gives
the file type and routing to add, plus the package_file the eslint
sandbox needs, and a consumer integration test runs that exact config.
@sinemacula-ben
sinemacula-ben merged commit 225ace7 into master Nov 17, 2026
22 checks passed
@sinemacula-ben
sinemacula-ben deleted the fix/vue-under-qlty branch November 17, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lint .vue files under qlty when the Vue layer is enabled

1 participant