no-useless-mustaches
Angular templatesHTMLVue / SvelteVue / Sveltesuspiciousno fixdefault: warnhtml/eslint-plugin-svelte-recommended
What it does
Section titled “What it does”Reports a string literal in { } ({"text"}).
Why it matters
Section titled “Why it matters”It is only text, so the braces and the quotes add noise and suggest a value that is computed.
To fix, write the text without the braces.
Example
Section titled “Example”...<C>{#snippet children(x)}{x}{/snippet}</C>...<p>{"text"} {'it'} {`tpl`} {`a${b}`} {"a'b"} {text}</p>......<C>{#snippet children(x)}{x}{/snippet}</C>...<p>{"text"} {'it'} {`tpl`} {`a${b}`} {"a'b"} {text}</p>...Configuration
Section titled “Configuration”angular: lint: rules: no-useless-mustaches: warn # off, warn (default), errorhtml: lint: rules: no-useless-mustaches: warn # off, warn (default), errorsvelte: lint: rules: no-useless-mustaches: warn # off, warn (default), errorvue: lint: rules: no-useless-mustaches: warn # off, warn (default), errorEnabled by the presets: html/eslint-plugin-svelte-recommended.
Suppress one line with sudsy-disable-next-line no-useless-mustaches 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-useless-mustaches |
full |