-
-
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
Update configs and recommendations #146
Conversation
@@ -71,73 +71,56 @@ The `--fix` option on the command line automatically fixes problems reported by | |||
|
|||
<!--RULES_TABLE_START--> |
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 sentence above "All rules below with a check mark ✅ are enabled by default while using plugn:ember/base
or plugin:ember/recommended
configs." needs to be adjusted
some comments from my side: since the release will likely be after the 2.16 release of Ember and that release will introduce the "New Module Imports" as the default we should probably enable the corresponding rules here and put some comments in the docs on how to disable them if you're on older Ember versions. Specifically this means:
Aside from that I have two more things I would like to change:
|
I would love to see |
@Turbo87 what false positives do you see with |
@rwwagner90 e.g. empty default hooks like |
@Turbo87 firstly, why define an empty hook? And secondly, didn't I see @michalsnik added support for empty method ordering now? |
nice job @michalsnik ! As I see it we should also probably consider switching off the Apart from that I do agree with @Turbo87 about disabling |
Great that we're dropping The non-ember rules creates confusion, people don't know were they're coming from and its opinionated outside the realm of Ember ( |
I addressed all suggestions, but I think order-in-* rules prove to be really helpful and are a quick-win to keep the code well organised from the beginning. But I decided to update Let me also know guys what do you think about assignments to groups :) |
I agree that |
You want to write empty hooks when you're creating an addon, or if you just want to put a clear information what can be passed down to a component without using ember prop types addon @rwwagner90 Currently empty methods were detected as custom methods, thus this rule wanted them to be put below actions hash, which you'd rather would not. and we're talking about empty methods (custom ones), not empty lifecycle hooks :) |
as I mentioned above: as long as the other reason is that the order is largely a stylistic preference but not actually catching any bugs or reporting about deprecated code logic which should be the main aim of the rules in this repo. |
@Turbo87 I think the ordering should not be a preference though. With no imposed order, it's very cumbersome to switch between codebases. If you just put random things in no order throughout a 1000+ line JS file, you would have a very hard time finding everything. I think there is great value in having a standard here, so Ember developers can switch easily between projects and expect a general ordering and more easily be productive out of the box. People could always disable it, if they don't want it, or configure it custom and do order of one thing at a time. |
5bd37cf
to
a5bab98
Compare
To get the ball rolling on this again I've created a |
This PR:
experimentalObjectRestSpread
feature in eslint parserBest Practices
,Possible Errors
,Stylistic Issues
Deprecated Rules
section.I hope this PR is a good starting point for an elaborate discussion which rules should be recommended, and which deprecated.
If you have any propositions/suggestions, also regarding categories to which specific rules are assigned to, please post a comment below :)
cc @rwwagner90 @Turbo87 @jbandura
PS. This PR will be probably open for at least month or more, as it will require us to do another major release after merge. I don't want to rush it, so in the meanwhile we can continue working on new rules/fixing current ones.