Socket
Book a DemoInstallSign in
Socket

eslint-plugin-ferramentas

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-ferramentas

A bundle of useful ESLint rules

2.0.1
latest
Source
npmnpm
Version published
Weekly downloads
403
42.91%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-ferramentas

This package contains 3 ESLint rules.
As all these rules need configuration by default, no plugin preset is exported.
Install it by running npm install --save-dev eslint-plugin-ferramentas

Rules

import-spaces

Enforces consistency of spacing between relative imports according to the folder each imports reference.
Imports are grouped as defined in the configuration, spaces are only allowed between the groups.
Non relative imports, and relative imports without a specified group will be considered to be each in their own group, thus having spaces between them as well.

Configuration

To configure the rule on .eslintrc.js, simply add:

/** @type {import('eslint-plugin-ferramentas').Options['import-spaces']} */
const options = {
    groups: ['^foo.*$', '^bar.*$'],
};

module.exports = { rules: { 'ferramentas/import-spaces': ['error', options] } };

Possible errors examples

🔧 Automatic fixes available

There should be no empty lines in a import group

There should be one empty line between import groups

Fixes

When configured with:

{
    "groups": ["^foo.*$", "^bar.*$"]
}

Will change:

import { DomainType } from 'static';

import { FooA } from './foo/a';

import { FooB } from './foo/b';
import { Bar } from './bar';

import { Other } from './other';

To:

import { DomainType } from 'static';

import { FooA } from './foo/a';
import { FooB } from './foo/b';

import { Bar } from './bar';

import { Other } from './other';

relative-import-order

Ensure relative imports appear in a specific order as set on the configuration.
The paths must be set with root paths and not from the perspective of the files where the import actually happens.

Configuration

To configure the rule on .eslintrc.js, simply add:

/** @type {import('eslint-plugin-ferramentas').Options['relative-import-order']} */
const options = {
    sort: [
        {
            type: 'group',
            groups: ['src/utils', 'src/domain', 'src/react'],
        },
        {
            type: 'depth',
        },
        {
            type: 'name',
        },
    ],
};

module.exports = { rules: { 'ferramentas/relative-import-order': ['error', options] } };

Possible errors examples

🔧 Automatic fixes available

The path './foo/bar' is not listed. All imported paths need to be included, either in the groups (so they are sorted) or ignored

Imports from './foo' should be above the import from './bar'

Fixes

When configured with:

{
    "sort": [
        {
            "type": "group",
            "groups": ["top-library", "bottom-library"]
        },
        {
            "type": "depth"
        },
        {
            "type": "name"
        }
    ]
}

Will change (while on the file ./bottom-library/ExampleImporter.tsx):

import { Label } from '../bottom-library';
import { isBufferValid } from '../top-library';
import { SpanishInquisition } from '../non-listed/import-path';

To:

import { isBufferValid } from '../top-library';
import { Label } from '../bottom-library';
import { SpanishInquisition } from '../non-listed/import-path';

siloed-relative-import

Prevents importing of files in specific folders from other specified locations of the codebase through regex.

Configuration

To configure the rule on .eslintrc.js, simply add:

/** @type {import('eslint-plugin-ferramentas').Options['siloed-relative-import']} */
const options = {
    directories: [
        {
            filter: '^src/react',
            forbid: ['^src/http'],
        },
    ],
};

module.exports = { rules: { 'ferramentas/siloed-relative-import': ['error', options] } };

Possible errors examples

Importing of './foo' is forbidden on './moo'

Keywords

clean architecure

FAQs

Package last updated on 05 Sep 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.