Support for class static blocks

This commit is contained in:
sanex
2022-01-29 13:36:10 +03:00
parent a6cab50ff1
commit ac3c34fe77
3 changed files with 419 additions and 668 deletions
@@ -2,6 +2,7 @@ import { injectable, } from 'inversify';
import * as eslintScope from 'eslint-scope';
import * as estraverse from '@javascript-obfuscator/estraverse';
import { KEYS, VisitorKeys } from 'eslint-visitor-keys';
import * as ESTree from 'estree';
import { IScopeAnalyzer } from '../../interfaces/analyzers/scope-analyzer/IScopeAnalyzer';
@@ -15,8 +16,11 @@ export class ScopeAnalyzer implements IScopeAnalyzer {
/**
* @type {eslintScope.AnalysisOptions}
*/
private static readonly eslintScopeOptions: eslintScope.AnalysisOptions = {
private static readonly eslintScopeOptions: eslintScope.AnalysisOptions & {
childVisitorKeys: VisitorKeys;
} = {
ecmaVersion,
childVisitorKeys: KEYS,
optimistic: true
};