chore: upgrade eslint (#58575)

This commit is contained in:
Oliver Eyton-Williams
2025-02-07 21:48:43 +01:00
committed by GitHub
parent 54b028b10d
commit 6e9513a933
75 changed files with 2272 additions and 885 deletions
@@ -2,8 +2,7 @@ import path from 'path';
import fs from 'fs';
import readdirp from 'readdirp';
// TODO: remove chai and use jest's assertion errors
import { AssertionError } from 'chai';
import { SuperBlocks } from '../../../shared/config/curriculum';
import {
superblockSchemaValidator,
@@ -46,10 +45,9 @@ describe('external curriculum data build', () => {
const result = validateAvailableSuperBlocks(availableSuperblocks);
if (result.error) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
throw new AssertionError(
result.error.message,
`file: available-superblocks.json`
throw Error(
`file: available-superblocks.json
${result.error.message}`
);
}
});
@@ -72,11 +70,8 @@ describe('external curriculum data build', () => {
const result = validateSuperBlock(JSON.parse(fileContent));
if (result.error) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
throw new AssertionError(
result.error.message,
`file: ${fileInArray}`
);
throw Error(`file: ${fileInArray}
${result.error.message}`);
}
});
});
-1
View File
@@ -43,7 +43,6 @@ describe('markdown linter', () => {
it('should write to the console describing the problem', done => {
function callback() {
const expected =
// eslint-disable-next-line max-len
'badYML.md: 19: yaml-linter YAML code blocks should be valid [bad indentation of a mapping entry at line 3, column 17:\n testString: testString\n ^] [Context: "```yml"]';
expect(console.log.mock.calls.length).toBe(1);
expect(console.log.mock.calls[0][0]).toEqual(
-1
View File
@@ -33,7 +33,6 @@ function handleError(err, client) {
} catch (e) {
// no-op
} finally {
/* eslint-disable-next-line no-process-exit */
process.exit(1);
}
}
-1
View File
@@ -37,7 +37,6 @@ function handleError(err, client) {
} catch (e) {
// no-op
} finally {
/* eslint-disable-next-line no-process-exit */
process.exit(1);
}
}
-1
View File
@@ -27,7 +27,6 @@ function handleError(err, client) {
} catch (e) {
// no-op
} finally {
/* eslint-disable-next-line no-process-exit */
process.exit(1);
}
}
-1
View File
@@ -29,7 +29,6 @@ function handleError(err, client) {
} catch (e) {
// no-op
} finally {
/* eslint-disable-next-line no-process-exit */
process.exit(1);
}
}
-1
View File
@@ -1,4 +1,3 @@
/* eslint-disable max-len */
const { ObjectId } = require('mongodb');
const blankUserId = new ObjectId('5bd30e0f1caf6ac3ddddddb9');