@pain-org/cleaner
v1.1.1
Published
Convert All Equal Imports Declarations to Standard Import Declarations\ Generate Barrel "index.ts" files in each folder (reclusive) & adds all exports for that folder. It dont remove other codes if "index.ts" file already exists
Downloads
9
Readme
@pain-org/cleaner
Convert All Equal Imports Declarations to Standard Import Declarations
Generate Barrel "index.ts" files in each folder (reclusive) & adds all exports for that folder. It dont remove other codes if "index.ts" file already exists
Example:
Equal Declarations:
---------------------------
import * as primitive from "../../primitive"
import DownloadServices = primitive.Services.DownloadServices
import UploadServices = primitive.Services.UploadServices (export default)
Converts into
---------------------------
import {DownloadServices} from "../../primitive/services/downloadServices"
import UploadServices from "../../primitive/services/uploadServices"
##Usage
npx pain-cleaner run -d true -i true -b true -t ./src
##CLI Options
Options:
-t --target <value> Target Directory
-d --duplicate-export <true|false> Fix Duplicate Exports (default: false)
-i --fix-imports <true|false> Fix Duplicate Exports Other Then Interface (default: false)
-b --barrel <true|false> Create ann Barrel Files in a folder, if exists it removes all exports which is attached to imports (default: false)
-pd --print-only-duplicate-interface <true|false> Print Duplicate Interface which have same properties and types (default: false)
-pe --print-other-duplicate-exports <true|false> Print Duplicate Exports Other Then Interface (default: false)
-fi --fix-only-duplicate-interface <true|false> Fix Only Duplicate Interface which have same properties and types (default: false)
-fe --fix-only-other-duplicate-exports <true|false> Fix Duplicate Exports Other Then Interface (default: false)
-h, --help display help for command