Skip to content

Commit 2c829c3

Browse files
committed
add fixes
1 parent d51eb51 commit 2c829c3

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/rules/order.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ function getSorter(ascending) {
257257
} else {
258258
const A = importA.split('/');
259259
const B = importB.split('/');
260-
const a = A.length
261-
const b = B.length
260+
const a = A.length;
261+
const b = B.length;
262262

263-
for (var i = 0; i < Math.min(a,b); i++) {
263+
for (let i = 0; i < Math.min(a,b); i++) {
264264
if (A[i] < B[i]) {
265265
result = -1;
266266
break;
@@ -270,8 +270,8 @@ function getSorter(ascending) {
270270
}
271271
}
272272

273-
if (!result && a != b) {
274-
result = a < b ? -1 : 1
273+
if (!result && a !== b) {
274+
result = a < b ? -1 : 1;
275275
}
276276
}
277277

tests/src/rules/order.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,8 @@ ruleTester.run('order', rule, {
713713
import d from "foo/barfoo";
714714
import a from "foo";`,
715715
options: [{
716-
alphabetize: { order: 'desc' },
717-
}],
716+
alphabetize: { order: 'desc' },
717+
}],
718718
}),
719719
// Option alphabetize with newlines-between: {order: 'asc', newlines-between: 'always'}
720720
test({

0 commit comments

Comments
 (0)