-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: warn if imported variable value name not valid (#2)
- Loading branch information
Showing
5 changed files
with
108 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
{{import Button from "ui/button"}} | ||
{{import LocalButton from "./button"}} | ||
{{import SecondButton from "./button"}} | ||
{{import ButtonWithNumber5 from "./button"}}; | ||
{{import incorrectlyCamelCasedAbsoluteImport from "ui/button"}} | ||
{{import incorrectlyCamelCasedRelativeImport from "./button"}} | ||
{{import Incorrectly_Snake_Cased_Absolute_Import from "ui/button"}} | ||
{{import Incorrectly_Snake_Cased_Relative_Import from "./button"}} | ||
|
||
<Button>I'm a globally referenced button</Button> | ||
<LocalButton>I'm a locally referenced button</LocalButton> | ||
<SecondButton>I'm a locally referenced button</SecondButton> | ||
<ButtonWithNumber5>I'm ButtonWithNumber5InComponentName</ButtonWithNumber5> | ||
<incorrectlyCamelCasedAbsoluteImport>I'm a dirty named global button</incorrectlyCamelCasedAbsoluteImport> | ||
<incorrectlyCamelCasedRelativeImport>I'm a dirty named global button</incorrectlyCamelCasedRelativeImport> | ||
<Incorrectly_Snake_Cased_Absolute_Import>I'm a underscored global button</Incorrectly_Snake_Cased_Absolute_Import> | ||
<Incorrectly_Snake_Cased_Relative_Import>I'm a underscored local button</Incorrectly_Snake_Cased_Relative_Import> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// spaced | ||
{{ import Button from "ui/button" }} | ||
// tabbed | ||
{{ import SecondButton from "application/button" }} | ||
// mixed | ||
{{ import ButtonButton from "ui/button" }} | ||
// newlined | ||
{{import | ||
SecondButtonSecondButton | ||
from | ||
"application/button" | ||
}} | ||
// newlined mixed | ||
{{import | ||
ButtonButtonButton | ||
from | ||
"ui/button" | ||
}} | ||
// newlined mixed with tabs and spaces | ||
{{ import | ||
SecondButtonSecondButtonSecondButton | ||
from | ||
"application/button" | ||
}} | ||
|
||
<Button>b1</Button> | ||
<SecondButton>b1</SecondButton> | ||
<ButtonButton>b3</ButtonButton> | ||
<SecondButtonSecondButton>b4</SecondButtonSecondButton> | ||
<SecondButtonSecondButtonSecondButton>b5</SecondButtonSecondButtonSecondButton> | ||
<ButtonButtonButton>b6</ButtonButtonButton> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { render, findAll } from '@ember/test-helpers'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
module('Integration | Component | different-imports', function(hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('it can handle spaces, tabbed, multilined imports', async function(assert) { | ||
await render(hbs`{{different-imports}}`); | ||
assert.equal(findAll('button').length, 6); | ||
}); | ||
}); |