-
-
Notifications
You must be signed in to change notification settings - Fork 204
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 fix
for use-ember-get-and-set
#115
Add fix
for use-ember-get-and-set
#115
Conversation
@SaladFork @michalsnik @tylerturdenpants Here's the PR continuing from #55. Since I don't have write access to the original PR, I opened a new one with the commits rebased. |
'set', | ||
]; | ||
|
||
const directoriesToSkipCompletely = [ |
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.
Maybe we should make this configurable, so that a user can provide options on which directories they want to skip?
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.
Makes sense to me. I was considering this, but I didn't have a great way to specify the option. I was thinking either:
- Only allow them to specify a single part of the path as we do here.
- Substring match. Not great and could lead to false positives.
- Substring match but make sure that we're respecting path boundaries (e.g.
app/nottests
would not match totests
. - Regex match. Could be a little heavy handed.
- Glob matching. Would probably require requiring in another dependency.
Alternatively, the users could include a .eslintrc
file in the subdirectory they want to exclude.
// some/subdirectory/to/exclude/.eslintrc
{
"ember/use-ember-get-and-set": "off"
}
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.
Right, a .eslintrc
file does seem like the easiest approach here. So I think we can leave out the option for now and rely on users excluding directories on their own, I like this :)
We're still a little worried about the |
Definitely a valid concern. Here are a few enhancements I think I could make:
What are your thoughts? |
@kevinkucharczyk I updated the PR with some new behaviors to prevent code breakages:
|
Looks pretty good! One more thing though: I think it would be good to document the new behaviour in |
Documented the |
Please also add a note saying that the linter skips mirage and tests :) |
Done! |
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.
Very good work, thank you so much @sudowork !
Continuation of #55. This allows
this.get()
andthis.set()
in thetests
directory, and it will completely skip over themirage
directory.