lint - speced/respec GitHub Wiki
Type: boolean | LintRules
Default: true
Controls ReSpec's built-in linter. When enabled, the linter checks the document for common mistakes and best practice violations, showing warnings in the document header.
var respecConfig = {
// lint: true is the default — no need to set it explicitly
};var respecConfig = {
lint: false,
};var respecConfig = {
lint: {
"no-http-props": false, // disable (was on by default)
"no-unused-dfns": true, // enable (was off by default)
"check-punctuation": "warn", // warn instead of error
},
};| Rule | Default | What it checks |
|---|---|---|
a11y |
false |
Accessibility issues |
check-charset |
false |
Missing or duplicate <meta charset="utf-8">
|
check-internal-slots |
false |
Internal slot references missing the . separator (|obj|.[[slot]]) |
check-punctuation |
false |
Missing punctuation at end of paragraphs |
informative-dfn |
false |
Definitions in informative sections |
local-refs-exist |
true |
Local #fragment links that don't resolve |
no-captionless-tables |
true |
Tables without a <caption>
|
no-dfn-in-abstract |
false |
<dfn> elements in abstract, SotD, or other unnumbered sections |
no-headingless-sections |
true |
Sections without a heading |
no-http-props |
true |
Non-HTTPS URLs in config |
no-unused-dfns |
false |
Defined terms never referenced |
no-unused-vars |
false |
WebIDL variables never used |
privsec-section |
false |
Missing Privacy and Security Considerations section |
wpt-tests-exist |
false |
data-tests attributes pointing to non-existent WPT tests |
Use data-lint-ignore to suppress a specific warning on an element:
<table data-lint-ignore="no-captionless-tables">
<tr><td>data</td></tr>
</table>- Rule severity can be
true(error),"warn"(warning), orfalse(disabled) - Linting errors appear as red banners in the document header; warnings appear as yellow