eslint-plugin-sort-imports-requires
Advanced tools
Comparing version 1.0.1 to 1.0.2
rebuild | ||
# Changelog | ||
## [1.0.2](https://github.com/uphold/eslint-plugin-sort-imports-requires/releases/tag/v1.0.2) (2022-02-25) | ||
- Change sorting of declarations without name to be stable [\#3](https://github.com/uphold/eslint-plugin-sort-imports-requires/pull/3) ([satazor](https://github.com/satazor)) | ||
# Changelog | ||
## [1.0.1](https://github.com/uphold/eslint-plugin-sort-imports-requires/releases/tag/v1.0.1) (2022-02-24) | ||
@@ -5,0 +9,0 @@ - Fix bugs in edge case scenarios [\#2](https://github.com/uphold/eslint-plugin-sort-imports-requires/pull/2) ([satazor](https://github.com/satazor)) |
@@ -114,2 +114,7 @@ const once = require('once'); | ||
// Case in which names are equal (e.g.: both are null). | ||
if (nameA === nameB) { | ||
return 0; | ||
} | ||
return nameA > nameB ? 1 : -1; | ||
@@ -116,0 +121,0 @@ }); |
{ | ||
"name": "eslint-plugin-sort-imports-requires", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "An ESLint plugin to sort both import and require declarations in a unified manner.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -157,2 +157,25 @@ const rule = require('../lib').rules['sort-requires']; | ||
}, | ||
// Special case in which unassigned requires shouldn't have their order changed after autofixing. | ||
{ | ||
code: ` | ||
require('a'); | ||
require('b'); | ||
require('c'); | ||
const b = require('foo'); | ||
const a = require('foo'); | ||
`, | ||
errors: [ | ||
{ message: "Expected require declaration of 'a' to be placed before 'b'.", type: 'VariableDeclaration' } | ||
], | ||
options: [{ unsafeAutofix: true }], | ||
output: ` | ||
require('a'); | ||
require('b'); | ||
require('c'); | ||
const a = require('foo'); | ||
const b = require('foo'); | ||
` | ||
}, | ||
// Declaration sort - `ignoreCase` option. | ||
@@ -159,0 +182,0 @@ { |
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
224202
1793