ESLint plugin
This project is maintained by iliubinskii
ESLint plugin / no-sibling-import
Restricts importing siblings.
module.exports = {
plugins: ["misc"],
rules: {
"misc/no-sibling-import": [
"error",
{
rules: [
{
_id: string,
filesToLint: string[],
filesToSkip: string[],
hierarchy: string[][]
},
...
]
}
]
}
};
| Option | Description | Default | | :—– | :———- | :—— |
rules._id |
Id | - |
rules.filesToLint |
Files to lint (minimatch patterns) | [] |
rules.filesToSkip |
Files to skip (minimatch patterns) | [] |
rules.hierarchy |
Allows some sibling dependencies | [] |
// filename: file.ts
import { x } from "./sibling-file";
// filename: file.ts
/*
eslint misc/no-sibling-import: [
error,
{
rules: [
{
hierarchy: [["./sibling-file"], ["./file"]]
}
]
}
]
*/
import { x } from "./sibling-file";
import { y } from "./folder";