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 1.0.4 to 1.0.5

2

package.json
{
"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
}
]
})
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