Skip to content

Commit

Permalink
fix: fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Nov 21, 2023
1 parent c9dd52f commit 8482d16
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .xo-config.js
Expand Up @@ -8,8 +8,7 @@ module.exports = {
'unicorn/catch-error-name': 'off',
'unicorn/require-post-message-target-origin': 'off',
'unicorn/prefer-node-protocol': 'warn',
'unicorn/prefer-top-level-await': 'warn',
'unicorn/prefer-logical-operator-over-ternary': 'warn'
'unicorn/prefer-top-level-await': 'warn'
},
overrides: [
{
Expand Down
16 changes: 8 additions & 8 deletions types/index.d.ts
@@ -1,8 +1,8 @@
// Definitions by: Taylor Schley <https://github.com/shadowgate15>

import { EventEmitter } from 'node:events';
import { WorkerOptions, Worker } from 'node:worker_threads';
import { Timeout, Interval } from 'safe-timers';
import type { WorkerOptions, Worker } from 'node:worker_threads';
import type { Timeout, Interval } from 'safe-timers';

export = Bree;

Expand Down Expand Up @@ -68,7 +68,7 @@ declare class Bree extends EventEmitter {
}

declare namespace Bree {

Check warning on line 70 in types/index.d.ts

View workflow job for this annotation

GitHub Actions / Node 14 on ubuntu-latest

'Bree' is already defined.
interface Job {
type Job = {

This comment has been minimized.

Copy link
@climba03003

climba03003 Nov 21, 2023

Contributor

@titanism
I am sorry, but changing of interface to type disable declaration merging.
That's mean if I would like to create a plugin extending the types, it would never been possible.

name: string;
path: string | (() => void);
timeout: number | string | boolean;
Expand All @@ -81,11 +81,11 @@ declare namespace Bree {
worker?: Partial<WorkerOptions>;
outputWorkerMetadata?: boolean;
timezone?: string;
}
};

type JobOptions = Required<Pick<Job, 'name'>> & Partial<Omit<Job, 'name'>>;

interface BreeConfigs {
type BreeConfigs = {
logger: BreeLogger | boolean;
root: string | boolean;
silenceRootCheckError: boolean;
Expand All @@ -105,7 +105,7 @@ declare namespace Bree {
errorHandler?: (error: any, workerMetadata: any) => void;
workerMessageHandler?: (message: any, workerMetadata: any) => void;
outputWorkerMetadata: boolean;
}
};

type BreeOptions = Partial<Omit<BreeConfigs, 'jobs'>> & {
jobs?: Array<string | (() => void) | JobOptions>;
Expand All @@ -115,9 +115,9 @@ declare namespace Bree {

function extend<T = unknown>(plugin: PluginFunc<T>, options?: T): Bree;

interface BreeLogger {
type BreeLogger = {
info: (...args: any[]) => any;
warn: (...args: any[]) => any;
error: (...args: any[]) => any;
}
};
}

0 comments on commit 8482d16

Please sign in to comment.