Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
eslint-plugin-align-import
Advanced tools
This plugin / rule will align all your import statements:
from
import defaultExport from "module-name";
import * as name from "module-name";
import { export1 } from "module-name";
import { export2 as alias1 } from "module-name";
import { export3 , export4 } from "module-name";
import { foo , bar } from "module-name/path/to/specific/un-exported/file";
import { export5 , export6 as alias7 } from "module-name";
import defaultExport2, { export8 } from "module-name";
import defaultExport3, * as name2 from "module-name";
to
import defaultExport from "module-name";
import * as name from "module-name";
import { export1 } from "module-name";
import { export2 as alias1 } from "module-name";
import { export3 , export4 } from "module-name";
import { foo , bar } from "module-name/path/to/specific/un-exported/file";
import { export5 , export6 as alias7 } from "module-name";
import defaultExport2, { export8 } from "module-name";
import defaultExport3, * as name2 from "module-name";
You'll first need to install ESLint:
$ npm install eslint --save-dev
Next, install eslint-plugin-align-import
:
$ npm install eslint-plugin-align-import --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-align-import
globally.
Add babel-align-import
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"babel-align-import"
]
}
You might have to update the no-multi-spaces
rule to allow multiple spaces in front of import
:
{
"rules": {
"no-multi-spaces": ["error", {"exceptions": {"ImportDeclaration": true}}]
}
}
There are two rules available:
rule | description |
---|---|
align-import/align-import | Aligns your import statements, this is probably the rule you're looking for. |
align-import/trim-import | This rule will remove any extra space around your import keyword. |
FAQs
Babel plugin to align your import statements.
The npm package eslint-plugin-align-import receives a total of 2,155 weekly downloads. As such, eslint-plugin-align-import popularity was classified as popular.
We found that eslint-plugin-align-import demonstrated a not healthy version release cadence and project activity because the last version was released 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.