Skip to content
This repository has been archived by the owner on May 6, 2023. It is now read-only.

Latest commit

 

History

History
24 lines (14 loc) · 851 Bytes

no-relative-path-to-parent-directory.md

File metadata and controls

24 lines (14 loc) · 851 Bytes

Relative path to parent directories in import statements are not allowed. (no-relative-path-to-parent-directory)

This rule is useful for enforcing tree-like folder structures instead of complex graph-like folder structures. While this restriction might be a departure from Node's default resolution style, it can lead large, complex codebases to be easier to maintain.

Rule Details

This rule aims to ensure that there is no relative parent imports in components.

Examples of incorrect code for this rule:

import { MyComponent } from "../components/MyComponent";

Examples of correct code for this rule:

import { MyComponent } from "@features/components/MyComponent";

When Not To Use It

If you don't need to prevent relative path to parent directories in import statements, you can safely disable this rule.