Releases: feature-sliced/eslint-config
Releases · feature-sliced/eslint-config
v.0.1.0-beta: GodMode and other refinements
What's Changed
feat:
(public-api) DangerousMode: Allow custom shared segments with _prefix by @Krakazybik in #88Use 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 #95Use 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 #94
Full Changelog: v0.1.0-beta.5...v0.1.0-beta.6
v.0.1.0-beta: less strict PublicAPI
What's Changed
feat:
Alternative "public-api/lite" boundaries by @Krakazybik in #87
Full Changelog: v0.1.0-beta.3...v0.1.0-beta.5
v.0.1.0-beta: import-order fixes
What's Changed
feat:
Experimental config - Import order alphabetic sort, spaces and reverted layers by @Krakazybik in #84
Full Changelog: v0.1.0-beta.2...v0.1.0-beta.3
v.0.1.0-beta: First patch
What's Changed
fix:
Impossible to disable rules by customized ruleIds by @Krakazybik in #79fix:
Wrong import order for aliased layers by @Krakazybik in #81fix:
No support alias in shared layer for PublicAPI by @Krakazybik in #77
Full Changelog: v0.1.0-beta...v0.1.0-beta.2
v.0.1.0-beta
Beta-testing usage ready version
Leave your feedback here
Supported rules
CHANGELOG
fix:
LINT-53: PublicAPI for {segment}.* files by @Krakazybik in #54chore:
GITHUB-46: PR creation template by @Krakazybik in #56feat:
LINT-47: Segment Public API by @Krakazybik in #57fix:
LINT-60: PublicAPI not allow global modules access by @Krakazybik in #61fix:
LINT-55: Wrong shared boundaries. by @Krakazybik in #65fix:
LINT-55: Incorrect import order working with aliases. by @Krakazybik in #64feat:
LINT-3: Custom messages plugin by @Krakazybik in #68
Full Changelog: v0.1.0-alpha...v0.1.0-beta
v.0.1.0-alpha
Hello, World!
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";