Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ESLint plugin to handle Handlebar's native #with token #76

Merged
merged 1 commit into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/@glimmerx/eslint-plugin/lib/rules/template-vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {
{
type: 'object',
properties: {
// ['if', 'each', 'unless', 'has-block', 'yield'] will always be 'nativeTokens'
// ['if', 'each', 'unless', 'has-block', 'yield', 'component, 'with'] will always be 'nativeTokens'
// but you may add more via this configuration. One use-case is if a token is added to the
// Javascript code implicitly (such as via a babel transform)
nativeTokens: {
Expand All @@ -36,7 +36,7 @@ module.exports = {
],
},
create(context) {
const defaultNativeTokens = ['if', 'each', 'unless', 'has-block', 'yield', 'component'];
const defaultNativeTokens = ['if', 'each', 'unless', 'has-block', 'yield', 'component', 'with'];
let isGlimmerSfc = false;
let hbsImportId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ ruleTester.run('template-vars', rule, {
If check should not cause a failure
{{/if}}
{{#each @items key="@index" as |item| }}
Neither Should each
Neither should each
{{#with item.name as |name|}}
Neither should with
{{/with}}
{{/each}}
\`;
method() {
Expand Down