We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
error-message
When running on this code,
const a = undefined; function b() { throw undefined; }
RangeError: Maximum call stack size exceeded Occurred while linting <CWD>\1.ts:1 at findIdentifierValues (<CWD>\rules\error-message.js:32:24) at checkErrorMessage (<CWD>\rules\error-message.js:80:28) at checkErrorMessage (<CWD>\rules\error-message.js:82:4) at checkErrorMessage (<CWD>\rules\error-message.js:82:4) at checkErrorMessage (<CWD>\rules\error-message.js:82:4) at checkErrorMessage (<CWD>\rules\error-message.js:82:4) at checkErrorMessage (<CWD>\rules\error-message.js:82:4) at checkErrorMessage (<CWD>\rules\error-message.js:82:4) at checkErrorMessage (<CWD>\rules\error-message.js:82:4) at checkErrorMessage (<CWD>\rules\error-message.js:82:4) { currentNode: Node { type: 'Program', start: 0, end: 58, loc: SourceLocation { start: [Position], end: [Position] }, range: [ 0, 57 ], body: [ [Node], [Node], [Node] ], sourceType: 'module', comments: [], tokens: [ [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token] ], parent: null } }
This is not a real-world code, but I don't know what's wrong yet.
Bug found during #914, file https://github.com/prettier/prettier/blob/master/tests/typescript/conformance/types/functions/functionImplementations.ts
The text was updated successfully, but these errors were encountered:
/* global x */ const a = x; throw x;
This fails it too.
Sorry, something went wrong.
@sindresorhus This rule is a little hard for me to understand, it suppose to check
Enforce passing a message value when throwing a built-in error
message
But the code tracking ThrowStatement, this make it hard to track the references, do you think we just check NewExpression?
ThrowStatement
NewExpression
const foo = new Error()
This should be a invalid case, even it didn't throw.
That does sound like a better way to do it.
👍🏻
Successfully merging a pull request may close this issue.
When running on this code,
This is not a real-world code, but I don't know what's wrong yet.
Bug found during #914, file https://github.com/prettier/prettier/blob/master/tests/typescript/conformance/types/functions/functionImplementations.ts
The text was updated successfully, but these errors were encountered: