You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Points to the local schema so your editor can validate and autocomplete this file
singleQuote
boolean
true
Uses single quotes instead of double quotes wherever possible
semi
boolean
true
Appends a semicolon at the end of every statement
printWidth
number
180
Maximum preferred line length before the formatter wraps code
tabWidth
number
2
Number of spaces per indentation level
trailingComma
string
"all"
Adds trailing commas in every position where they are syntactically valid (produces cleaner diffs)
.oxlintrc.json
If your app uses a different selector prefix (for example ngvpc), update the @angular-eslint/component-selector and @angular-eslint/directive-selector rules below.
Imports shared rule presets: stylelint-config-standard-scss for SCSS conventions and stylelint-config-recess-order for consistent property declaration order
ignoreFiles
Glob patterns for folders that Stylelint should skip entirely
rules
Per-rule severity overrides (see rule breakdown below)
Rules -- validation
Rule
Value
What it does
color-no-invalid-hex
true
Rejects malformed hex color values (e.g., #fff00z)
unit-no-unknown
true
Rejects unrecognized CSS units (e.g., 10pixels)
property-no-unknown
true
Rejects unrecognized CSS property names
Rules -- duplicate control
Rule
Value
What it does
declaration-block-no-duplicate-properties
true with ignore consecutive-duplicates-with-different-values
Flags duplicate properties in the same block, but allows consecutive duplicates that have different values (common for fallback declarations like color: #000; color: var(--text))
Rules -- style preference
Rule
Value
What it does
color-named
"never"
Disallows named colors like red or blue; forces hex, rgb, or hsl values instead
Rules -- disabled (set to null)
Rule
Why it is disabled
no-empty-source
Angular component styles are often empty files; this avoids false positives
no-descending-specificity
Frequently produces noise in Angular component-scoped styles
declaration-property-value-no-unknown
Has limited awareness of modern CSS features and custom properties
scss/no-global-function-names
Many SCSS codebases still use global functions like darken() or lighten()
scss/dollar-variable-pattern
Avoids enforcing a naming convention that may conflict with existing variable names
Glob patterns for folders excluded from all lint runs invoked through the vp CLI
staged
Maps file-glob patterns to one or more commands that run against staged files during a pre-commit check
Staged glob breakdown
Glob
Command(s)
What happens
*.ts
vp lint --fix
Lint staged TypeScript files with oxlint and auto-fix what it can
*.{json,html}
vp fmt
Format staged JSON and HTML files with oxfmt
*.html
eslint --fix
Run Angular template ESLint rules on staged HTML files and auto-fix
*.{css,scss}
vp fmt, then stylelint --fix
Format staged style files with oxfmt, then run Stylelint auto-fix
A single file can match multiple globs. For example, a staged .html file is both formatted (vp fmt) and linted (eslint --fix).
scripts/pre-commit
#!/bin/sh
npx vp staged
What this script does
Line
Description
#!/bin/sh
Shebang that tells the OS to run this script with the POSIX shell
npx vp staged
Invokes the vp staged command from vite-plus, which reads the staged section of vite.config.ts, resolves currently staged files, and runs the matching commands
This file is copied into .git/hooks/pre-commit by the postinstall script so that Git executes it automatically before every commit.
If everything is configured correctly, the pre-commit hook will run all staged-file checks. If any check fails with unfixable errors, the commit will be blocked.
How Pre-commit Works
When you run git commit, Git looks for an executable file at .git/hooks/pre-commit. If found, it runs that file before creating the commit.
The hook runs:
npx vp staged
vp staged follows this sequence:
Reads the staged section of vite.config.ts.
Resolves the list of currently staged files from Git.
Matches each staged file against the configured glob patterns.
Runs the corresponding command(s) for each match.
If any command exits with a non-zero code (unfixable errors), the commit is blocked. You must fix the reported issues, re-stage the files, and commit again.
Commands You Can Run
Report only (no file changes)
Command
What it checks
pnpm run lint
TypeScript and JavaScript lint issues
pnpm run lint:html
Angular HTML template lint issues
pnpm run lint:styles
CSS and SCSS lint issues
pnpm run format
Whether all files match the configured format
Auto-fix
Command
What it fixes
pnpm run lint:fix
Auto-fixable TypeScript and JavaScript lint issues
pnpm run lint:styles:fix
Auto-fixable CSS and SCSS lint issues
pnpm run format:fix
Reformats all files in place
Full project (all tools at once)
Command
Description
npx vp check
Runs all linters and format checks across the entire project