mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
chore: upgrade eslint (#58575)
This commit is contained in:
committed by
GitHub
parent
54b028b10d
commit
6e9513a933
@@ -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}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -33,7 +33,6 @@ function handleError(err, client) {
|
||||
} catch (e) {
|
||||
// no-op
|
||||
} finally {
|
||||
/* eslint-disable-next-line no-process-exit */
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ function handleError(err, client) {
|
||||
} catch (e) {
|
||||
// no-op
|
||||
} finally {
|
||||
/* eslint-disable-next-line no-process-exit */
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ function handleError(err, client) {
|
||||
} catch (e) {
|
||||
// no-op
|
||||
} finally {
|
||||
/* eslint-disable-next-line no-process-exit */
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ function handleError(err, client) {
|
||||
} catch (e) {
|
||||
// no-op
|
||||
} finally {
|
||||
/* eslint-disable-next-line no-process-exit */
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable max-len */
|
||||
const { ObjectId } = require('mongodb');
|
||||
|
||||
const blankUserId = new ObjectId('5bd30e0f1caf6ac3ddddddb9');
|
||||
|
||||
Reference in New Issue
Block a user