brandongregoryscott / eslint-plugin-collation

ESLint plugin for making your code easier to read, with autofix and TypeScript support
https://eslint-plugin-collation.brandonscott.me
Apache License 2.0
4 stars 0 forks source link

`no-inline-exports` - Export should be moved to end of scope, not file #57

Closed brandongregoryscott closed 2 years ago

brandongregoryscott commented 2 years ago
// globals.d.ts
declare module "opus-media-recorder" {
    export interface OpusMediaRecorderWorkerOptions {
        OggOpusEncoderWasmPath: string;
        WebMOpusEncoderWasmPath: string;
        encoderWorkerFactory: () => Worker;
    }
}

The error is reported on line 3 (export interface OpusMediaRecorderWorkerOptions), however, the fix moves the export outside of the module declaration, which isn't accurate:

// globals.d.ts
declare module "opus-media-recorder" {
   interface OpusMediaRecorderWorkerOptions {
        OggOpusEncoderWasmPath: string;
        WebMOpusEncoderWasmPath: string;
        encoderWorkerFactory: () => Worker;
    }
}

export { OpusMediaRecorderWorkerOptions };

It should be:

// globals.d.ts
declare module "opus-media-recorder" {
   interface OpusMediaRecorderWorkerOptions {
        OggOpusEncoderWasmPath: string;
        WebMOpusEncoderWasmPath: string;
        encoderWorkerFactory: () => Worker;
    }

    export { OpusMediaRecorderWorkerOptions };
}