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
SourceCode not optimize for RuleTester changes #13293
Comments
also, SourceCode unit tests failed in my branch with fix, and i see a difference between start, end and range https://github.com/eslint/eslint/blob/master/lib/source-code/source-code.js#L352 console.log(currentToken.start, currentToken.end, currentToken.range) // the same - 0, 42, [ 0, 42]
console.log(node.parent.start, node.parent.end, node.parent.range) // different - 0, 101, [ 43, 54 ] find same information in this comment |
Difference between range and start, end - it is adaptation to Esprima behaviour |
As mentioned here, |
The upgrade to ESLint 7.0.0 broke our custom rule tests. It seems we were affected by eslint/eslint#13293 after all. R=jacktfranklin@chromium.org Change-Id: I3dcf8b7e15f1bc6a26c2fa069f24241e87f07627 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2538840 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
We using RuleTester for custom rule, and have this code inside rule:
After updating to Eslint 7, have a error, because
source-code.js
use deprecated byrule-tester.js
node properties.What did you expect to happen?
My tests passes succesfull
What actually happened? Please include the actual, raw output from ESLint.
Are you willing to submit a pull request to fix this bug?
Yes
The text was updated successfully, but these errors were encountered: