New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@feature-driven/eslint-config

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@feature-driven/eslint-config

📓 Lint feature-driven rules by standard eslint plugins

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

@feature-driven/eslint-config

npm npm npm bundle size Hits GitHub Workflow Status GitHub commit activity

Linting of Feature Driven Architecture principles by standard eslint-plugins

But unfortunately, while it can't allow you

Also, strictness level limited by plugins API

More power - in our @feature-driven/eslint-plugin

Overview

See included rules

This config help you

to 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
to 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
to 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";

Get started

  1. You'll first need to install ESLint (with default plugins):

    $ npm install --save-dev eslint
    
  2. Next, install @feature-driven/eslint-config:

    $ npm install --save-dev @feature-driven/eslint-config
    
  3. Add config to the extends section of your eslint configuration file. You can omit the eslint-plugin suffix:

    {
        "extends": ["@feature-driven"]
    }
    

Further, you can override / disable some rules if needed.

Also

  • You want to participate in the development of the project? Have a look at our contributing guide!

    Commit like nobody sees, Push like nobody hears

  • FAQ

Keywords

FAQs

Package last updated on 10 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc