File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -33,13 +33,9 @@ const create = context => {
33
33
} ;
34
34
35
35
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 || [ ] ) ;
43
39
44
40
/** @param {import('estree').Node } node */
45
41
const checkForExternallyScopedVariables = node => {
@@ -53,7 +49,7 @@ const create = context => {
53
49
for ( const reference of nodeScope . through ) {
54
50
const { identifier} = reference ;
55
51
56
- if ( allowedGlobals . includes ( identifier . name ) ) {
52
+ if ( allowedGlobals . has ( identifier . name ) ) {
57
53
continue ;
58
54
}
59
55
You can’t perform that action at this time.
0 commit comments