Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
prettier-plugin-unused-imports-configurable
Advanced tools
Prettier plugin configurable to remove unused imports from JavaScript and TypeScript files.
A Prettier plugin to remove unused imports from JavaScript and TypeScript modules, configurable to ignore specified folders.
import * as React from 'react'
, alias imports import { Component as Comp } from 'library'
, and qualified usages React.useEffect()
.npm: npm install --save-dev prettier-plugin-unused-imports-configurable
pnpm: pnpm add -D prettier-plugin-unused-imports-configurable
yarn: yarn add -D prettier-plugin-unused-imports-configurable
In your .prettierrc config file add the following to start using the plugin:
{
// ...other rules,
"plugins": ["prettier-plugin-unused-imports-configurable"]
}
To ignore specific folders add its paths to the ignoredDirectories array:
{
// ...other rules,
"plugins": ["prettier-plugin-unused-imports-configurable"],
"ignoreDirectories": ["src/specific-folder"]
}
You can also ignore specific files based on an exclusion comment. It could be on the first line of the file or among other comments, but it must be before the first import declaration:
// prettier-ignore-unused-imports-configurable
import { something } from 'somewhere';
...other imports
It works when prettier is used either by CLI (prettier --write .
) or when you save your changes if formatOnSave
option is activated in your editor.
In order to collaborate with the project you should:
git clone repo-url
.pnpm install
.pnpm format
or install the prettier extension if you are using vsc editor to format on save).pnpm test
to verify your changes doesn't have major bugs.git push [remote-repo-alias] [branch-name]
.NOTE: To make sure your changes behave as expected it is recommended to install the plugin in another project throught pmpn link. With pnpm you only need to pnpm add -D local/path-to/your-folder/prettier-plugin-unused-imports-configurable
and that would be enought to use your local version of the plugin in your consumer project. You can check it looking inside the node_modules folder as any other package or running the commnad ls -l node_modules/prettier-plugin-unused-imports-configurable
with a response similar yo prettier-plugin-unused-imports-configurable -> ~/Path-to/your-local-folder/prettier-plugin-unused-imports-configurable
.
The MIT License. Full License here
FAQs
Prettier plugin configurable to remove unused imports from JavaScript and TypeScript files.
The npm package prettier-plugin-unused-imports-configurable receives a total of 122 weekly downloads. As such, prettier-plugin-unused-imports-configurable popularity was classified as not popular.
We found that prettier-plugin-unused-imports-configurable demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.