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 => {
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 => {
@@ -53,7 +49,7 @@ const create = context => {
5349 for ( const reference of nodeScope . through ) {
5450 const { identifier} = reference ;
5551
56- if ( allowedGlobals . includes ( identifier . name ) ) {
52+ if ( allowedGlobals . has ( identifier . name ) ) {
5753 continue ;
5854 }
5955
You can’t perform that action at this time.
0 commit comments