@so1ve/eslint-plugin 0.96.0 → 0.97.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -66,13 +66,13 @@ const functionStyle = createEslintRule({
66
66
  const variableDeclaration = asVariable && name ? `const ${name} = ` : "";
67
67
  return type === "arrow" ? `${variableDeclaration}${async}${generics}(${params})${returnType} => ${rawStatement};` : `${async}function ${name}${generics}(${params})${returnType} ${body}`;
68
68
  }
69
- let currentScope = null;
69
+ const scopeStack = [];
70
70
  let haveThisAccess = false;
71
71
  function setupScope() {
72
- currentScope = context.getScope();
72
+ scopeStack.push(context.getScope());
73
73
  }
74
74
  function clearThisAccess() {
75
- currentScope = null;
75
+ scopeStack.pop();
76
76
  haveThisAccess = false;
77
77
  }
78
78
  return {
@@ -183,7 +183,7 @@ const functionStyle = createEslintRule({
183
183
  clearThisAccess();
184
184
  },
185
185
  ThisExpression() {
186
- haveThisAccess = currentScope === context.getScope();
186
+ haveThisAccess = scopeStack.includes(context.getScope());
187
187
  }
188
188
  };
189
189
  }
package/dist/index.mjs CHANGED
@@ -64,13 +64,13 @@ const functionStyle = createEslintRule({
64
64
  const variableDeclaration = asVariable && name ? `const ${name} = ` : "";
65
65
  return type === "arrow" ? `${variableDeclaration}${async}${generics}(${params})${returnType} => ${rawStatement};` : `${async}function ${name}${generics}(${params})${returnType} ${body}`;
66
66
  }
67
- let currentScope = null;
67
+ const scopeStack = [];
68
68
  let haveThisAccess = false;
69
69
  function setupScope() {
70
- currentScope = context.getScope();
70
+ scopeStack.push(context.getScope());
71
71
  }
72
72
  function clearThisAccess() {
73
- currentScope = null;
73
+ scopeStack.pop();
74
74
  haveThisAccess = false;
75
75
  }
76
76
  return {
@@ -181,7 +181,7 @@ const functionStyle = createEslintRule({
181
181
  clearThisAccess();
182
182
  },
183
183
  ThisExpression() {
184
- haveThisAccess = currentScope === context.getScope();
184
+ haveThisAccess = scopeStack.includes(context.getScope());
185
185
  }
186
186
  };
187
187
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@so1ve/eslint-plugin",
3
- "version": "0.96.0",
3
+ "version": "0.97.1",
4
4
  "author": "Ray <i@mk1.io> (https://github.com/so1ve/)",
5
5
  "keywords": [
6
6
  "eslint",