1- /**
2- * @author Toru Nagashima
3- * @copyright 2015 Toru Nagashima. All rights reserved.
4- * See LICENSE file in root directory for full license.
5- */
61"use strict"
72
3+ const { getDeclaredVariables } = require ( "../eslint-compat" )
4+
85//------------------------------------------------------------------------------
96// Helpers
107//------------------------------------------------------------------------------
@@ -15,7 +12,7 @@ const containerNodeType =
1512 / ^ (?: F o r (?: I n | O f ) ? S t a t e m e n t | (?: A r r o w ) ? F u n c t i o n (?: D e c l a r a t i o n | E x p r e s s i o n ) ) $ / u
1613
1714/**
18- * Checks whether or not a given definition should be skipped.
15+ * Checks whether a given definition should be skipped.
1916 * @param {escope.Variable.DefEntry } def - A definition to check.
2017 * @param {escope.Variable.DefEntry[] } defs - A definition list which includes `def`.
2118 * @param {escope.Variable } variable - A variable which is defined by the definition.
@@ -180,7 +177,7 @@ class PseudoScope {
180177 }
181178
182179 /**
183- * Turns an used flag on.
180+ * Turns a used flag on.
184181 * @returns {void }
185182 */
186183 markAsUsed ( ) {
@@ -213,12 +210,12 @@ module.exports = {
213210 } ,
214211 create ( context ) {
215212 /**
216- * Finds and reports references which are outside of valid scopes.
213+ * Finds and reports references which are outside valid scopes.
217214 * @param {ASTNode } node - A node to get variables.
218215 * @returns {void }
219216 */
220217 function checkForVariables ( node ) {
221- const variables = context . getDeclaredVariables ( node )
218+ const variables = getDeclaredVariables ( context , node )
222219 for ( const variable of variables ) {
223220 const defs = variable . defs
224221 const lastDef = defs [ defs . length - 1 ]
@@ -235,7 +232,7 @@ module.exports = {
235232 continue
236233 }
237234
238- // Check whether or not any reading reference exists.
235+ // Check whether any reading reference exists.
239236 // And while it does, warn references which does not belong to any
240237 // scope.
241238 let hasReadRef = false
0 commit comments