feature-sliced / eslint-config

🍰 Lint feature-sliced concepts by existing eslint plugins
https://npmjs.com/@feature-sliced/eslint-config
MIT License
120 stars 5 forks source link

LINT: Imports order #13

Closed azinit closed 2 years ago

azinit commented 3 years ago

Description

// Fail
import { getSmth } from "./lib";
import axios from "axios";
import { data } from "../fixtures";
import { authModel } from "entities/auth";
import { Button } from "shared/ui";
import { LoginForm } from "features/login-form";
import { Header } from "widgets/header";
import { debounce } from "shared/lib/fp";

// Pass
import axios from "axios";                           // 1) external libs
import { Header } from "widgets/header";             // 2.1) Layers: widgets
import { LoginForm } from "features/login-form";     // 2.2) Layers: features
import { authModel } from "entities/auth";           // 2.3) Layers: entities
import { Button } from "shared/ui";                  // 2.4) Layers: shared
import { debounce } from "shared/lib/fp";            // 2.4) Layers: shared
import { data } from "../fixtures";                  // 3) parent
import { getSmth } from "./lib";                     // 4) sibling

Reference

https://github.com/feature-sliced/eslint-config/blob/e2355626e1cb01d3b27ab0d8cb5df4e679d11b12/index.legacy.js#L37-L65