Feature Sliced Eslint Config Versions Save

🍰 Lint feature-sliced concepts by existing eslint plugins

v0.1.0-beta.6

2 years ago

What's Changed

  • feat: (public-api) DangerousMode: Allow custom shared segments with _prefix by @Krakazybik in https://github.com/feature-sliced/eslint-config/pull/88

    Use carefully and at your own risk

    import { ... } from "shared/lib"       // 🟩 valid
    import { ... } from "shared/library"   // 🟥 not valid
    import { ... } from "shared/_library"  // 🟩 again valid (as custom shared-segment)
    
  • feat: (layer-slices) DangerousMode: Allow cross-imports for _prefix slices by @Krakazybik in https://github.com/feature-sliced/eslint-config/pull/95

    Use carefully and at your own risk

    import { ... } from "../HomePage";
    import { ... } from "../ProfilePage";
    // Imported into ...
    @path "pages/router"                   // 🟥 not valid (sibling slice)
    @path "pages/_router"                  // 🟩 again valid (as service directory/slice)
    
  • fix: Incorrect sorting for layer root imports by @Krakazybik in https://github.com/feature-sliced/eslint-config/pull/94

Full Changelog: https://github.com/feature-sliced/eslint-config/compare/v0.1.0-beta.5...v0.1.0-beta.6

v0.1.0-beta.5

2 years ago

v0.1.0-beta.3

2 years ago

What's Changed

Full Changelog: https://github.com/feature-sliced/eslint-config/compare/v0.1.0-beta.2...v0.1.0-beta.3

v0.1.0-beta.2

2 years ago

What's Changed

Full Changelog: https://github.com/feature-sliced/eslint-config/compare/v0.1.0-beta...v0.1.0-beta.2

v0.1.0-beta

2 years ago

Beta-testing usage ready version

Leave your feedback here

Supported rules

CHANGELOG

Full Changelog: https://github.com/feature-sliced/eslint-config/compare/v0.1.0-alpha...v0.1.0-beta

v0.1.0-alpha

2 years ago

First prototype with base boundaries

Leave your feedback here

CHANGELOG

FDD-v0.1.1

3 years ago

Hello everyone!

Its our first "message" for feature-driven approach

You can see other planned solutions on org page

CHANGELOG

restrict imports (not private paths, only public API)
// Fail
import { Issues } from "pages/issues";
import { IssueDetails } from "features/issue-details"
import { Button } from "shared/components/button";

// Pass
import Routing from "pages"; // specific pages shouldn't be reexported
import { IssueDetails } from "features" // all features should be reexported, for usage
import { Button } from "shared/components"; // all components should be reexported, for usage
order imports (app > pages > features > shared > models)
// Fail
import { Helper } from "./helpers";
import axios from "axios";
import { data } from "../fixtures";
import { Button } from "shared/components"
import { IssueDetails, RepoList } from "features"
import { debounce } from "shared/helpers"

// Pass
import axios from "axios"; // 1) external libs
import { IssueDetails, RepoList } from "features" // 2) features
import { Button } from "shared/components" // 3) shared/**
import { debounce } from "shared/helpers"
import { data } from "../fixtures"; // 4) parent
import { Helper } from "./helpers"; // 5) sibling
use only absolute imports (relative - only for module internal using)

NOTE: Be sure, that your tsconfig allows you to use absolute imports

  • baseUrl: "./src"
// Fail
import Routing from "../../pages"
import { IssueDetails } from "../features";
import { Button } from "../shared/components";

// Pass
import Routing from "pages"
import { IssueDetails } from "features";
import { Button } from "shared/components";