Typescript to remove-public-modifier - Remove Public Modifier

verified codemod icon

This codemod removes public modifier in interface declarations as it is implicit.

TypeScript
jscodeshift
Estimated time saving
~1 minute/occurrence
Change mode
Autonomous
Applicability criteria

TypeScript version higher or equal to 1.4.

Made by
Codemod.com
Codemod.com

Usage →

Codemod CLI:

intalling vs code extension tooltip icon
codemod typescript/remove-public-modifier
copy CLI command icon

Codemod VS Code extension:

intalling vs code extension tooltip icon
vs code logo
Run in VS Code

Description

This codemod removes public modifier in interface declarations as it is implicit.

Before

class MyClass {
    public myProperty: string;

    public constructor() {
    }

    public myMethod(): void {
    }
}

After

class MyClass {
    myProperty: string;

    constructor() {
    }

    myMethod(): void {
    }
}