eslint-plugin-import-replace
v1.0.0
Published
Change import source
Maintainers
Readme
eslint-plugin-import-replace
Change import source
Installation
You'll first need to install ESLint:
npm i eslint --save-devNext, install eslint-plugin-import-replace:
npm install eslint-plugin-import-replace --save-devUsage
Add import-replace to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"import-replace"
]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"import-replace/import-replace": ["error", [
{
"from": "lodash",
"to": "lodash-es"
}
]]
}
}then run eslint on your project.
if your code is
import { get } from 'lodash';then it will be autofixed to
import { get } from 'lodash-es';Configurations
TODO: Run eslint-doc-generator to generate the configs list (or delete this section if no configs are offered).
Rules
🔧 Automatically fixable by the --fix CLI option.
| Name | 🔧 | | :--------------------------------------------- | :- | | import-replace | 🔧 |
