mirror of
https://github.com/hanzoai/core-js.git
synced 2026-09-24 16:58:15 +00:00
enable some new linting rules
This commit is contained in:
@@ -17,7 +17,7 @@ async function getModulesForEntryPoint(path, parent) {
|
||||
return getModulesForEntryPoint(dependency, entry);
|
||||
}));
|
||||
|
||||
return helpers.intersection(result.flat(1), modules);
|
||||
return helpers.intersection(result.flat(), modules);
|
||||
}
|
||||
|
||||
const entriesList = await glob([
|
||||
|
||||
@@ -613,9 +613,13 @@ const base = {
|
||||
'unicorn/no-thenable': ERROR,
|
||||
// disallow comparing `undefined` using `typeof` when it's not required
|
||||
'unicorn/no-typeof-undefined': ERROR,
|
||||
// disallow using 1 as the depth argument of `Array#flat()`
|
||||
'unicorn/no-unnecessary-array-flat-depth': ERROR,
|
||||
// disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{ splice, toSpliced }()`
|
||||
'unicorn/no-unnecessary-array-splice-count': ERROR,
|
||||
// disallow awaiting non-promise values
|
||||
'unicorn/no-unnecessary-await': ERROR,
|
||||
// disallow using `.length` or `Infinity` as the `deleteCount` or `skipCount` argument of `Array#{splice,toSpliced}()
|
||||
// disallow using `.length` or `Infinity` as the end argument of `{ Array, String, %TypedArray% }#slice()`
|
||||
'unicorn/no-unnecessary-slice-end': ERROR,
|
||||
// disallow unreadable array destructuring
|
||||
'unicorn/no-unreadable-array-destructuring': ERROR,
|
||||
@@ -1971,6 +1975,8 @@ const packagesPackageJSON = {
|
||||
'package-json/repository-shorthand': [ERROR, { form: 'object' }],
|
||||
// requires the `author` property to be present
|
||||
'package-json/require-author': ERROR,
|
||||
// requires the `description` property to be present
|
||||
'package-json/require-description': ERROR,
|
||||
// requires the `engines` property to be present
|
||||
// TODO: core-js@4
|
||||
// 'package-json/require-engines': ERROR,
|
||||
|
||||
@@ -11,6 +11,7 @@ QUnit.test('Array#flat', assert => {
|
||||
assert.deepEqual([].flat(), []);
|
||||
const array = [1, [2, 3], [4, [5, 6]]];
|
||||
assert.deepEqual(array.flat(0), array);
|
||||
// eslint-disable-next-line unicorn/no-unnecessary-array-flat-depth -- testing
|
||||
assert.deepEqual(array.flat(1), [1, 2, 3, 4, [5, 6]]);
|
||||
assert.deepEqual(array.flat(), [1, 2, 3, 4, [5, 6]]);
|
||||
assert.deepEqual(array.flat(2), [1, 2, 3, 4, 5, 6]);
|
||||
|
||||
Reference in New Issue
Block a user