Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
eslint-plugin-import-helpers
Advanced tools
Originally forked/inspired by eslint-plugin-import and this fork
This package was created to supplement the rules provided by eslint-plugin-import. There are a lot of great rules in there, but we found it missing a few key use cases.
order-imports
Enforce a configurable convention in module import order. See the order-imports
page for configuration details.
// Given ESLint Config
rules: {
'import-helpers/order-imports': [
'warn',
{
newlinesBetween: 'always', // new line between groups
groups: [
'module',
'/^@shared/',
['parent', 'sibling', 'index'],
],
alphabetize: { order: 'asc', ignoreCase: true },
},
],
}
// will fix
import SiblingComponent from './SiblingComponent';
import lodash from 'lodash';
import SharedComponent from '@shared/components/SharedComponent';
import React from 'react';
// into
import lodash from 'lodash';
import React from 'react';
import SharedComponent from '@shared/components/SharedComponent';
import SiblingComponent from './SiblingComponent';
npm install eslint-plugin-import-helpers -g
or if you manage ESLint as a dev dependency:
# inside your project's working tree
npm install eslint-plugin-import-helpers --save-dev
To add a rule, update your .eslintrc.(yml|json|js)
:
{
// .eslintrc.js
plugins: ['eslint-plugin-import-helpers'],
rules: {
'import-helpers/order-imports': [
'warn',
{ // example configuration
newlinesBetween: 'always',
groups: [
'module',
'/^@shared/',
['parent', 'sibling', 'index'],
],
alphabetize: { order: 'asc', ignoreCase: true },
},
],
}
}
To use this plugin with TypeScript, you must use the TypeScript parser for ESLint. See @typescript-eslint/parser for more details.
Name | Version |
---|---|
node.js | 16.x |
First, npm install
Then, npm test
FAQs
ESLint Rules to Aid with Imports
The npm package eslint-plugin-import-helpers receives a total of 68,944 weekly downloads. As such, eslint-plugin-import-helpers popularity was classified as popular.
We found that eslint-plugin-import-helpers demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.