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

@actcoding/eslint-plugin-import-newlines

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@actcoding/eslint-plugin-import-newlines

ESLint plugin for enforcing newlines in ES6 import statements past a certain number of items.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

NPM Version NPM Last Update

@actcoding/eslint-plugin-import-newlines

ESLint plugin for enforcing newlines in ES6 import statements past a certain number of items.

Parts of the code are taken from SeinopSys/eslint-plugin-import-newlines, which is also MIT licensed.

Turns this:

import { AlertDialog, AlertDialogCancel, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from './ui/alert-dialog'

into this:

import {
	AlertDialog,
	AlertDialogCancel,
	AlertDialogContent,
	AlertDialogFooter,
	AlertDialogHeader,
	AlertDialogTitle
} from './ui/alert-dialog'

Install

npm install -D @actcoding/eslint-plugin-import-newlines

Usage

eslint.config.js

import importNewlinesPlugin from '@actcoding/eslint-plugin-import-newlines'

/** @type {import('eslint').Linter.Config[]} */
const config = [
    importNewlinesPlugin.configs.recommended,
]

export default config

Manual

eslint.config.js

import importNewlinesPlugin from '@actcoding/eslint-plugin-import-newlines'

/** @type {import('eslint').Linter.Config[]} */
const config = [
    {
        name: 'app/style/imports',
        plugins: {
            '@import-newlines': importNewlinesPlugin,
        },
        rules: {
            '@import-newlines/enforce': [
                'error',
                {
                    'maxItems': 4,
                    'maxLineLength': 120,
                },
            ],
        },
    },
]

export default config

Rules

@import-newlines/enforce

Enforce multiple lines for import statements past a certain number of items

Options
OptionTypeDefaultDescription
maxItemsinteger4maximum amount of imported items per line
maxLineLengthinteger120maximum line length of an import statement

FAQs

Package last updated on 07 Dec 2024

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