
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
eslint-plugin-ferramentas
Advanced tools
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
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.
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] } };
🔧 Automatic fixes available
There should be no empty lines in a import group
There should be one empty line between import groups
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';
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.
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] } };
🔧 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'
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';
Prevents importing of files in specific folders from other specified locations of the codebase through regex.
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] } };
Importing of './foo' is forbidden on './moo'
FAQs
A bundle of useful ESLint rules
The npm package eslint-plugin-ferramentas receives a total of 403 weekly downloads. As such, eslint-plugin-ferramentas popularity was classified as not popular.
We found that eslint-plugin-ferramentas demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.