Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use ts-parser-service to resolve eslint paths #20

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"airbnb-base",
"airbnb-typescript/base"
"airbnb-typescript/base",
"ts-parser-service/resolver"
],
"ignorePatterns": ["build/"],
"parser": "@typescript-eslint/parser",
Expand All @@ -26,6 +27,8 @@
],
"root": true,
"rules": {
"import/extensions": ["error", "ignorePackages"]
"import/extensions": ["error", "ignorePackages", {
"ts": "never"
}]
}
}
56 changes: 55 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"c8": "^8.0.1",
"eslint": "^8.52.0",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-ts-parser-service": "^0.2.0",
"eslint-plugin-import": "^2.28.1",
"events": "^3.3.0",
"expect": "^28.1.3",
Expand Down
4 changes: 2 additions & 2 deletions src/server/utils/TypedEventEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type EventName = string | symbol;

export type ArbitraryEventMap = Record<EventName, unknown[]>;

export interface EventEmitter<T extends EventMap<T> = ArbitraryEventMap> extends BaseEventEmitter {
interface EventEmitter<T extends EventMap<T> = ArbitraryEventMap> extends BaseEventEmitter {
addListener<K extends EventOf<T>>(eventName: K, listener: (...args: T[K]) => void): this;
on<K extends EventOf<T>>(eventName: K, listener: (...args: T[K]) => void): this;
once<K extends EventOf<T>>(eventName: K, listener: (...args: T[K]) => void): this;
Expand All @@ -35,6 +35,6 @@ export interface EventEmitterConstructor {

// @ts-expect-error not assignable as we add type restrictions
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const EventEmitter: EventEmitterConstructor = BaseEventEmitter;
const EventEmitter: EventEmitterConstructor = BaseEventEmitter;

export default EventEmitter;
2 changes: 1 addition & 1 deletion test/third-party/mocha/setup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'mocha';
import { onInit, done } from '../../../src/client/api.js';
import { onInit, done } from 'wrightplay';

mocha.setup({
ui: 'bdd',
Expand Down
2 changes: 1 addition & 1 deletion test/third-party/tape/setup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import process from 'process';
import { done } from '../../../src/client/api.js';
import { done } from 'wrightplay';

globalThis.process = process;

Expand Down
2 changes: 1 addition & 1 deletion test/third-party/uvu/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @see [Improve Programmatic Usage · Issue #113 · lukeed/uvu]{@link https://github.com/lukeed/uvu/issues/113}
*/
/* eslint-disable no-console */
import { onInit, done } from '../../../src/client/api.js';
import { onInit, done } from 'wrightplay';

let total: number | undefined;
let passed: number | undefined;
Expand Down
2 changes: 1 addition & 1 deletion test/third-party/zora/setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-restricted-syntax */
import { hold, report, createTAPReporter } from 'zora';
import { done, onInit } from '../../../src/client/api.js';
import { done, onInit } from 'wrightplay';

// Hold zora default run
hold();
Expand Down