packages/babel-plugin-transform-typescript/src/index.js
File index.js
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { declare } from "@babel/helper-plugin-utils";
import syntaxTypeScript from "@babel/plugin-syntax-typescript";
import { types as t, template } from "@babel/core";
import { injectInitialization } from "@babel/helper-create-class-features-plugin";
Function Program
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Program(path, state) {
const { file } = state;
let fileJsxPragma = null;
if (!GLOBAL_TYPES.has(path.node)) {
Function field
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
field(path) {
const { node } = path;
if (!allowDeclareFields && node.declare) {
throw path.buildCodeFrameError(
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(path, classPath) {
if (path.node.accessibility) path.node.accessibility = null;
// Collects parameter properties so that we can add an assignment
// for each of them in the constructor body
//
Consider simplifying this complex logical expression. Open
Open
} else if (
stmt.isTSTypeAliasDeclaration() ||
stmt.isTSDeclareFunction() ||
stmt.isTSInterfaceDeclaration() ||
stmt.isClassDeclaration({ declare: true }) ||
Avoid deeply nested control flow statements. Open
Open
for (const importPath of importsToRemove) {
importPath.remove();
}
Avoid deeply nested control flow statements. Open
Open
if (
binding &&
isImportTypeOnly({
binding,
programPath: path,