Skip to content

fix(webapp): make the lint script work - #1237

Merged
peterthomassen merged 1 commit into
desec-io:mainfrom
acoseac:fix/webapp-lint-glob
Aug 18, 2026
Merged

fix(webapp): make the lint script work#1237
peterthomassen merged 1 commit into
desec-io:mainfrom
acoseac:fix/webapp-lint-glob

Conversation

@acoseac

@acoseac acoseac commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

npm run lint currently fails on main, before it lints anything:

$ npm run lint
> eslint --ignore-path .gitignore --no-fix src/**/*.{vue,js,json}

No files matching the pattern "src/modules/qrcode.vue" were found.

Why

The glob is unquoted, so the shell expands it and passes the results to eslint as explicit targets. One of them is src/modules/qrcode.vue — the vendored copy of the qrcode.vue library, which is a directory, not a file. Everything inside it is excluded via ignorePatterns: ['**/src/modules/**/*'] in .eslintrc.cjs, so eslint finds nothing to lint under a target it was explicitly given, and errors out.

The exclusion itself is correct; it's the shell expansion that trips over the directory name.

Fix

Quote the pattern so eslint expands it. That skips the directory, and has a second effect worth calling out: sh has no globstar, so src/**/* behaved as src/*/* and only ever reached one directory level. src/components/Field/ and src/views/Console/ — 31 files — were never linted at all. With eslint doing the globbing, ** is a real globstar:

  • before: 38 targets, one of which was the directory that caused the failure
  • after: 73 files actually linted, vendored code still excluded (verified: 0 files under src/modules/ are linted)

The added coverage surfaced exactly one pre-existing error, an unused and import in RecordDS.vue and RecordTLSA.vue. Removed here so the script exits clean; nothing else needed fixing.

Checks

  • npm run lint exits 0
  • npm run lint:fix produces no further changes
  • npm run build and npm test (4 passed) unaffected

Sidenote, not addressed here: nothing in .github/workflows/test.yml runs lint, which is presumably how this went unnoticed. Happy to add a step if you'd like it.

@peterthomassen peterthomassen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, nice catch!

`npm run lint` fails with

    No files matching the pattern "src/modules/qrcode.vue" were found.

The glob is unquoted, so the shell expands it and hands eslint the
vendored src/modules/qrcode.vue directory as an explicit target. Its
contents are excluded through ignorePatterns in .eslintrc.cjs, so eslint
finds nothing to lint there and exits with an error.

Quoting the pattern lets eslint expand it instead. That skips the
directory, and also applies `**` as a real globstar: sh has no globstar,
so the previous invocation only ever reached one directory level and
never linted src/components/Field/ or src/views/Console/. 73 files are
linted now instead of 37.

The added coverage surfaced one pre-existing error, an unused `and`
import in two record components, which is removed here so that the
script passes.
@peterthomassen
peterthomassen merged commit b23ee08 into desec-io:main Aug 18, 2026
18 of 21 checks passed
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.

2 participants