Skip to content

Commit 6376d43

Browse files
committed
tools: stricter no-undef eslint rule
By default eslint does not validate variables that are placed in a typeof check. PR-URL: #19926 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 4082bdf commit 6376d43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ module.exports = {
185185
'no-this-before-super': 'error',
186186
'no-throw-literal': 'error',
187187
'no-trailing-spaces': 'error',
188-
'no-undef': 'error',
188+
'no-undef': ['error', { typeof: true }],
189189
'no-undef-init': 'error',
190190
'no-unexpected-multiline': 'error',
191191
'no-unreachable': 'error',

0 commit comments

Comments
 (0)