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
Getting eslint-config-eslint in line with coding standards #5188
Comments
@platinumazure Thanks for the issue! If you're reporting a bug, please be sure to include:
Requesting a new rule? Please see Proposing a New Rule for instructions. |
And what's the approach? We need some seed information on this issue so people know what the direction is. |
I'm not sure, to be honest. I was hoping to gather some examples. I just found one: @nzakas commented about wanting JSDoc parameter annotations not to have punctuation between the parameter name and the description here. We have no way to enforce that in ESLint right now, but that would be an example of a style preference that we aren't enforcing and theoretically could. |
Okay, I've gone through the Code Conventions document. I've put together a list of each section of that document, as well as whether we are enforcing it via our own ESLint configuration. My findings are here. |
Apologies for the delay. Here's what I think is actionable now:
I would need to re-analyze my list to figure out what could be fixable with rule development (either as a core rule, if sufficiently general, or as a custom rule for the ESLint repository). |
Seems reasonable to me. @eslint/eslint-team thoughts? |
If we are enabling |
@ilyavolodin Good call, I've edited my previous comment to include your suggestion. |
👍 |
Looking over this again, I fear that |
@nzakas Acknowledged, but please do bear in mind that the original goal of this issue is to bring ESLint config in line with your stated coding convention preferences. So for each of the discrepancies I've identified, either we can tighten ESLint config to match the code convention, or we can loosen the coding convention to match the reality of ESLint's style. I don't think we should do nothing in these cases, because it could cause confusion. |
Just checked. Yes, |
I've dealt with 2k+ errors when doing this: disqus/heka-node@a1de77e You can't scare me with 800 :D - Joking aside, I'm willing to give a hand. |
@ilyavolodin @nzakas Also I'd be willing to clean up large error chunks. I want to ask about next steps. Should I file separate issues for each of the rules I've listed? Or is it sufficient for PRs to "ref" this issue until the last one? |
@platinumazure remember, we can define the relationship we want. One way to bring the conventions into alignment with the rules is to change the rules, another is to change the conventions. Both options are at our disposal, so it's really a question of what the team prefers as a whole. Next step is to get consensus from the team about these last two rules. After that, I'd just use this one issue for multiple PRs with "refs". |
@nzakas Cool. And regarding actions we can take, I'm glad we're on the same page:
|
Okay, I've started work on a couple of the rules I called out above.
|
Re |
I think "as-needed" is what I intended. I can't remember why I started doing node types in quotes. For lines-around-comment: yes, especially at the start of a block. |
Dogfood space-in-parens and lines-around-comment rules in ESLint repo.
Dogfood space-in-parens and lines-around-comment rules in ESLint repo.
@platinumazure confirmed |
@gyandeeps Edited the initial post with what I believe the list should look like. Please let me know if I missed something. Thanks! |
Just my feeling, I hate By the way, Node v6 will be released soon, and we have a plan to drop supports of Node 0.x. |
I'm with @mysticatea - I don't think |
Any objections if I remove If everyone is on board with it, I will then either file a PR in eslint.github.io or ask @nzakas to do so, in order to remove that stipulation from the coding guidelines. |
Fine by me. I would also add |
@ilyavolodin I would imagine we use it extensively in CLI- how would you
|
Disabling it with comments in the places where it's actually needed should be find, I think. |
If we are not enabling |
👍 to enabling |
Okay, clearly I didn't know what I was talking about when I said I would do On the other hand, I am about to start |
Fix: Enable no-console rule in eslint-config-eslint (refs #5188)
Updated my list-- I think |
Should we enchance the |
@gyandeeps Absolutely yes, was just about to come back and add that to the list. Glad you agree. |
@gyandeeps Yes! I'll do that now. :) |
@eslint/eslint-team I think we can close this issue, since we have covered everything. |
Fine by me. Closing. Thanks everyone for your help! |
Per discussion in chat, the goal of this issue is to document (and eventually implement) changes to the Coding Standards and/or
eslint-config-eslint
to bring both in line as much as possible.Actionable items:
Enable vars-on-top to ensure variables are declared at the top of their containing scope (Note: Might be removed)Enable one-var, per @ilyavolodin's suggestion (Note: Might be removed)Using one-var-declaration-per-lineThe text was updated successfully, but these errors were encountered: