-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): add prefer-includes rule (fixes #284) #294
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #294 +/- ##
==========================================
+ Coverage 96.87% 96.95% +0.08%
==========================================
Files 70 71 +1
Lines 2625 2694 +69
Branches 424 435 +11
==========================================
+ Hits 2543 2612 +69
Misses 49 49
Partials 33 33
|
Side note: Because I have "format on save by ESLint" always, I have sometimes forgotten to run prettier manually. |
…es/new # Conflicts: # packages/eslint-plugin/package.json # packages/eslint-plugin/typings/ts-eslint.d.ts
Co-Authored-By: mysticatea <star.ctor@gmail.com>
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.
one nit otherwise lgtm
…es/new # Conflicts: # packages/eslint-plugin/package.json
Thank you for the review! |
Thanks a lot! Just need to resolve the conflicts |
# Conflicts: # packages/eslint-plugin/package.json
Hi. I updated this PR to resolve conflicts. |
This rule was not added to the readme: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules |
Fixes #284.
This PR adds new
@typescript-eslint/prefer-includes
rule.This rule suggests using
includes
method if:indexOf
method calls:includes
method also.indexOf
method andincludes
method have the same parameters.test
method calls:RegExp
object.RegExp
object can be determined to a unique string.This PR adds two packages as same as #289.