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

Add new rule no-at-ember-render-modifiers #2554

Merged

Conversation

NullVoxPopuli
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli commented Jul 14, 2022

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

Copy link
Member

@bmish bmish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. You'll need to run npm run update:indices.
  2. We use npm not pnpm.

lib/config/recommended.js Outdated Show resolved Hide resolved
@bmish bmish changed the title Add new rule: no-@ember/render-modifiers Add new rule no-at-ember-render-modifiers Jul 16, 2022
@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review July 16, 2022 16:22
test/unit/rules/no-at-ember-render-modifiers-test.js Outdated Show resolved Hide resolved
docs/rule/no-at-ember-render-modifiers.md Outdated Show resolved Hide resolved
docs/rule/no-at-ember-render-modifiers.md Outdated Show resolved Hide resolved
docs/rule/no-at-ember-render-modifiers.md Outdated Show resolved Hide resolved
test/unit/rules/no-at-ember-render-modifiers-test.js Outdated Show resolved Hide resolved
lib/rules/no-at-ember-render-modifiers.js Outdated Show resolved Hide resolved
docs/rule/no-at-ember-render-modifiers.md Show resolved Hide resolved
@rob-long
Copy link
Contributor

rob-long commented Dec 3, 2022

@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?

@NullVoxPopuli
Copy link
Contributor Author

Go for it, i forgot this existed <3

NullVoxPopuli and others added 3 commits June 26, 2023 18:39
Co-authored-by: Bryan Mishkin <698306+bmish@users.noreply.github.com>
@NullVoxPopuli
Copy link
Contributor Author

I am picking this back up 🎉

},
],
},
`
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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? 😅

Copy link
Member

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.

Copy link
Contributor Author

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 [⇡] 

Copy link
Member

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.

Copy link
Contributor Author

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)

Comment on lines +44 to +46
```hbs
<div {{this.myModifier}}>
```
Copy link
Member

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?

Copy link
Contributor Author

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

@bmish
Copy link
Member

bmish commented Jun 27, 2023

Command to update the readme needs to be run.

@NullVoxPopuli
Copy link
Contributor Author

Command to update the readme needs to be run.

pushed, thanks!

Copy link
Member

@bmish bmish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants