Guidance for working in this repo.
vite-vanilla-sass-lint is a Vite vanilla-JS + Sass starter template. It is a single static page: index.html mounts #app, and src/assets/js/main.js builds the DOM (.wrapper > main with h1 + logo img, and a footer link). Styling is src/assets/scss/main.scss (uses modern-normalize and an animated gradient). Linting is ESLint + Stylelint + HTMLHint + html-validate; tests use Vitest; pre-commit runs lint-staged via Husky.
- ESM, single quotes, semicolons, 2-space indent, Prettier-formatted.
- SCSS uses
@useand followsstylelint-config-standard-scss. - The test suite pins the rendered DOM contract in
src/assets/js/main.test.js:.wrapper main h1text isVite + Sass, No Fuss,.wrapper main img.logoalt isVite logo, and.wrapper footer small apoints to the repo. Preserve these when editingmain.js.
npm run dev(port 3000),npm run build,npm run previewnpm run lint,npm run lint:fix,npm run formatnpm run test:ci,npm run test:coveragenpm run analyze(bundle visualizer todist/stats.html)node scripts/screenshot.mjs <outDir>captures the page at desktop/tablet/mobile (needs Playwright + system Chrome; see theperf-auditskill).
A performance/accessibility/SEO/code-quality audit made these changes:
- Build (
vite.config.js):target: es2020, explicitcssMinify,cssCodeSplit: false(single CSS file),assetsInlineLimit: 4096,reportCompressedSize: false..browserslistrcnarrowed todefaults and fully supports es6-module+not dead. - Accessibility (
main.scss,main.js):prefers-reduced-motiondisables the gradient animation and logo hover transform;:focus-visibleoutline on the footer link; strongertext-shadowon.wrapperfor AA contrast; explicitwidth/heighton the logo img to prevent layout shift. - SEO (
index.html):robots,author,og:site_name,twitter:image:alt,modulepreloadfor the entry script, and a minimal JSON-LDSoftwareSourceCodeblock. Canonical/og:urlomitted (deployed origin not verifiable from repo). - Code quality (
eslint.config.js,main.test.js): promotedprefer-arrow-callback/prefer-templatetoerror, addedno-implicit-coercionandno-throw-literal; added tests for landmarks, single-h1, and non-empty logo alt.
Verified after changes: npm run lint, npm run test:ci (7/7), and npm run build all pass; visual diff vs baseline at three breakpoints showed only the intended heading text-shadow change with no layout regression.