[prefer-string-starts-ends-with] False positive for substring with length limit #4181
Closed
3 tasks done
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Repro
tsconfig
: the default as generated bytsc --init
Expected Result
No error, since a
substring
call other thansubstring(0)
can not be replaced withstartsWith
alone.Actual Result
The following error was printed:
Additional Info
Consider the code with the change suggested by the linter:
Now
Versions
@typescript-eslint/eslint-plugin
5.4.0
@typescript-eslint/parser
5.4.0
TypeScript
4.5.2
ESLint
8.2.0
node
12.22.5
The text was updated successfully, but these errors were encountered: