Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ba4946a

Browse filesBrowse files
committed
tools: prohibit Error.prepareStackTrace() usage
This eslint rule makes sure that `prepareStackTrace()` is not used in Node.js core. PR-URL: #29827 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
1 parent 60296a3 commit ba4946a
Copy full SHA for ba4946a

File tree

Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed
Open diff view settings
Collapse file

‎lib/.eslintrc.yaml‎

Copy file name to clipboardExpand all lines: lib/.eslintrc.yaml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ rules:
3333
message: "Use an error exported by the internal/errors module."
3434
- selector: "CallExpression[callee.object.name='Error'][callee.property.name='captureStackTrace']"
3535
message: "Please use `require('internal/errors').hideStackFrames()` instead."
36+
- selector: "AssignmentExpression:matches([left.name='prepareStackTrace'], [left.property.name='prepareStackTrace'])"
37+
message: "Use 'overrideStackTrace' from 'lib/internal/errors.js' instead of 'Error.prepareStackTrace'."
3638
# Custom rules in tools/eslint-rules
3739
node-core/lowercase-name-for-primitive: error
3840
node-core/non-ascii-character: error

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.