Skip to content

svelte-lint

Quality gate for a project's Svelte/JS frontend:

  • svelte-check — Svelte + TypeScript diagnostics / type-check (the highest-signal Svelte gate).
  • eslint — flat config + eslint-plugin-svelte.
  • prettierprettier --check formatting gate.

Each is a separate job, opt-out-able individually. All run on dev-tools (Node 22) and use the project-local tool versions: each job runs npm ci then npx <tool>, so the consumer must carry svelte-check / eslint (+ eslint-plugin-svelte) / prettier (+ prettier-plugin-svelte) and their configs (eslint.config.js, .prettierrc, svelte.config.js) as part of adopting this component.

Change-detected (unlike svelte-security). paths is required (no default).

Jobs

Job What it runs
svelte-check Per path: npm ci && npx svelte-check --output human $[[ inputs.svelte_check_args ]]
eslint Per path: npm ci && npx eslint $[[ inputs.eslint_paths ]]
prettier Per path: npm ci && npx prettier --check $[[ inputs.prettier_paths ]]

Inputs

Input Type Default Description
image string dev-tools:v0.1.2 Image with Node + npm.
stage string lint GitLab CI stage.
paths string (required) Space-separated frontend root(s).
if string '$CI_PIPELINE_SOURCE == "merge_request_event"' Gating rules:if:.
changes array ["**/*.svelte", "**/*.ts", "**/*.js", "**/*.css", "**/*.html", "**/package.json", "**/package-lock.json", "**/vite.config.*", "**/svelte.config.*", "**/tsconfig*.json", "**/eslint.config.*", "**/.eslintrc*", "**/.prettierrc*", ".gitlab-ci.yml"] Change-detection paths.
svelte_check_args string "" Extra arguments for svelte-check (e.g. --threshold warning).
eslint_paths string "." Target passed to eslint within each root.
prettier_paths string "." Target passed to prettier --check within each root.

Usage

include:
  - component: gitlab.com/phpboyscout/cicd/[email protected]
    inputs:
      paths: "pkg/studio/web"

See also