GitPedia

Eslint config

๐Ÿฐ Lint feature-sliced concepts by existing eslint plugins

From feature-slicedยทUpdated June 9, 2026ยทView on GitHubยท

> `WIP:` At the moment at beta-testing - [use carefully](https://github.com/feature-sliced/eslint-config/discussions/75) The project is written primarily in JavaScript, distributed under the MIT License license, first published in 2021. Key topics include: absolute-imports, co-location, decoupling, domain-driven, domain-first.

Latest release: v0.1.0-beta.6โ€” v.0.1.0-beta: GodMode and other refinements
February 12, 2022View Changelog โ†’

@feature-sliced/eslint-config

WIP: At the moment at beta-testing - use carefully

npm
npm
npm bundle size
GitHub Workflow Status

<img src="https://avatars.githubusercontent.com/u/60469024?s=120&v=4" align="right">

Linting of FeatureSliced concepts by existing eslint-plugins

<!-- Uncomment if will be needed ## Table of contents * [Overview](#overview) * [Get started](#get-started) * [Usage](#usage) * [Also](#also) -->

Rules

Each rule has its own test cases and customization aspects

Get Started

  1. You'll first need to install ESLint:

    sh
    $ npm install -D eslint # or by yarn $ yarn add -D eslint $ or by pnpm $ pnpm add -D eslint
  2. Next, install @feature-sliced/eslint-config and dependencies:

    sh
    $ npm install -D @feature-sliced/eslint-config eslint-plugin-import eslint-plugin-boundaries # or by yarn $ yarn add -D @feature-sliced/eslint-config eslint-plugin-import eslint-plugin-boundaries # or by pnpm $ pnpm add -D @feature-sliced/eslint-config eslint-plugin-import eslint-plugin-boundaries
  3. Add config to the extends section of your .eslintrc configuration file (for recommended rules). You can omit the eslint-config postfix:

    json
    { "extends": ["@feature-sliced"] }
  4. TYPESCRIPT-ONLY: Also setup TS-parser and TS-plugin (why?)

    <details> <summary>Details</summary>

    Install dependencies:

    sh
    $ npm i -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-typescript # or by yarn $ yarn add -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-import-resolver-typescript

    Configure @typescript-eslint/parser as parser and setup the eslint-import-resolver-typescript resolver in the .eslintrc config file:

    json
    { "parser": "@typescript-eslint/parser", "settings": { "import/resolver": { "typescript": { "alwaysTryTypes": true } } } }
    </details>

Usage

  • Support general aliases

    js
    import { Input } from "~/shared/ui/input"; import { Input } from "@/shared/ui/input"; import { Input } from "@shared/ui/input"; import { Input } from "$shared/ui/input"; // But not - import { Input } from "$UIKit/input";
  • Support relative and absolute imports (but look at recommendations)

    js
    import { ... } from "entities/foo"; // absolute imports import { ... } from "@/entities/foo"; // aliased imports import { ... } from "../entities/foo"; // relative imports
  • Case-agnostic

    js
    import { ... } from "entities/user-post"; // Support kebab-case (recommended) import { ... } from "entities/UserPost"; // Support PascalCase import { ... } from "entities/userPost"; // Support camelCase import { ... } from "entities/user_post"; // Support snake_case
  • For exceptional cases, support โš ๏ธDANGEROUS-modeโš ๏ธ (see more for specific rule)

Customization

  1. You can partially use the rules

    WARN: Don't use main config ("@feature-sliced") in customization to avoid rules conflicts.

    js
    "extends": [ "@feature-sliced/eslint-config/rules/import-order", "@feature-sliced/eslint-config/rules/public-api", "@feature-sliced/eslint-config/rules/layers-slices", ]
  2. You can use alternative experimental rules

    • Use import-order/experimental for formatting with spaces between groups and reversed order of layers (why?)

      js
      "extends": [ // ... Other rules or config "@feature-sliced/eslint-config/rules/import-order/experimental", ]
    • Use public-api/lite for less strict PublicAPI boundaries (why?)

      js
      "extends": [ // ... Other rules or config "@feature-sliced/eslint-config/rules/public-api/lite", ]
  3. You can use warnings instead of errors for specific rules

    js
    "rules": { // feature-sliced/import-order "import/order": "warn" // ~ 1, // feature-sliced/public-api "import/no-internal-modules": "warn" // ~ 1, // feature-sliced/layers-slices "boundaries/element-types": "warn" // ~ 1, }
  4. You can use advanced FSD-specific messages processing

    diff
    # (feature-sliced/public-api) - 'Reaching to "features/search/ui" is not allowed.' + 'Violated usage of modules Public API | https://git.io/Jymjf'

See also

Contributors

Showing top 6 contributors by commit count.

View all contributors on GitHub โ†’

This article is auto-generated from feature-sliced/eslint-config via the GitHub API.Last fetched: 6/21/2026