Skip to content

Commit 61b250a

Browse files
committed
enable some new linting rules
1 parent 9495843 commit 61b250a

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

scripts/build-compat/entries.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function getModulesForEntryPoint(path, parent) {
1717
return getModulesForEntryPoint(dependency, entry);
1818
}));
1919

20-
return helpers.intersection(result.flat(1), modules);
20+
return helpers.intersection(result.flat(), modules);
2121
}
2222

2323
const entriesList = await glob([

tests/eslint/eslint.config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,13 @@ const base = {
613613
'unicorn/no-thenable': ERROR,
614614
// disallow comparing `undefined` using `typeof` when it's not required
615615
'unicorn/no-typeof-undefined': ERROR,
616+
// disallow using 1 as the depth argument of `Array#flat()`
617+
'unicorn/no-unnecessary-array-flat-depth': ERROR,
618+
// disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{ splice, toSpliced }()`
619+
'unicorn/no-unnecessary-array-splice-count': ERROR,
616620
// disallow awaiting non-promise values
617621
'unicorn/no-unnecessary-await': ERROR,
618-
// disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()
622+
// disallow using `.length` or `Infinity` as the end argument of `{ Array, String, %TypedArray% }#slice()`
619623
'unicorn/no-unnecessary-slice-end': ERROR,
620624
// disallow unreadable array destructuring
621625
'unicorn/no-unreadable-array-destructuring': ERROR,
@@ -1971,6 +1975,8 @@ const packagesPackageJSON = {
19711975
'package-json/repository-shorthand': [ERROR, { form: 'object' }],
19721976
// requires the `author` property to be present
19731977
'package-json/require-author': ERROR,
1978+
// requires the `description` property to be present
1979+
'package-json/require-description': ERROR,
19741980
// requires the `engines` property to be present
19751981
// TODO: core-js@4
19761982
// 'package-json/require-engines': ERROR,

tests/unit-global/es.array.flat.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ QUnit.test('Array#flat', assert => {
1111
assert.deepEqual([].flat(), []);
1212
const array = [1, [2, 3], [4, [5, 6]]];
1313
assert.deepEqual(array.flat(0), array);
14+
// eslint-disable-next-line unicorn/no-unnecessary-array-flat-depth -- testing
1415
assert.deepEqual(array.flat(1), [1, 2, 3, 4, [5, 6]]);
1516
assert.deepEqual(array.flat(), [1, 2, 3, 4, [5, 6]]);
1617
assert.deepEqual(array.flat(2), [1, 2, 3, 4, 5, 6]);

0 commit comments

Comments
 (0)