Skip to content

Commit f926ae0

Browse files
committed
set
1 parent ea09c9e commit f926ae0

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

rules/isolated-functions.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,9 @@ const create = context => {
3333
};
3434

3535
options.comments = options.comments.map(comment => comment.toLowerCase());
36-
/** @type {string[]} */
37-
let allowedGlobals = [];
38-
if (options.globals === true) {
39-
allowedGlobals = Object.keys(context.languageOptions.globals);
40-
} else if (Array.isArray(options.globals)) {
41-
allowedGlobals = options.globals;
42-
}
36+
const allowedGlobals = options.globals === true
37+
? new Set(Object.keys(context.languageOptions.globals))
38+
: new Set(options.globals || []);
4339

4440
/** @param {import('estree').Node} node */
4541
const checkForExternallyScopedVariables = node => {

0 commit comments

Comments
 (0)