eslint-plugin-beautiful-sort
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"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 | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
43053
82
0