eslint-plugin-beautiful-sort
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "eslint-plugin-beautiful-sort", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "eslint plugin for import sort", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -27,2 +27,3 @@ const eslint = require('eslint'); | ||
TYPES.special, | ||
TYPES.namespace, | ||
TYPES.default, | ||
@@ -92,2 +93,7 @@ TYPES.defaultObj, | ||
const sorted = order.reduce((state, key) => [...state, ...importsState[key]], []); | ||
if( importsState.rest.length ) { | ||
sorted.push(...importsState.rest); | ||
}; | ||
const sourceCode = context.getSourceCode(); | ||
@@ -101,3 +107,3 @@ | ||
context.report({ | ||
message: `It must be ${i + 1}, but it is ${index + 1}`, | ||
message: `${sourceCode.getText(node)} must be ${i + 1}, but it is ${index + 1}`, | ||
node, | ||
@@ -104,0 +110,0 @@ fix: (fixer) => fixer.replaceTextRange(targetNode.range, sourceCode.getText(node)) |
@@ -98,4 +98,26 @@ const { RuleTester } = require('eslint'); | ||
errors: 4 | ||
}, | ||
{ | ||
code: combineCodeArr([ | ||
"import 'Test.scss';", | ||
"import A from 'a';", | ||
"import * as Kek from 'kek';", | ||
"import * as Kek2 from 'kek2';", | ||
"import React from 'react';", | ||
]), | ||
options: [ | ||
{ | ||
order: ['special', 'default', 'none'] | ||
} | ||
], | ||
output: combineCodeArr([ | ||
"import React from 'react';", | ||
"import A from 'a';", | ||
"import 'Test.scss';", | ||
"import * as Kek from 'kek';", | ||
"import * as Kek2 from 'kek2';", | ||
]), | ||
errors: 4 | ||
} | ||
] | ||
}) |
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
9703
290