This update fixes a critical issue in the ordered-imports
rule where non-FSD imports were unintentionally removed when using --fix
.
Now, all imports that do not belong to the Feature-Sliced Design (FSD) structure remain in place, while FSD-based imports are correctly sorted.
🔄 Changes in v1.0.5
- 📌 Fix: Prevent
ordered-imports
from deleting non-FSD imports - ✅ Only FSD-layer imports are sorted, while external and non-FSD imports remain untouched
- 🛠 Enhanced
--fix
behavior to maintain import integrity - 🚀 Published
v1.0.5
with improved ordering logic
📦 Installation
npm install --save-dev eslint-plugin-fsd-lint
🔧 Updated Ordered Imports Rule
This rule now preserves non-FSD imports and only reorders Feature-Sliced Design-based imports.
❌ Before (npx eslint .
warning)
import React from "react";
import { fetchUser } from "../features/user";
import { processPayment } from "../features/payment";
import { getUser } from "../entities/user";
import { formatCurrency } from "../shared/utils";
import { Header } from "../widgets/Header";
import { useStore } from "../app/store";
✅ After (npx eslint --fix
applied)
import React from "react"; // ✅ External import remains untouched
import { useStore } from "../app/store"; // ✅ App layer
import { fetchUser } from "../features/user"; // ✅ Features
import { processPayment } from "../features/payment";
import { getUser } from "../entities/user"; // ✅ Entities
import { formatCurrency } from "../shared/utils"; // ✅ Shared
import { Header } from "../widgets/Header"; // ✅ Widgets
🎯 Next Steps
- Ensure that all rules are correctly applied in your ESLint configuration.
- Test the plugin in real projects and provide feedback!
- Contribute by submitting new rule ideas or improvements.