
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
eslint-plugin-no-relative-import-paths
Advanced tools
Moving a file to different folder, could result in changing all imports statement in that file. This will not happen is the import paths are absolute. The eslint rule helps enforcing having absolute import paths. Support eslint --fix to automatically chan
Moving a file to different folder, could result in changing all imports statement in that file. This will not happen is the import paths are absolute. The eslint rule helps enforcing having absolute import paths. Support eslint --fix to automatically change imports to absolute paths.
Install ESLint either locally or globally. (Note that locally, per project, is strongly preferred)
$ npm install eslint --save-dev
If you installed ESLint
globally, you have to install this plugin globally too. Otherwise, install it locally.
$ npm install eslint-plugin-no-relative-import-paths --save-dev
Add the plugin to the plugins section, and configure the rule options.
{
"plugins": ["no-relative-import-paths"],
"rules": {
"no-relative-import-paths/no-relative-import-paths": [
"warn",
{ "allowSameFolder": true }
]
}
}
...
"no-relative-import-paths/no-relative-import-paths": [
"warn",
{ "allowSameFolder": true }
]
...
enabled
: for enabling the rule. 0=off, 1=warn, 2=error. Defaults to 0.ignorePureComponents
: optional boolean set to true
to allow relative import paths for imported files from the same folder (default to false
).allowSameFolder
When true
the rule will ignore relative import paths for imported files from the same folder
Examples of code for this rule:
// when true this will be ignored
// when false this will generate a warning
import Something from "./something";
// will always generate a warning
import Something from "../modules/something";
FAQs
Moving a file to different folder, could result in changing all imports statement in that file. This will not happen is the import paths are absolute. The eslint rule helps enforcing having absolute import paths. Support eslint --fix to automatically chan
The npm package eslint-plugin-no-relative-import-paths receives a total of 221,811 weekly downloads. As such, eslint-plugin-no-relative-import-paths popularity was classified as popular.
We found that eslint-plugin-no-relative-import-paths 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.