
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
eslint-plugin-import-paths
Advanced tools
An ESLint plugin that enforces directory import rules in your project.
npm install --save-dev eslint-plugin-import-paths
Add the plugin to your ESLint configuration:
{
"plugins": ["import-paths"],
"rules": {
"import-paths/restrict-import-paths": ["error", {
"sourceFolders": ["/components/"],
"restrictedFolders": ["/modules/"]
}]
}
}
This rule prevents files in specified source directories from importing files from restricted directories.
The rule accepts an options object with the following properties:
sourceFolders (string[]): List of folder paths where the rule should be applied. Default: ["/components/"]restrictedFolders (string[]): List of folder paths that should not be imported from. Default: ["/modules/"]Default configuration (components cannot import from modules):
{
"import-paths/restrict-import-paths": "error"
}
Custom configuration:
{
"import-paths/restrict-import-paths": ["error", {
"sourceFolders": ["/components/", "/features/"],
"restrictedFolders": ["/modules/", "/internal/"]
}]
}
// In /components/MyComponent.tsx
import { something } from './local-file';
import { other } from '../../components/OtherComponent';
// In /features/MyFeature.tsx (with custom config)
import { something } from './local-file';
import { other } from '../../components/OtherComponent';
// In /components/MyComponent.tsx
import { something } from '../../modules/SomeModule';
import { other } from '@/modules/OtherModule';
// In /features/MyFeature.tsx (with custom config)
import { something } from '../../internal/SomeModule';
ISC
FAQs
ESLint plugin to enforce directory import rules
The npm package eslint-plugin-import-paths receives a total of 0 weekly downloads. As such, eslint-plugin-import-paths popularity was classified as not popular.
We found that eslint-plugin-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
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.