no-unknown-style-directive-property
Angular templatesHTMLVue / SvelteVue / Sveltecorrectnessno fixdefault: warnhtml/eslint-plugin-svelte-recommended
What it does
Section titled “What it does”Reports a style: directive that names a property CSS does not know (style:marginLeft). Custom properties (style:--x) and vendor-prefixed ones are not reported. The property table is the CSS language’s.
Why it matters
Section titled “Why it matters”CSS properties are lowercase and hyphenated; a camelCase name is ignored by the browser, so the style does not apply.
To fix, write the property name in CSS form (style:margin-left).
Example
Section titled “Example”...<C>{#snippet children(x)}{x}{/snippet}</C><p style:marginLeft="1px" style:margin-left="1px" style:--x="1"></p>......<C>{#snippet children(x)}{x}{/snippet}</C><p style:marginLeft="1px" style:margin-left="1px" style:--x="1"></p>...Configuration
Section titled “Configuration”angular: lint: rules: no-unknown-style-directive-property: warn # off, warn (default), errorhtml: lint: rules: no-unknown-style-directive-property: warn # off, warn (default), errorsvelte: lint: rules: no-unknown-style-directive-property: warn # off, warn (default), errorvue: lint: rules: no-unknown-style-directive-property: warn # off, warn (default), errorEnabled by the presets: html/eslint-plugin-svelte-recommended.
Suppress one line with sudsy-disable-next-line no-unknown-style-directive-property in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| eslint-plugin-svelte | no-unknown-style-directive-property |
full |