The Wayback Machine - https://web.archive.org/web/20201110153735/https://github.com/rome/tools/issues/976
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃搸 Additional lint rules from IntelliJ #976

Open
sebmck opened this issue Aug 8, 2020 · 4 comments
Open

馃搸 Additional lint rules from IntelliJ #976

sebmck opened this issue Aug 8, 2020 · 4 comments

Comments

@sebmck
Copy link
Member

@sebmck sebmck commented Aug 8, 2020

I've recently switched to Webstorm and was impressed with a lot of the rules they offer with code inspection. I haven't seen some of these in ESLint.

  • Unnecessary continue as the last statement in a loop
  • Simplify statement or boolean expression
  • Expression statement that is not assignment or call
  • Single character regex alternations can be a charset
  • Unused shadowed bindings
@sebmck sebmck added task linter labels Aug 8, 2020
@aravind1078
Copy link
Contributor

@aravind1078 aravind1078 commented Aug 24, 2020

@sebmck i wanna pick Unnecessary continue as the last statement in the loop already started working on it, missing few cases currently hopefully will come up with a PR soon.

@aravind1078
Copy link
Contributor

@aravind1078 aravind1078 commented Aug 25, 2020

do we want to remove the continue statement in unnecessary continue rule or we just tell them that the continue is unnecessary here?

@ludofischer
Copy link

@ludofischer ludofischer commented Oct 6, 2020

I am currently trying to write Expression statement that is not assignment or call. Down from 12115 false positives to just 329... For the benefit of others attempting a similar task, it helps to know that the AST (Abstract Syntax Tree) format looks similar to ESTree and you can paste code into https://astexplorer.net/ to get an idea of how it鈥檚 parsed (I think leaving the parser set as acorn gives a good approximation of the Rome AST).

@ematipico
Copy link
Member

@ematipico ematipico commented Oct 7, 2020

@ludofischer Rome has also a command called parse that write to screen the AST:

./rome parse ./test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can鈥檛 perform that action at this time.