Skip to content

Commit

Permalink
Run yarn lint:hbs:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fsmanuel committed Sep 4, 2022
1 parent 694be30 commit 9dbfc9c
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 51 deletions.
17 changes: 1 addition & 16 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,5 @@

module.exports = {
extends: 'recommended',
rules: {
// TODO: Remove over time
'link-href-attributes': false,
'no-action': false,
'no-curly-component-invocation': false,
'no-implicit-this': false,
'no-inline-styles': false,
'no-invalid-interactive': false,
'no-link-to-positional-params': false,
'no-partial': false,
'no-unbalanced-curlies': false,
'require-button-type': false,
'require-iframe-title': false,
'require-input-label': false,
'require-valid-alt-text': false,
},
rules: {},
};
5 changes: 5 additions & 0 deletions tests/dummy/app/controllers/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,9 @@ export default class extends Controller {
// show a flash message or transitionTo somewehere
});
}

@action
setName(event) {
this.name = event.target.value;
}
}
5 changes: 5 additions & 0 deletions tests/dummy/app/controllers/projects/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ export default class extends Controller {
deleteTask(task) {
task.destroyRecord();
}

@action
setName(event) {
this.name = event.target.value;
}
}
4 changes: 2 additions & 2 deletions tests/dummy/app/templates/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ The addon provides a <code>storageFor</code> computed property that returns a pr
It ships with an ember-data adapter that works almost the same as the JSONAPIAdapter with some relationship sugar added.<br><br>

Your Page Visits: {{this.stats.counter}}
<button {{on "click" this.countUp}}>Count up</button>
<button {{on "click" this.resetCounter}}>X</button>
<button type="button" {{on "click" this.countUp}}>Count up</button>
<button type="button" {{on "click" this.resetCounter}}>X</button>
17 changes: 0 additions & 17 deletions tests/dummy/app/templates/post.hbs

This file was deleted.

19 changes: 10 additions & 9 deletions tests/dummy/app/templates/projects.hbs
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
Open the developer tools and go to <code>Resources</code> -> <code>Local Storage</code> or reload to see the effect.<br><br>

<input
type="file"
{{on "change" this.importData}}
/>
<a {{on "click" this.exportData}} role="button">Export</a>
<label>
<input type="file" {{on "change" this.importData}} />
</label>
<button type="button" {{on "click" this.exportData}}>Export</button>

<br>
<br>

<strong>Name:</strong>
<input value={{this.name}} oninput={{action (mut this.name) value="target.value"}} />
<a {{on "click" (fn this.createProject this.name)}} role="button">Create project</a>
<label>
<strong>Name:</strong>
<input value={{this.name}} {{on "input" this.setName}} />
</label>
<button type="button" {{on "click" (fn this.createProject this.name)}}>Create project</button>

<br>
<br>
Expand All @@ -22,7 +23,7 @@ Open the developer tools and go to <code>Resources</code> -> <code>Local Storage

{{#each this.model as |project|}}
<LinkTo @route="projects.project" @model={{project}}>{{project.name}}</LinkTo> -
<a {{on "click" (fn this.deleteProject project)}} role="button">Delete</a>
<button type="button" {{on "click" (fn this.deleteProject project)}}>Delete</button>
<br>
{{/each}}
</div>
Expand Down
10 changes: 6 additions & 4 deletions tests/dummy/app/templates/projects/project.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
<br>
<br>

<strong>Name:</strong>
<input value={{this.name}} oninput={{action (mut this.name) value="target.value"}} />
<a {{on "click" (fn this.createTask this.name)}} role="button">Create task</a>
<label>
<strong>Name:</strong>
<input value={{this.name}} {{on "input" this.setName}} />
</label>
<button type="button" {{on "click" (fn this.createTask this.name)}}>Create task</button>

<br>
<br>
Expand All @@ -16,7 +18,7 @@

{{#each this.model.tasks as |task|}}
<LinkTo @route="tasks.task" @model={{task}}>{{task.name}}</LinkTo> -
<a {{on "click" (fn this.deleteTask task)}} role="button">Delete</a>
<button type="button" {{on "click" (fn this.deleteTask task)}}>Delete</button>
<br>
{{/each}}
</div>
Expand Down
6 changes: 3 additions & 3 deletions tests/dummy/app/templates/storage-for.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h3>Generator</h3>
{{! template-lint-disable block-indentation}}
{{! template-lint-disable block-indentation no-unbalanced-curlies}}
Run <code>ember g storage -h</code> for all options.<br><br>

<HighlightJs @lang="bash">
Expand All @@ -20,9 +20,9 @@ Open the developer tools and go to <code>Resources</code> -> <code>Local Storage
{{! template-lint-disable simple-unless}}
{{#unless this.settings.welcomeMessageSeen}}
You will see this message until you click
<button {{on "click" this.toggleWelcomeMessage}}>X</button>
<button type="button" {{on "click" this.toggleWelcomeMessage}}>X</button>
{{else}}
<button {{on "click" this.toggleWelcomeMessage}}>Undo</button>
<button type="button" {{on "click" this.toggleWelcomeMessage}}>Undo</button>
{{/unless}}
</div>

Expand Down

0 comments on commit 9dbfc9c

Please sign in to comment.