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
Add new rule no-at-ember-render-modifiers
#2554
Add new rule no-at-ember-render-modifiers
#2554
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You'll need to run
npm run update:indices
. - We use npm not pnpm.
no-at-ember-render-modifiers
5a0c565
to
2718369
Compare
@NullVoxPopuli I'm interested in getting this PR to the finish line. I might have time coming up if you're ok with me jumping in? |
Go for it, i forgot this existed <3 |
Co-authored-by: Bryan Mishkin <698306+bmish@users.noreply.github.com>
I am picking this back up 🎉 |
15af292
to
8f568a4
Compare
}, | ||
], | ||
}, | ||
` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there's some old leftover snapshots in these tests. There should only be one arg to toMatchInlineSnapshot
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the lint prevented from using a string, so I had to change to a real object.
then, when jest was running, it updated the string stuff after success -- the string part is the real snapshot persisted by jest, and the js object is the "expected" and helps out with the diff and generated the snapshot if the actual matches the expected.
Is this not how it's supposed to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jest's auto-updating of inline snapshots is buggy. It left the old snapshot in there. Just clear out the snapshots and let it regenerate without the extra arg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't look buggy to me -- what do you mean?
looks up to date.
are you looking at the full PR diff, rather than the commit this thread started on? 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two arguments passed to toMatchInlineSnapshot
in your code. There should only be one. One is a duplicate of the other. You need to delete the arguments to toMatchInlineSnapshot
and re-run jest to regenerate the snapshots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but if I do that, jest adds the second argument back -- no diff is seen when doing git status
/ git diff
.
To prove, I've added two commits:
- first removes the second argument, as you suggest
- second, is what happens after running the tests again
diff:
❯ git diff HEAD~2
ember-template-lint on no-at-ember-render-modifiers [⇡]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing both args was necessary before regenerating. I just pushed the fix for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! tho, now I don't know why the lint rule I was seeing isn't triggering 😅
(It was a jest one, and why what happened even happened in the first place)
```hbs | ||
<div {{this.myModifier}}> | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this code sample for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's the template for the above class
Command to update the readme needs to be run. |
pushed, thanks! |
Run jest in watch mode, commit changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This library is not recommended.
Should it be a stylistic rule or default?
There are a number of errors around the rule not being found -- any pointers would be great -- then I can add more tests 🙃
Here is the work for the equiv gjs/gts no-importing from this library: ember-cli/eslint-plugin-ember#1901