Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-beautiful-sort

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-beautiful-sort - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

package.json
{
"name": "eslint-plugin-beautiful-sort",
"version": "2.0.0",
"version": "2.0.1",
"description": "eslint plugin for imports sort by their type",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -8,21 +8,25 @@ # eslint-plugin-beautiful-sort

From:
```js
import './Test.css';
import { a, b, c } from 'a';
import C, { h } from 'j';
import A from 'g';
import * as Meme from 'meme';
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:
```js
import React from 'react'; // special
import * as Meme from 'meme'; // namespace
import A from 'g'; // default
import C, { h } from 'j'; // defaultObj
import { a, b ,c } from 'a'; // obj
import './Test.css'; // none
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
```
## Plugin tested on
## Plugin tested on
```json

@@ -38,3 +42,3 @@ {

```bash
```bash
npm i -D eslint-plugin-beautiful-sort

@@ -45,10 +49,11 @@ ```

{
"plugins": [
"beautiful-sort"
],
"plugins": ["beautiful-sort"],
"rules": {
"beautiful-sort/import": ["error", {
"special": ["react"],
"order": ["special", "namespace", "default", "defaultObj", "obj", "none"]
}]
"beautiful-sort/import": [
"error",
{
"special": ["react"],
"order": ["special", "namespace", "default", "defaultObj", "obj", "none"]
}
]
}

@@ -59,15 +64,22 @@ }

## API
### Special
special is an array of module paths or a string regexp such as ```"/^src/utils/string$"```
special is an array of module paths or a string regexp such as `"/^src/utils/string$"`
### Order
order is an array of [import types](#import-type);
### Import type
import type is a string that specifies one of the following imports:
```js
import React from 'react'; // special
import * as Meme from 'meme'; // namespace
import A from 'g'; // default
import C, { h } from 'j'; // defaultObj
import { a, b ,c } from 'a'; // obj
import './Test.css'; // none
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
```
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