ember-template-lint
ember-template-lint copied to clipboard
embedded templates using single quotes instead of double quotes
I recently bumped ember-template-lint from v4 to v5.
I ran yarn ember-template-lint tests/ --fix and it formatted all embedded templates in our test files.
Before the change, our test code looked like this:
await render(hbs`<EmberTsAccountSettings$SelectInput
@value="uk"
@placeholder="Choose one..."
/>`);
After running --fix, it change the double quotes to single quotes
await render(hbs`<EmberTsAccountSettings$SelectInput
@value='uk'
@placeholder='Choose one...'
/>`);
Our templates use double quotes and we'd expect our embedded templates to be the same. I don't know if it matters, but this is our .prettierrc.js
:
module.exports = {
printWidth: 120,
arrowParens: 'always',
singleQuote: true,
trailingComma: 'none',
overrides: [
{
files: '*.hbs',
options: {
singleQuote: false
}
}
]
};
And this is our .template-lintrc.js
:
module.exports = {
name: 'template-lint-config-lts',
configurations: {
recommended: {
plugins: ['@linkedin/ember-template-lint-plugin-pemberly', 'ember-template-lint-plugin-prettier'],
extends: [
'recommended',
'ember-template-lint-plugin-prettier:recommended',
'ember-template-lint-plugin-pemberly:recommended'
],
rules: {
'no-static-link-domain': [
'warn',
{
domainBlacklist: ['linkedin.com', 'linkedin-ei.com', 'linkedin.cn', 'linked-ei.cn']
}
],
'no-curly-component-invocation': {
allow: ['format-name', 'format-date', 'li-icon', 'artdeco-icons-web$li-icon', 'format-typeahead-result']
},
'no-passed-in-event-handlers': {
ignore: {
'artdeco-button$artdeco-button': ['click'],
ArtdecoButton: ['click'],
ArtdecoButton$ArtdecoButton: ['click'],
ArtdecoPillDismiss: ['keyDown']
}
},
'require-i18n-resource-tag': 'cap-i18n-resource',
'require-i18n-resource-tag-first-line': true
}
}
}
};