Skip to content

Commit 762e6f1

Browse files
🤖 config(xo): Configure import/order.
These changes were automatically generated by a transform whose code can be found at: - https://github.com/make-github-pseudonymous-again/rejuvenate/blob/5cd83ef81aaefb6f6fc541d00cc7c4791d7b4c1c/src/transforms/xo:config-import-order.js Please contact the author of the transform if you believe there was an error.
1 parent 3214b58 commit 762e6f1

23 files changed

+1067
-577
lines changed

package.json

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"pinst": "3.0.0",
9797
"power-assert": "1.6.1",
9898
"regenerator-runtime": "0.14.1",
99-
"xo": "0.53.1"
99+
"xo": "0.57.0"
100100
},
101101
"ava": {
102102
"files": [
@@ -208,7 +208,43 @@
208208
"camelcase": "off",
209209
"unicorn/prevent-abbreviations": "off",
210210
"unicorn/filename-case": "off",
211-
"unicorn/prefer-node-protocol": "off"
211+
"unicorn/prefer-node-protocol": "off",
212+
"import/order": [
213+
"error",
214+
{
215+
"groups": [
216+
"builtin",
217+
"external",
218+
"internal",
219+
"parent",
220+
"sibling",
221+
"index",
222+
"object",
223+
"type"
224+
],
225+
"pathGroups": [
226+
{
227+
"pattern": "ava",
228+
"group": "external",
229+
"position": "before"
230+
},
231+
{
232+
"pattern": "#module",
233+
"group": "index",
234+
"position": "after"
235+
}
236+
],
237+
"pathGroupsExcludedImportTypes": [],
238+
"distinctGroup": true,
239+
"newlines-between": "always",
240+
"alphabetize": {
241+
"order": "asc",
242+
"orderImportKind": "asc",
243+
"caseInsensitive": false
244+
},
245+
"warnOnUnassignedImports": true
246+
}
247+
]
212248
},
213249
"overrides": [
214250
{

src/_insertAfter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5-
import isNonEmpty from './isNonEmpty.js';
6-
import unshift from './unshift.js';
75
import _setNext from './_setNext.js';
86
import _shift from './_shift.js';
7+
import isNonEmpty from './isNonEmpty.js';
8+
import unshift from './unshift.js';
99

1010
/**
1111
* Inserts value just after input node (cannot be null).

src/_isLast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5+
import _shift from './_shift.js';
56
import isEmpty from './isEmpty.js';
67
import isNonEmpty from './isNonEmpty.js';
7-
import _shift from './_shift.js';
88

99
/**
1010
* _isLast.

src/_iter_fast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5+
import _shift from './_shift.js';
56
import isEmpty from './isEmpty.js';
67
import isNonEmpty from './isNonEmpty.js';
7-
import _shift from './_shift.js';
88

99
/**
1010
* Generator of nodes in list in order. The list cannot be empty. You should

src/_last.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5-
import isNonEmpty from './isNonEmpty.js';
65
import _isLast from './_isLast.js';
76
import _shift from './_shift.js';
7+
import isNonEmpty from './isNonEmpty.js';
88

99
/**
1010
* Return the last node of a non-empty input list.

src/_len.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5+
import _shift from './_shift.js';
56
import isEmpty from './isEmpty.js';
67
import isNonEmpty from './isNonEmpty.js';
7-
import _shift from './_shift.js';
88

99
/**
1010
* Compute the length of a non-empty list.

src/_pop.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5-
import empty from './empty.js';
6-
import isNonEmpty from './isNonEmpty.js';
75
import _isLast from './_isLast.js';
86
import _setNext from './_setNext.js';
97
import _shift from './_shift.js';
8+
import empty from './empty.js';
9+
import isNonEmpty from './isNonEmpty.js';
1010

1111
/**
1212
* Removes last {@link Node} from a non-empty list.

src/concat.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5+
import _last from './_last.js';
6+
import _setNext from './_setNext.js';
57
import isEmpty from './isEmpty.js';
68
import isNonEmpty from './isNonEmpty.js';
7-
import _setNext from './_setNext.js';
8-
import _last from './_last.js';
99

1010
/**
1111
* Concatenate two input lists.

src/insertAfter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5-
import isNonEmpty from './isNonEmpty.js';
6-
import isEmpty from './isEmpty.js';
75
import _insertAfter from './_insertAfter.js';
6+
import isEmpty from './isEmpty.js';
7+
import isNonEmpty from './isNonEmpty.js';
88

99
/**
1010
* Inserts value just after input node. Throws if input list is empty

src/isLast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5+
import _isLast from './_isLast.js';
56
import isEmpty from './isEmpty.js';
67
import isList from './isList.js';
7-
import _isLast from './_isLast.js';
88

99
/**
1010
* Test whether input node is the last node of its list.

src/iter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5+
import _iter from './_iter.js';
56
import isEmpty from './isEmpty.js';
67
import isList from './isList.js';
7-
import _iter from './_iter.js';
88

99
/**
1010
* Generator of nodes in list in order.

src/last.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// eslint-disable-next-line no-unused-vars
22
import Node from './Node.js';
3-
import isEmpty from './isEmpty.js';
43
import _last from './_last.js';
4+
import isEmpty from './isEmpty.js';
55

66
/**
77
* Return the last node of an input list. Throws if input list is empty.

src/len.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5+
import _len from './_len.js';
56
import isEmpty from './isEmpty.js';
67
import isList from './isList.js';
7-
import _len from './_len.js';
88

99
/**
1010
* Compute the length of a list (can be empty).

src/pop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5+
import _pop from './_pop.js';
56
import isEmpty from './isEmpty.js';
67
import isNonEmpty from './isNonEmpty.js';
7-
import _pop from './_pop.js';
88

99
/**
1010
* Removes last {@link Node} from a list. Throws if input list is empty.

src/push.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5-
import isList from './isList.js';
65
import concat from './concat.js';
6+
import isList from './isList.js';
77
import single from './single.js';
88

99
/**

src/setValue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5+
import _setValue from './_setValue.js';
56
import isEmpty from './isEmpty.js';
67
import isNonEmpty from './isNonEmpty.js';
7-
import _setValue from './_setValue.js';
88

99
/**
1010
* Set value held by input node. Throws an error if the node is null.

src/value.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import assert from 'assert';
22

33
// eslint-disable-next-line no-unused-vars
44
import Node from './Node.js';
5+
import _value from './_value.js';
56
import isEmpty from './isEmpty.js';
67
import isNonEmpty from './isNonEmpty.js';
7-
import _value from './_value.js';
88

99
/**
1010
* Return the first value held by a list. Throws if input list is empty.

test/src/concat.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {list} from '@iterable-iterator/list';
44
import {range} from '@iterable-iterator/range';
55

66
import {str} from './_fixtures.js';
7+
78
import {from, concat, values} from '#module';
89

910
function macro(t, A, B) {

test/src/from.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import test from 'ava';
22

33
import {list} from '@iterable-iterator/list';
4-
import {range} from '@iterable-iterator/range';
54
import {map} from '@iterable-iterator/map';
5+
import {range} from '@iterable-iterator/range';
66

77
import {str} from './_fixtures.js';
8+
89
import {from, iter, value} from '#module';
910

1011
function macro(t, array) {

test/src/len.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {list} from '@iterable-iterator/list';
44
import {range} from '@iterable-iterator/range';
55

66
import {str} from './_fixtures.js';
7+
78
import {from, len} from '#module';
89

910
const macro = (t, input) => {

test/src/pop.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {list} from '@iterable-iterator/list';
44
import {range} from '@iterable-iterator/range';
55

66
import {str} from './_fixtures.js';
7+
78
import {from, pop, last, value, values} from '#module';
89

910
function throws(t, array) {
@@ -18,14 +19,14 @@ function macro(t, array) {
1819
const node = from(array);
1920
const expected = last(node);
2021
const [after, popped] = pop(node);
21-
t.is(array[array.length - 1], value(popped));
22+
t.is(array.at(-1), value(popped));
2223
t.is(popped, expected);
2324
const result = list(values(after));
2425
t.deepEqual(array.slice(0, -1), result);
2526
}
2627

2728
macro.title = (title, array) =>
28-
title || `pop(${str(array)}) ~> ${array[array.length - 1]}`;
29+
title || `pop(${str(array)}) ~> ${array.at(-1)}`;
2930

3031
test(throws, []);
3132
test(macro, [27]);

test/src/shift.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {list} from '@iterable-iterator/list';
44
import {range} from '@iterable-iterator/range';
55

66
import {str} from './_fixtures.js';
7+
78
import {from, shift, value, values} from '#module';
89

910
function throws(t, array) {

0 commit comments

Comments
 (0)