Skip to content

Commit 91e07cd

Browse files
committed
Sync with ember-template-lint
1 parent b773df4 commit 91e07cd

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

docs/rules/template-no-trailing-spaces.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ In examples below, `•` represents a trailing space character.
1313
This rule **forbids** the following:
1414

1515
```hbs
16-
<div>test</div>••
17-
•••••
16+
<div>test</div>•• •••••
1817
```
1918

2019
```gjs

tests/lib/rules/template-no-trailing-spaces.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ hbsRuleTester.run('template-no-trailing-spaces', rule, {
145145
'test',
146146
' test',
147147
'test\n',
148-
'test\n' + '\n',
149-
'{{#my-component}}\n' + ' test\n' + '{{/my-component}}',
148+
'test\n\n',
149+
'{{#my-component}}\n test\n{{/my-component}}',
150150
`import { hbs } from 'ember-cli-htmlbars';
151151
152152
test('it renders', async (assert) => {
@@ -181,13 +181,15 @@ test('it renders', async (assert) => {
181181
errors: [{ message: 'Trailing whitespace detected.' }],
182182
},
183183
{
184-
code: "import { hbs } from 'ember-cli-htmlbars';\n\ntest('it renders', async (assert) => {\n await render(hbs` \n <div class=\"parent\">\n <div class=\"child\"></div>\n </div>\n `);\n});",
185-
output: "import { hbs } from 'ember-cli-htmlbars';\n\ntest('it renders', async (assert) => {\n await render(hbs`\n <div class=\"parent\">\n <div class=\"child\"></div>\n </div>\n `);\n});",
184+
code: 'import { hbs } from \'ember-cli-htmlbars\';\n\ntest(\'it renders\', async (assert) => {\n await render(hbs` \n <div class="parent">\n <div class="child"></div>\n </div>\n `);\n});',
185+
output:
186+
'import { hbs } from \'ember-cli-htmlbars\';\n\ntest(\'it renders\', async (assert) => {\n await render(hbs`\n <div class="parent">\n <div class="child"></div>\n </div>\n `);\n});',
186187
errors: [{ message: 'Trailing whitespace detected.' }],
187188
},
188189
{
189190
code: "import { hbs } from 'ember-cli-htmlbars';\n\ntest('it renders', async (assert) => {\n await render(hbs`\n <div></div>\n \n <div></div>\n `);\n});",
190-
output: "import { hbs } from 'ember-cli-htmlbars';\n\ntest('it renders', async (assert) => {\n await render(hbs`\n <div></div>\n\n <div></div>\n `);\n});",
191+
output:
192+
"import { hbs } from 'ember-cli-htmlbars';\n\ntest('it renders', async (assert) => {\n await render(hbs`\n <div></div>\n\n <div></div>\n `);\n});",
191193
errors: [{ message: 'Trailing whitespace detected.' }],
192194
},
193195
],

0 commit comments

Comments
 (0)