Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@korautils/alias-fixer
Advanced tools
A development utility to automatically fix relative imports by replacing them with path aliases defined in your tsconfig.json. Ideal for streamlining large codebases with consistent import paths.
@korautils/alias-fixer is a development library designed to automatically fix relative imports in JavaScript/TypeScript projects by replacing them with module alias imports defined in the tsconfig.json
file. This helps maintain cleaner and more organized code, using alias paths instead of cumbersome relative paths.
To install the library, simply add it as a development dependency in your project:
npm install --save-dev @korautils/alias-fixer
tsconfig.json
file: Ensure that your project has a tsconfig.json
file with module aliases set under the compilerOptions.paths property.{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}
}
npx @korautils/alias-fixer --dir=./src --types=ts,tsx,jsx,js
--dir
: Specifies the directory where the files will be searched. (Default is ./).--types
: List of file extensions to process (Default is ts,tsx,jsx,js).If you have a file with a relative import:
import { EMAIL_REGEX } from '../../../../constants';
After running the library, it will be updated to:
import { EMAIL_REGEX } from '@/modules/core/constants';
If you encounter any bugs or issues while using the library, please report them using one of the following methods:
Please include as much detail as possible, including:
FAQs
A development utility to automatically fix relative imports by replacing them with path aliases defined in your tsconfig.json. Ideal for streamlining large codebases with consistent import paths.
We found that @korautils/alias-fixer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.