
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
eslint-plugin-beautiful-sort
Advanced tools
eslint plugin to sort imports by their type
From:
import './styles.css';
import { compose, pipe, curry } from 'src/utils/fp';
import ApiService, { Options } from './api.service';
import Link from '../Link';
import * as utils from 'src/utils';
import React from 'react';
To:
import React from 'react'; // special
import * as utils from 'src/utils'; // namespace
import Link from '../Link'; // default
import ApiService, { Options } from './api.service'; // defaultObj
import { compose, pipe, curry } from 'src/utils/fp'; // obj
import './styles.css'; // none
Disable sorting:
/* eslint-disable beautiful-sort/import */
import './styles.css';
import { compose, pipe, curry } from 'src/utils/fp';
import ApiService, { Options } from './api.service';
import Link from '../Link';
import * as utils from 'src/utils';
import React from 'react';
{
"node": "^18.14.0",
"npm": "^9.3.1",
"eslint": "^8.38.0"
}
npm i -D eslint-plugin-beautiful-sort
{
"plugins": ["beautiful-sort"],
"rules": {
"beautiful-sort/import": [
"error",
{
"special": ["react"],
"order": ["special", "namespace", "default", "defaultObj", "obj", "none"]
}
]
}
}
special is an array of module paths or a string regexp such as "/^src/utils/string$/"
order is an array of import types;
import type is a string that specifies one of the following imports:
import React from 'react'; // special
import * as utils from 'src/utils'; // namespace
import Link from '../Link'; // default
import ApiService, { Options } from './api.service'; // defaultObj
import { compose, pipe, curry } from 'src/utils/fp'; // obj
import './styles.css'; // none
FAQs
eslint plugin for imports sort by their type
The npm package eslint-plugin-beautiful-sort receives a total of 124 weekly downloads. As such, eslint-plugin-beautiful-sort popularity was classified as not popular.
We found that eslint-plugin-beautiful-sort 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.