Internal consistent-docs-url rule crashes if meta isn't present #10750
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
bug
ESLint is working incorrectly
infrastructure
Relates to the tools used in the ESLint development process
rule
Relates to ESLint's core rules
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
Default
Please show your full configuration:
According to the internal ESLint config around rules:
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
What did you expect to happen?
Either a lint error about the lack of meta or nothing if that is covered by another rule.
What actually happened? Please include the actual, raw output from ESLint.
For configuration 1:
ESLint crashes, with an error message from context.report that the node location must be passed if the node is not passed.
For configuration 2:
ESLint throws an exception that it is trying to access property
length
ofundefined
This happened when I was trying to fix #10722
As mentioned in this comment,
Case 1: meta property is not defined on the exports object.
This crashes eslint and curiously, the
exportsNode
is of typefunctionExpression
.Case 2: meta property is defined with a value of
undefined
This creates an exception in
getPropertyFromObject
method where it tries to accesslength
ofundefined
.The text was updated successfully, but these errors were encountered: