Skip to content

Commit e7bdf65

Browse files
committed
[eslint] clean up config
1 parent be8136f commit e7bdf65

16 files changed

+435
-887
lines changed

.eslintrc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
{
22
"extends": [
3-
"eslint:recommended",
3+
"@ljharb/eslint-config/esm",
44
"plugin:flowtype/recommended"
55
],
6+
"parser": "@babel/eslint-parser",
7+
"parserOptions": {
8+
"sourceType": "module",
9+
},
610
"env": {
7-
"es6": true
11+
"es6": true,
812
},
9-
"parser": "@babel/eslint-parser",
1013
"plugins": [
1114
"flowtype"
1215
],
16+
"rules": {
17+
"indent": [2, 2],
18+
},
1319
"overrides": [
1420
{
1521
"files": [
@@ -24,11 +30,11 @@
2430
"__tests__/**/*.js"
2531
],
2632
"extends": [
27-
"eslint:recommended",
33+
"@ljharb/eslint-config/tests",
2834
],
2935
"env": {
30-
"node": true
31-
}
36+
"node": true,
37+
},
3238
}
3339
]
3440
}

__tests__/src/AXObjectElementMap-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ test('AXObjectElementMap', async (t) => {
220220
}
221221

222222
[...AXObjectElementMap.keys()].forEach(([key]) => {
223-
s2t.ok(entriesKeys.find(([k]) => k === key), `spread has key: ${key}`);
223+
s2t.ok(entriesKeys.find(([k]) => k === key), `spread has key: ${key}`);
224224
});
225225
});
226226

@@ -230,14 +230,14 @@ test('AXObjectElementMap', async (t) => {
230230
for (const values of AXObjectElementMap.values()) {
231231
s2t.ok(
232232
entriesValues.some((vs) => deepEqual(values, vs)),
233-
`for-of has values: ${inspect(values)}`
233+
`for-of has values: ${inspect(values)}`,
234234
);
235235
}
236236

237237
[...AXObjectElementMap.values()].forEach((values) => {
238238
s2t.ok(
239239
entriesValues.some((vs) => deepEqual(values, vs)),
240-
`spread has values: ${inspect(values)}`
240+
`spread has values: ${inspect(values)}`,
241241
);
242242
});
243243
});

__tests__/src/AXObjectRoleMap-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ test('AXObjectRoleMap', async (t) => {
230230
}
231231

232232
[...AXObjectRoleMap.keys()].forEach(([key]) => {
233-
s2t.ok(entriesKeys.find(([k]) => k === key), `spread has key: ${key}`);
233+
s2t.ok(entriesKeys.find(([k]) => k === key), `spread has key: ${key}`);
234234
});
235235
});
236236

@@ -241,14 +241,14 @@ test('AXObjectRoleMap', async (t) => {
241241
for (const values of AXObjectRoleMap.values()) {
242242
s2t.ok(
243243
entriesValues.some((vs) => deepEqual(values, vs)),
244-
`for-of has values: ${inspect(values)}`
244+
`for-of has values: ${inspect(values)}`,
245245
);
246246
}
247247

248248
[...AXObjectRoleMap.values()].forEach((values) => {
249249
s2t.ok(
250250
entriesValues.some((vs) => deepEqual(values, vs)),
251-
`spread has values: ${inspect(values)}`
251+
`spread has values: ${inspect(values)}`,
252252
);
253253
});
254254
});

__tests__/src/AXObjectsMap-test.js

Lines changed: 250 additions & 250 deletions
Large diffs are not rendered by default.

__tests__/src/elementAXObjectMap-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const entriesList = [
8181
];
8282

8383
test('elementAXObjectMap', async (t) => {
84-
t.test('iteration', (st) => {
84+
t.test('iteration', (st) => {
8585

8686
st.notEqual(elementAXObjectMap[Symbol.iterator], undefined, 'has an iterator defined');
8787
st.equal([...elementAXObjectMap].length, 70, 'has a specific length');
@@ -243,7 +243,7 @@ test('elementAXObjectMap', async (t) => {
243243
}
244244

245245
[...elementAXObjectMap.keys()].forEach((key) => {
246-
s2t.ok(entriesKeys.find((k) => deepEqual(k, key)), `spread has key: ${inspect(key)}`);
246+
s2t.ok(entriesKeys.find((k) => deepEqual(k, key)), `spread has key: ${inspect(key)}`);
247247
});
248248
});
249249

@@ -254,14 +254,14 @@ test('elementAXObjectMap', async (t) => {
254254
for (const values of elementAXObjectMap.values()) {
255255
s2t.ok(
256256
entriesValues.some((vs) => deepEqual(values, vs)),
257-
`for-of has values: ${inspect(values)}`
257+
`for-of has values: ${inspect(values)}`,
258258
);
259259
}
260260

261261
[...elementAXObjectMap.values()].forEach((values) => {
262262
s2t.ok(
263263
entriesValues.some((vs) => deepEqual(values, vs)),
264-
`spread has values: ${inspect(values)}`
264+
`spread has values: ${inspect(values)}`,
265265
);
266266
});
267267
});

__tests__/src/util/iterationDecorator-test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import iterationDecorator from 'axobject-query/src/util/iterationDecorator';
66

77
test('iterationDecorator', (t) => {
88
t.test('adds a Symbol.iterator property to a collection', async (st) => {
9-
// const collection = {a: 'apple', b: 'banana', c: 'cantaloupe'};
10-
const collection = {
11-
'a': 'apple',
12-
'b': 'banana',
13-
'c': 'cantaloupe',
14-
};
15-
const arr = ['apple', 'banana', 'cantaloupe'];
16-
const iter = iterationDecorator(collection, values(collection));
17-
st.deepEqual([...iter], arr, 'returns the values when iterated');
9+
// const collection = {a: 'apple', b: 'banana', c: 'cantaloupe'};
10+
const collection = {
11+
'a': 'apple',
12+
'b': 'banana',
13+
'c': 'cantaloupe',
14+
};
15+
const arr = ['apple', 'banana', 'cantaloupe'];
16+
const iter = iterationDecorator(collection, values(collection));
17+
st.deepEqual([...iter], arr, 'returns the values when iterated');
1818
});
1919

2020
t.test('when Symbol is not defined in the global space', async (st) => {
@@ -32,7 +32,7 @@ test('iterationDecorator', (t) => {
3232

3333
t.test('when Symbol.iterator is not defined in the global space', async (st) => {
3434
const originalSymbolIterator = typeof Symbol === 'function' ? Symbol.iterator : null;
35-
st.teardown(mockProperty(global, 'Symbol', { value: function () {} }));
35+
st.teardown(mockProperty(global, 'Symbol', { value () {} }));
3636

3737
const collection = {
3838
'a': 'apple',

__tests__/src/util/iteratorProxy-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import iteratorProxy from 'axobject-query/src/util/iteratorProxy';
55
test('iteratorProxy', async (t) => {
66
const arr = ['a', 'b', 'c'];
77
const iter = {
8-
[Symbol.iterator]: iteratorProxy.bind(arr)
8+
[Symbol.iterator]: iteratorProxy.bind(arr),
99
};
1010

1111
t.deepEqual([...iter], arr, 'creates an iterator for the bound array');

0 commit comments

Comments
 (0)