Skip to content

Commit 8371f6c

Browse files
Merge branch 'main' into main
2 parents e672605 + d044441 commit 8371f6c

11 files changed

+67
-62
lines changed

eslint.config.js

+14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
import jsdoc from "eslint-plugin-jsdoc";
2+
import eslintjs from "@eslint/js";
3+
4+
const {configs: eslintConfigs} = eslintjs;
25

36
export default [
47
jsdoc.configs["flat/recommended"],
8+
eslintConfigs["recommended"],
59
{
10+
languageOptions: {
11+
// if we ever use more globals than this, pull in the `globals` package
12+
globals: {
13+
console: false
14+
}
15+
},
616
rules: {
717
"jsdoc/require-param-description": "off",
818
"jsdoc/require-returns-description": "off",
919
"jsdoc/tag-lines": ["error", "any", { startLines: 1 }],
20+
"no-unused-vars": ["error", {
21+
argsIgnorePattern: "^_",
22+
caughtErrorsIgnorePattern: "^_"
23+
}]
1024
},
1125
},
1226
];

lib/chai/core/assertions.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -2025,11 +2025,11 @@ Assertion.addMethod('property', assertProperty);
20252025

20262026
/**
20272027
*
2028-
* @param {unknown} name
2029-
* @param {unknown} value
2030-
* @param {string} msg
2028+
* @param {unknown} _name
2029+
* @param {unknown} _value
2030+
* @param {string} _msg
20312031
*/
2032-
function assertOwnProperty(name, value, msg) {
2032+
function assertOwnProperty(_name, _value, _msg) {
20332033
flag(this, 'own', true);
20342034
assertProperty.apply(this, arguments);
20352035
}
@@ -4053,7 +4053,7 @@ Assertion.addProperty('frozen', function () {
40534053
* @namespace BDD
40544054
* @public
40554055
*/
4056-
Assertion.addProperty('finite', function (msg) {
4056+
Assertion.addProperty('finite', function (_msg) {
40574057
var obj = flag(this, 'object');
40584058

40594059
this.assert(

lib/chai/interface/assert.js

+19-15
Original file line numberDiff line numberDiff line change
@@ -3206,19 +3206,23 @@ assert.doesNotContainSubset = function (val, exp, msg) {
32063206
* @param {unknown} as
32073207
* @returns {unknown}
32083208
*/
3209-
(function alias(name, as) {
3209+
const aliases = [
3210+
['isOk', 'ok'],
3211+
['isNotOk', 'notOk'],
3212+
['throws', 'throw'],
3213+
['throws', 'Throw'],
3214+
['isExtensible', 'extensible'],
3215+
['isNotExtensible', 'notExtensible'],
3216+
['isSealed', 'sealed'],
3217+
['isNotSealed', 'notSealed'],
3218+
['isFrozen', 'frozen'],
3219+
['isNotFrozen', 'notFrozen'],
3220+
['isEmpty', 'empty'],
3221+
['isNotEmpty', 'notEmpty'],
3222+
['isCallable', 'isFunction'],
3223+
['isNotCallable', 'isNotFunction'],
3224+
['containsSubset', 'containSubset']
3225+
];
3226+
for (const [name, as] of aliases) {
32103227
assert[as] = assert[name];
3211-
return alias;
3212-
})('isOk', 'ok')('isNotOk', 'notOk')('throws', 'throw')('throws', 'Throw')(
3213-
'isExtensible',
3214-
'extensible'
3215-
)('isNotExtensible', 'notExtensible')('isSealed', 'sealed')(
3216-
'isNotSealed',
3217-
'notSealed'
3218-
)('isFrozen', 'frozen')('isNotFrozen', 'notFrozen')('isEmpty', 'empty')(
3219-
'isNotEmpty',
3220-
'notEmpty'
3221-
)('isCallable', 'isFunction')('isNotCallable', 'isNotFunction')(
3222-
'containsSubset',
3223-
'containSubset'
3224-
);
3228+
}

lib/chai/utils/getEnumerableProperties.js

-25
This file was deleted.

lib/chai/utils/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ export function isRegExp(obj) {
107107
return Object.prototype.toString.call(obj) === '[object RegExp]';
108108
}
109109

110+
/**
111+
* Determines if an object is numeric or not
112+
*
113+
* @param {unknown} obj Object to test
114+
* @returns {boolean}
115+
*/
110116
export function isNumeric(obj) {
111117
return ['Number', 'BigInt'].includes(type(obj));
112118
}

lib/chai/utils/proxify.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ export function proxify(obj, nonChainableMethodName) {
6464
var suggestionDistance = 4;
6565
getProperties(target).forEach(function (prop) {
6666
if (
67+
// we actually mean to check `Object.prototype` here
68+
// eslint-disable-next-line no-prototype-builtins
6769
!Object.prototype.hasOwnProperty(prop) &&
6870
builtins.indexOf(prop) === -1
6971
) {
@@ -128,17 +130,17 @@ function stringDistanceCapped(strA, strB, cap) {
128130
// `memo` is a two-dimensional array containing distances.
129131
// memo[i][j] is the distance between strA.slice(0, i) and
130132
// strB.slice(0, j).
131-
for (var i = 0; i <= strA.length; i++) {
133+
for (let i = 0; i <= strA.length; i++) {
132134
memo[i] = Array(strB.length + 1).fill(0);
133135
memo[i][0] = i;
134136
}
135-
for (var j = 0; j < strB.length; j++) {
137+
for (let j = 0; j < strB.length; j++) {
136138
memo[0][j] = j;
137139
}
138140

139-
for (var i = 1; i <= strA.length; i++) {
141+
for (let i = 1; i <= strA.length; i++) {
140142
var ch = strA.charCodeAt(i - 1);
141-
for (var j = 1; j <= strB.length; j++) {
143+
for (let j = 1; j <= strB.length; j++) {
142144
if (Math.abs(i - j) >= cap) {
143145
memo[i][j] = cap;
144146
continue;

package-lock.json

+16-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"pathval": "^2.0.0"
5353
},
5454
"devDependencies": {
55+
"@eslint/js": "^9.17.0",
5556
"@rollup/plugin-commonjs": "^25.0.7",
5657
"@web/dev-server-rollup": "^0.6.1",
5758
"@web/test-runner": "^0.18.0",

register-assert.cjs

-3
This file was deleted.

register-expect.cjs

-3
This file was deleted.

register-should.cjs

-3
This file was deleted.

0 commit comments

Comments
 (0)