Skip to content

Commit 016c112

Browse files
authored
chore: update eslint-plugin-mocha to latest (#6541)
It is actually possible to update the dependency, since we already use a ESM config file. This deactivates some new rules to prevent significant changes.
1 parent f0c34cc commit 016c112

File tree

8 files changed

+16
-48
lines changed

8 files changed

+16
-48
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ updates:
4545
- dependency-name: "@types/node"
4646
# Update the types manually with new Node.js version support
4747
update-types: ["version-update:semver-major"]
48-
- dependency-name: "eslint-plugin-mocha"
49-
# ESM only from v11.0.0 onwards
50-
update-types: ["version-update:semver-major"]
5148
- dependency-name: "jest-docblock"
5249
# 30.0.0 onwards only supports Node.js 18.14.x and above
5350
update-types: ["version-update:semver-major"]

eslint.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ export default [
524524
},
525525
{
526526
name: 'mocha/recommended',
527-
...eslintPluginMocha.configs.flat.recommended,
527+
...eslintPluginMocha.configs.recommended,
528528
files: TEST_FILES
529529
},
530530
{
@@ -544,6 +544,7 @@ export default [
544544
n: eslintPluginN
545545
},
546546
rules: {
547+
'mocha/consistent-spacing-between-blocks': 'off',
547548
'mocha/max-top-level-suites': ['error', { limit: 1 }],
548549
'mocha/no-exports': 'off',
549550
'mocha/no-global-tests': 'off',
@@ -553,6 +554,7 @@ export default [
553554
'mocha/no-sibling-hooks': 'off',
554555
'mocha/no-skipped-tests': 'off',
555556
'mocha/no-top-level-hooks': 'off',
557+
'mocha/prefer-arrow-callback': 'off',
556558
'n/handle-callback-err': 'off',
557559
'n/no-missing-require': 'off',
558560
'require-await': 'off'
@@ -576,6 +578,7 @@ export default [
576578
rules: {
577579
'no-undef': 'off',
578580
'mocha/max-top-level-suites': 'off',
581+
'mocha/no-pending-tests': 'off',
579582
}
580583
},
581584
{

integration-tests/ci-visibility/vitest-tests/test-visibility-passed-suite.mjs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ describe('other context', () => {
2323
test.todo('can todo', () => {
2424
expect(sum(1, 2)).to.equal(3)
2525
})
26-
// eslint-disable-next-line
2726
test('can programmatic skip', (context) => {
28-
// eslint-disable-next-line
2927
context.skip()
3028
expect(sum(1, 2)).to.equal(3)
3129
})
@@ -39,9 +37,7 @@ test.skip('skip no suite', () => {
3937
expect(sum(1, 2)).to.equal(3)
4038
})
4139

42-
// eslint-disable-next-line
4340
test('programmatic skip no suite', (context) => {
44-
// eslint-disable-next-line
4541
context.skip()
4642
expect(sum(1, 2)).to.equal(3)
4743
})

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
"eslint": "^9.29.0",
163163
"eslint-plugin-cypress": "^5.1.0",
164164
"eslint-plugin-import": "^2.32.0",
165-
"eslint-plugin-mocha": "^10.5.0",
165+
"eslint-plugin-mocha": "^11.1.0",
166166
"eslint-plugin-n": "^17.20.0",
167167
"eslint-plugin-promise": "^7.2.1",
168168
"eslint-plugin-unicorn": "^61.0.2",

packages/dd-trace/test/appsec/iast/taint-tracking/rewriter.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ describe('IAST Rewriter', () => {
120120
})
121121

122122
// TODO: This cannot be tested with mocking.
123-
it('Should unwrap module compile method on taint tracking disable') // eslint-disable-line mocha/no-pending-tests
123+
it('Should unwrap module compile method on taint tracking disable')
124124

125125
it('Should keep original prepareStackTrace fn when calling enable and then disable', () => {
126126
const orig = Error.prepareStackTrace

packages/dd-trace/test/appsec/index.express.plugin.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const { withVersions } = require('../setup/mocha')
1616

1717
withVersions('express', 'express', version => {
1818
if (semver.intersects(version, '<=4.10.5') && NODE_MAJOR >= 24) {
19+
// eslint-disable-next-line mocha/no-pending-tests
1920
describe.skip(`refusing to run tests as express@${version} is incompatible with Node.js ${NODE_MAJOR}`)
2021
return
2122
}

packages/dd-trace/test/appsec/rasp/lfi.express.plugin.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ describe('RASP - lfi', () => {
3434

3535
withVersions('express', 'express', expressVersion => {
3636
if (semver.intersects(expressVersion, '<=4.10.5') && NODE_MAJOR >= 24) {
37+
// eslint-disable-next-line mocha/no-pending-tests
3738
describe.skip(`refusing to run tests as express@${expressVersion} is incompatible with Node.js ${NODE_MAJOR}`)
3839
return
3940
}

yarn.lock

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@
265265
module-details-from-path "^1.0.3"
266266
node-gyp-build "^4.5.0"
267267

268-
"@eslint-community/eslint-utils@^4.1.2", "@eslint-community/eslint-utils@^4.4.0", "@eslint-community/eslint-utils@^4.5.0", "@eslint-community/eslint-utils@^4.7.0", "@eslint-community/eslint-utils@^4.8.0", "@eslint-community/eslint-utils@^4.9.0":
268+
"@eslint-community/eslint-utils@^4.1.2", "@eslint-community/eslint-utils@^4.4.0", "@eslint-community/eslint-utils@^4.4.1", "@eslint-community/eslint-utils@^4.5.0", "@eslint-community/eslint-utils@^4.7.0", "@eslint-community/eslint-utils@^4.8.0", "@eslint-community/eslint-utils@^4.9.0":
269269
version "4.9.0"
270270
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz#7308df158e064f0dd8b8fdb58aa14fa2a7f913b3"
271271
integrity sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==
@@ -1892,14 +1892,13 @@ eslint-plugin-import@^2.32.0:
18921892
string.prototype.trimend "^1.0.9"
18931893
tsconfig-paths "^3.15.0"
18941894

1895-
eslint-plugin-mocha@^10.5.0:
1896-
version "10.5.0"
1897-
resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-10.5.0.tgz#0aca8d709e7cddef566e0dc252f6b02e307a2b7e"
1898-
integrity sha512-F2ALmQVPT1GoP27O1JTZGrV9Pqg8k79OeIuvw63UxMtQKREZtmkK1NFgkZQ2TW7L2JSSFKHFPTtHu5z8R9QNRw==
1895+
eslint-plugin-mocha@^11.1.0:
1896+
version "11.1.0"
1897+
resolved "https://registry.yarnpkg.com/eslint-plugin-mocha/-/eslint-plugin-mocha-11.1.0.tgz#a381d386aa858ceaf30ec2909c7e306ad04e9626"
1898+
integrity sha512-rKntVWRsQFPbf8OkSgVNRVRrcVAPaGTyEgWCEyXaPDJkTl0v5/lwu1vTk5sWiUJU8l2sxwvGUZzSNrEKdVMeQw==
18991899
dependencies:
1900-
eslint-utils "^3.0.0"
1901-
globals "^13.24.0"
1902-
rambda "^7.4.0"
1900+
"@eslint-community/eslint-utils" "^4.4.1"
1901+
globals "^15.14.0"
19031902

19041903
eslint-plugin-n@^17.20.0:
19051904
version "17.23.1"
@@ -1955,18 +1954,6 @@ eslint-scope@^8.4.0:
19551954
esrecurse "^4.3.0"
19561955
estraverse "^5.2.0"
19571956

1958-
eslint-utils@^3.0.0:
1959-
version "3.0.0"
1960-
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672"
1961-
integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==
1962-
dependencies:
1963-
eslint-visitor-keys "^2.0.0"
1964-
1965-
eslint-visitor-keys@^2.0.0:
1966-
version "2.1.0"
1967-
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
1968-
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==
1969-
19701957
eslint-visitor-keys@^3.4.3:
19711958
version "3.4.3"
19721959
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
@@ -2410,19 +2397,12 @@ glob@^7.0.5, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.2.3:
24102397
once "^1.3.0"
24112398
path-is-absolute "^1.0.0"
24122399

2413-
globals@^13.24.0:
2414-
version "13.24.0"
2415-
resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171"
2416-
integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==
2417-
dependencies:
2418-
type-fest "^0.20.2"
2419-
24202400
globals@^14.0.0:
24212401
version "14.0.0"
24222402
resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e"
24232403
integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==
24242404

2425-
globals@^15.11.0:
2405+
globals@^15.11.0, globals@^15.14.0:
24262406
version "15.15.0"
24272407
resolved "https://registry.yarnpkg.com/globals/-/globals-15.15.0.tgz#7c4761299d41c32b075715a4ce1ede7897ff72a8"
24282408
integrity sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==
@@ -3838,11 +3818,6 @@ queue-tick@^1.0.0:
38383818
resolved "https://registry.yarnpkg.com/queue-tick/-/queue-tick-1.0.1.tgz#f6f07ac82c1fd60f82e098b417a80e52f1f4c142"
38393819
integrity sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==
38403820

3841-
rambda@^7.4.0:
3842-
version "7.5.0"
3843-
resolved "https://registry.yarnpkg.com/rambda/-/rambda-7.5.0.tgz#1865044c59bc0b16f63026c6e5a97e4b1bbe98fe"
3844-
integrity sha512-y/M9weqWAH4iopRd7EHDEQQvpFPHj1AA3oHozE9tfITHUtTR7Z9PSlIRRG2l1GuW7sefC1cXFfIcF+cgnShdBA==
3845-
38463821
randombytes@^2.1.0:
38473822
version "2.1.0"
38483823
resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a"
@@ -4669,11 +4644,6 @@ type-fest@^0.12.0:
46694644
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.12.0.tgz#f57a27ab81c68d136a51fd71467eff94157fa1ee"
46704645
integrity sha512-53RyidyjvkGpnWPMF9bQgFtWp+Sl8O2Rp13VavmJgfAP9WWG6q6TkrKU8iyJdnwnfgHI6k2hTlgqH4aSdjoTbg==
46714646

4672-
type-fest@^0.20.2:
4673-
version "0.20.2"
4674-
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
4675-
integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==
4676-
46774647
type-fest@^0.21.3:
46784648
version "0.21.3"
46794649
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37"

0 commit comments

Comments
 (0)