Skip to content

Commit

Permalink
Revert "Upgrade to typescript-eslint v8, part 2."
Browse files Browse the repository at this point in the history
This reverts commit 79e6339.
  • Loading branch information
ajvincent committed Aug 11, 2024
1 parent 79e6339 commit 7f663af
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 141 deletions.
14 changes: 1 addition & 13 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,7 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

import {
projectDir,
} from "#utilities/source/AsyncSpecModules.js";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: projectDir
}
}
},
...tseslint.configs.recommended,
);
14 changes: 1 addition & 13 deletions stage_1_snapshot/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,9 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

import {
projectDir,
} from "#utilities/source/AsyncSpecModules.js";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: projectDir
}
}
},
...tseslint.configs.recommended,
{
"rules": {
"@typescript-eslint/no-unused-vars": [
Expand Down
14 changes: 1 addition & 13 deletions stage_2_generation/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,7 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

import {
projectDir,
} from "#utilities/source/AsyncSpecModules.js";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: projectDir
}
}
},
...tseslint.configs.recommended,
);
14 changes: 1 addition & 13 deletions stage_2_integration/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,7 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

import {
projectDir,
} from "#utilities/source/AsyncSpecModules.js";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: projectDir
}
}
},
...tseslint.configs.recommended,
);
14 changes: 1 addition & 13 deletions stage_2_snapshot/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,9 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

import {
projectDir,
} from "#utilities/source/AsyncSpecModules.js";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: projectDir
}
}
},
...tseslint.configs.recommended,
{
"rules": {
"@typescript-eslint/no-unused-vars": [
Expand Down
14 changes: 1 addition & 13 deletions stage_3_generation/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,7 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

import {
projectDir,
} from "#utilities/source/AsyncSpecModules.js";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: projectDir
}
}
},
...tseslint.configs.recommended,
);
14 changes: 1 addition & 13 deletions stage_3_integration/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,7 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

import {
projectDir,
} from "#utilities/source/AsyncSpecModules.js";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: projectDir
}
}
},
...tseslint.configs.recommended,
);
14 changes: 1 addition & 13 deletions stage_3_snapshot/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,7 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

import {
projectDir,
} from "#utilities/source/AsyncSpecModules.js";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: projectDir
}
}
},
...tseslint.configs.recommended,
);
14 changes: 1 addition & 13 deletions use-cases/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,7 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

import {
projectDir,
} from "#utilities/source/AsyncSpecModules.js";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: projectDir
}
}
},
...tseslint.configs.recommended,
);
14 changes: 1 addition & 13 deletions utilities/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,8 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

import {
projectDir,
} from "#utilities/source/AsyncSpecModules.js";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: projectDir
}
}
},
...tseslint.configs.recommended,
//...tseslint.configs.strict,
);
15 changes: 6 additions & 9 deletions utilities/spec/AwaitedMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ import AwaitedMap, {

describe("AwaitedMap", () => {
it(".allSettled() converts promises to promise-settled results", async () => {
const rejectTwoError = new Error("reject two");
const map = new AwaitedMap<string, number>([
["one", Promise.resolve(1)],
["two", Promise.reject(rejectTwoError)],
["two", Promise.reject("reject two")],
]);

const results = await map.allSettled();
const entries = Array.from(results.entries());
expect(entries).toEqual([
["one", { status: "fulfilled", value: 1}],
["two", { status: "rejected", reason: rejectTwoError}],
["two", { status: "rejected", reason: "reject two"}],
]);
});

Expand All @@ -34,12 +33,10 @@ describe("AwaitedMap", () => {
});

it(".allResolved() rejects with an AwaitedMapError for all errors that failed", async () => {
const rejectOneError = new Error("reject one");
const rejectThreeError = new Error("reject three");
const map = new AwaitedMap<string, number>([
["one", Promise.reject(rejectOneError)],
["one", Promise.reject("reject one")],
["two", Promise.resolve(2)],
["three", Promise.reject(rejectThreeError)],
["three", Promise.reject("reject three")],
]);

await expectAsync(map.allResolved()).toBeRejectedWithError(AwaitedMapError);
Expand All @@ -51,8 +48,8 @@ describe("AwaitedMap", () => {
(ex as AwaitedMapError<string>).errorMap.entries()
);
expect(entries).toEqual([
["one", rejectOneError],
["three", rejectThreeError],
["one", "reject one"],
["three", "reject three"],
]);
}
});
Expand Down
1 change: 0 additions & 1 deletion utilities/spec/BuildPromise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ describe("BuildPromise.mts: ", () => {
if (willResolve)
spy.and.returnValue(Promise.resolve(value));
else
//eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
spy.and.returnValue(Promise.reject(value));
return spy;
}
Expand Down
2 changes: 1 addition & 1 deletion utilities/spec/PromiseTypes/SingletonPromise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("PromiseTypes.SingletonPromise", () => {
});

it("rejects with the error we passed in", async () => {
const expected = new Error("rejection");
const expected = {};
const spy = jasmine.createSpy();
spy.and.returnValue(Promise.reject(expected));
const x = new SingletonPromise<object>(spy);
Expand Down

0 comments on commit 7f663af

Please sign in to comment.