Followed is a list of ESLint rules that we should implement.
return statements in getters (getter-return) #129 Please comment if you want to work on one of these and I'll mark you to avoid duplicating work. Mentions next to rules indicate that someone else is working on it. If a PR isn't opened within a few days then it will be up for grabs.
A checkmark indicates an open PR.
I'd like to try working on no-debugger
I started working on no-delete-var
I would like to try working on no-unreachable
I'd like to try on no-async-promise-executor
I'd like to try taking on no-dupe-args
Taking a look at no-dupe-keys
I'm taking on no-duplicate-case
Would take no-label-var
I've added links to the ESLint rule documentation, src implementation and test implementation as it might be useful for people working on them.
return statements in getters (getter-return)no-async-promise-executor)no-compare-neg-zero)no-cond-assign)no-debugger)no-dupe-args)no-dupe-keys)no-duplicate-case)no-empty-character-class)no-ex-assign)no-extra-boolean-cast)no-func-assign)no-import-assign)no-inner-declarations)no-invalid-regexp)no-regex-spaces)no-setter-return)no-sparse-arrays)no-unreachable)no-unsafe-finally)no-unsafe-negation)no-template-curly-in-string)no-delete-var)no-label-var)no-shadow-restricted-names)prefer-template)Some general observations/thoughts while working on the noDebugger rule:
packages/@romejs/js-compiler/transforms/lint/index.ts alphabetically to reduce the chance of merge conflicts. From looking at the PRs, there will be quite a few merge conflicts as most people add it to the bottom~ #132packages/@romejs/js-compiler/__rtests__/lint.ts or start a convention of one test file per rule. Lowers the chance of merge conflicts and smaller files are easier to read~ #140unusedVariables rule is firing on the other lint rules tests. Would be nice to have a way to silence it for other testsHey is anyone interested in discussing some pointers on implementation of no-unreachable implementation. I tried some way, but one way or the other few edge cases are failing when tested over eslint test rules 馃槗 馃槄
Taking no-compare-neg-zero
@JayaKrishnaNamburu Sounds like one of the more fun ones. I'd be interested in thinking about it. Got a branch up yet?
Sure @macovedj i will update it tomorrow and let's discuss there 馃槃
@JayaKrishnaNamburu
Hey is anyone interested in discussing some pointers on implementation of
no-unreachableimplementation. I tried some way, but one way or the other few edge cases are failing when tested over eslint test rules sweat sweat_smile
I don't think it would be as straightforward as ESLint since we don't have the same concept of code paths. It's fine if it's not as smart. Rome has a more sophisticated analysis system in js-analysis that we can utilize in the far future for something even better.
I've updated the main issue body with the latest PRs.
My user is @mattsjones not @MattJones btw 馃槄
Oops, sorry @MattJones :stuck_out_tongue:
I will work on no-template-curly-in-string
I'll take no-func-assign
no-cond-assign please.
There are two options, always and parens referenced in eslint. IMHO only always should be supported, but I'd be curious if there's a good argument for supporting parens.
Yeah we would want the always/only option. Parens seems like an odd escape hatch. Just suppress it if it's what you actually want to mean.
@JayaKrishnaNamburu
Hey is anyone interested in discussing some pointers on implementation of
no-unreachableimplementation. I tried some way, but one way or the other few edge cases are failing when tested over eslint test rules sweat sweat_smileI don't think it would be as straightforward as ESLint since we don't have the same concept of code paths. It's fine if it's not as smart. Rome has a more sophisticated analysis system in
js-analysisthat we can utilize in the far future for something even better.
Sure, Thank you. I will continue my work then 馃憤 馃槃
Happy to pickup no-shadow-restricted-names. ESLint currently only handles "undefined", "NaN", "Infinity", "arguments", "eval".
I was thinking we should block everything matching scope.getRootScope().isGlobal(name)?
Sounds good to me!
Picking up no-ex-assign
I'll pick up no-import-assign
I'm taking on no-unsafe-finally
I will pick up no-regex-spaces
I'm taking no-setter-return. Want to try a simple one first 馃檪
~I'm taking prefer-template~
I can do getter-return
Updated the issue body. Thanks everyone! Super happy and appreciative of all the PRs so far!
I can do no-empty-character-class
I would like to try no-inner-declarations (hopefully it's not too complex 馃槃)
I'm going to try to work on no-extra-boolean-cast
picking up prefer-template
I'll take on no-invalid-regexp
There's been some changes to structure since this issue was created and many of the PRs submitted. I just created a PR that adds a simple rule #196 and included some instructions that will hopefully be helpful to others.
@sebmck can you please update the list? I see some rules in the list that are unchecked but are already implemented. Oh and I implemented no-inner-declarations rule (#305) since @tatchi never made a PR. So please update accordingly.
Edit: Actually, all of them are done after my PR. Unless you add some more, this can be closed?
@thecodrr actually I did open a PR #142 but we decided to close it. Sorry, I should have added a comment here.
@tatchi and I should have confirmed (and researched) before jumping to implementation. :laughing: Duplicate efforts. haha
It actually looks like all these rules have been implemented or deferred. If anyone has any other ideas for lint rules, whether ones that already exist, or new ones that are made easier/justified with an easy autofix, please open an issue to discuss!
Most helpful comment
I've added links to the ESLint rule documentation, src implementation and test implementation as it might be useful for people working on them.
returnstatements in getters (getter-return)no-async-promise-executor)no-compare-neg-zero)no-cond-assign)no-debugger)no-dupe-args)no-dupe-keys)no-duplicate-case)no-empty-character-class)no-ex-assign)no-extra-boolean-cast)no-func-assign)no-import-assign)no-inner-declarations)no-invalid-regexp)no-regex-spaces)no-setter-return)no-sparse-arrays)no-unreachable)no-unsafe-finally)no-unsafe-negation)no-template-curly-in-string)no-delete-var)no-label-var)no-shadow-restricted-names)prefer-template)