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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MVP lint rules #1

Closed
bartlomieju opened this issue Mar 28, 2020 · 8 comments
Closed

MVP lint rules #1

bartlomieju opened this issue Mar 28, 2020 · 8 comments

Comments

@bartlomieju
Copy link
Member

bartlomieju commented Mar 28, 2020

Decide on list of lint rules that are required for MVP linter.

Good idea to go through recommended sets and compile a list:

@lucacasonato
Copy link
Member

lucacasonato commented Mar 29, 2020

I think we should start with all of the recommended rules in the possible errors section of eslint. These are lints that prevent runtime errors, so they are most useful. Those would be:

  • for-direction
  • getter-return
  • no-async-promise-executor
  • no-compare-neg-zero
  • no-cond-assign
  • no-constant-condition
  • no-control-regex
  • no-debugger
  • no-dupe-args
  • no-dupe-else-if
  • no-dupe-keys
  • no-duplicate-case
  • no-empty
  • no-empty-character-class
  • no-ex-assign
  • no-extra-boolean-cast
  • no-extra-semi
  • no-func-assign
  • no-import-assign
  • no-inner-declarations
  • no-invalid-regexp
  • no-irregular-whitespace
  • no-misleading-character-class
  • no-obj-calls
  • no-prototype-builtins
  • no-regex-spaces
  • no-setter-return
  • no-sparse-arrays
  • no-unexpected-multiline
  • no-unreachable
  • no-unsafe-finally
  • no-unsafe-negation
  • use-isnan
  • valid-typeof

Then later we should implement the possible errors recommended rules for typescript and then the remaining recommended eslint and typescript specific rules. It would be awesome if we could have support for eslint:recommended and @typescript-eslint/recommended out of the box.

Ideas?

@bartlomieju
Copy link
Member Author

I think we should start with all of the recommended rules in the possible errors section of eslint. These are lints that prevent runtime errors, so they are most useful. Those would be:

Then later we should implement the possible errors recommended rules for typescript and then the remaining recommended eslint and typescript specific rules. It would be awesome if we could have support for eslint:recommended and @typescript-eslint/recommended out of the box.

@lucacasonato thanks for compiling the list, presented approach seems to be reasonable.

Keep in mind I'm still iterating heavily on AST traversal and the AstTraverser will most likely be removed altogether in the near future.

@bartlomieju
Copy link
Member Author

Update: AstTraverser was replaced with swc_ecma_visit::Visit trait which serves the same purpose. I'm working on control flow analysis for more complex rules, but a lot of listed rules could now be implemented.

@DomParfitt
Copy link
Contributor

Hi @bartlomieju, are you looking for contributors for any of these rules? If so, I would be happy to have a look at one or more of them.

@bartlomieju
Copy link
Member Author

Hey @DomParfitt; this project hasn't received much attention in the past weeks due to release of Deno. There is still some core infrastructure missing, but if you can find a rule and implement it feel free to open a PR :) Keep in mind that scope analysis is not complete #21

@sgtpep
Copy link

sgtpep commented May 21, 2020

How about no-unused-vars?

@bartlomieju
Copy link
Member Author

@sgtpep no-unused-vars requires scope analysis, which is WIP in #21

This was referenced May 22, 2020
@bartlomieju
Copy link
Member Author

I've written down list of all recommended rules from ESLint in: #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants