Skip to content

Releases: effozen/eslint-plugin-fsd-lint

🚀 Release v1.0.5 - Improved Ordered Imports Rule 🎉

30 Jan 17:18
Compare
Choose a tag to compare

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.

📖 Full Documentation

🚀 Release v1.0.4 - Fixed NPM Publish Issue 🎉

30 Jan 17:08
Compare
Choose a tag to compare

This update addresses an issue where NPM prevented re-publishing the same version (1.0.3).
To resolve this, eslint-plugin-fsd-lint has been released as v1.0.4.

🔄 Changes in v1.0.4

  • 📌 Version bumped to 1.0.4 to fix NPM publish error (403 Forbidden)
  • 🔧 GitHub Actions automatically deploys new versions to NPM
  • 🚀 Published v1.0.4 with correct metadata and dependencies

📦 Installation

npm install --save-dev eslint-plugin-fsd-lint

🛠 GitHub Actions & NPM Automation

With this release, publishing to NPM is now fully automated using GitHub Actions:

  • Pushing a new version tag (e.g., v1.0.4) will trigger an automatic deployment to NPM.
  • The package is now seamlessly linked with GitHub Releases & NPM Registry.

🔧 How to Upgrade

If you're using a previous version, update with:

npm update eslint-plugin-fsd-lint

or

npm install eslint-plugin-fsd-lint@latest

🎯 Next Steps

  • Ensure that GitHub Actions is correctly publishing future versions.
  • Test the plugin in real projects and provide feedback!

📖 Full Documentation

🚀 Release v1.0.3 - Fixed Rule Imports & Added Tests 🚀

30 Jan 16:42
Compare
Choose a tag to compare

This update includes major improvements to module resolution and testing for better integration with ESLint 9+.

Fixed import paths for ESLint rules
Added unit tests for rule validation
Updated .gitignore to include test files

🔄 Changes in v1.0.3

  • 📌 Updated import paths for ESLint rules
    • Fixed incorrect rule paths (./rules/fsd-*.js./rules/*.js).
    • Ensured .js extensions are explicitly included for ESM compatibility.
  • 🛠 Added test files to track rule validation
    • Created a test suite under tests/
    • Ensured all core rules have corresponding test cases.
  • 🗂 Updated .gitignore to allow tests/ directory
    • Removed previous exclusion rule that ignored test files.
  • 🚀 Published v1.0.3 to NPM with the latest fixes.

📦 Installation

npm install --save-dev eslint-plugin-fsd-lint

🔧 Updated Import Paths in src/index.js

import forbiddenImports from "./rules/forbidden-imports.js";
import noRelativeImports from "./rules/no-relative-imports.js";
import noPublicApiSidestep from "./rules/no-public-api-sidestep.js";
import noCrossSliceDependency from "./rules/no-cross-slice-dependency.js";
import noUiInBusinessLogic from "./rules/no-ui-in-business-logic.js";
import noGlobalStoreImports from "./rules/no-global-store-imports.js";
import orderedImports from "./rules/ordered-imports.js";

export default {
  rules: {
    "forbidden-imports": forbiddenImports,
    "no-relative-imports": noRelativeImports,
    "no-public-api-sidestep": noPublicApiSidestep,
    "no-cross-slice-dependency": noCrossSliceDependency,
    "no-ui-in-business-logic": noUiInBusinessLogic,
    "no-global-store-imports": noGlobalStoreImports,
    "ordered-imports": orderedImports
  },
};

🧪 New Test Suite

This release includes unit tests for ESLint rules.
📌 Run tests with the following command:

npm run test

📌 Test directory structure:

tests/
├── forbidden-imports.test.js
├── no-relative-imports.test.js
├── no-public-api-sidestep.test.js
├── no-cross-slice-dependency.test.js
├── no-ui-in-business-logic.test.js
├── no-global-store-imports.test.js
├── ordered-imports.test.js

🎯 Next Steps

  • Ensure all rules are correctly applied in your ESLint configuration.
  • Test the plugin in real projects and report any issues.
  • Contribute by adding new tests or suggesting improvements!

📖 Full Documentation

🚀 Release v1.0.2 - GitHub Repository Integration 🎉

30 Jan 16:28
Compare
Choose a tag to compare

This update links the NPM package with the GitHub repository,
making it easier to track issues, contributions, and documentation.

🔄 Changes in v1.0.2

  • 📌 Added GitHub repository link to package.json
    • "repository" → Links the NPM package to GitHub.
    • "bugs" → Directs users to the issue tracker.
    • "homepage" → Provides a direct link to the README.
  • 🛠 Updated documentation and metadata for better visibility
  • 🚀 Published v1.0.2 to NPM with the latest metadata changes

📦 Installation

npm install --save-dev eslint-plugin-fsd-lint

🔗 New GitHub Integration

🎯 Next Steps

  • Test the plugin in real projects and provide feedback!
  • Contribute by submitting new rule ideas or improvements.

📖 Full Documentation

🚀 Release v1.0.1 - Initial Public Release 🎉

30 Jan 16:02
Compare
Choose a tag to compare

This is the first public release of eslint-plugin-fsd-lint!
It includes a set of ESLint rules specifically designed for Feature-Sliced Design (FSD) architecture.

🔍 Included Rules

fsd/forbidden-imports - Prevents imports from higher layers and cross-slice imports.
fsd/no-relative-imports - Enforces alias usage instead of relative imports.
fsd/no-public-api-sidestep - Prevents direct imports from internal modules, enforcing public API usage.
fsd/no-cross-slice-dependency - Disallows direct dependencies between feature slices.
fsd/no-ui-in-business-logic - Prevents UI imports inside business logic layers.
fsd/no-global-store-imports - Forbids direct imports of global state (store).
fsd/ordered-imports - Enforces import grouping by layer.

📦 Installation

npm install --save-dev eslint-plugin-fsd-lint

🔧 Usage

import fsdPlugin from "eslint-plugin-fsd-lint";

export default [
  {
    plugins: {
      fsd: fsdPlugin,
    },
    rules: {
      "fsd/forbidden-imports": "error",
      "fsd/no-relative-imports": "error",
      "fsd/no-public-api-sidestep": "error",
      "fsd/no-cross-slice-dependency": "error",
      "fsd/no-ui-in-business-logic": "error",
      "fsd/no-global-store-imports": "error",
      "fsd/ordered-imports": "warn"
    },
  },
];

🎯 Next Steps

Test the plugin in real projects and provide feedback!
Contribute by submitting new rule ideas or improvements.

📖 Full Documentation