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

Fix objects must not be overlapped in a report #52

Open
zachbryant opened this issue Aug 30, 2022 · 0 comments
Open

Fix objects must not be overlapped in a report #52

zachbryant opened this issue Aug 30, 2022 · 0 comments

Comments

@zachbryant
Copy link

zachbryant commented Aug 30, 2022

Hi, I'm receiving this error when I uncomment the interface rule in my eslint config.

yarn 1.22.11
eslint 8.17.0
eslint-plugin-typescript-sort-keys 2.1.0

The offending line: 'typescript-sort-keys/interface': 'warn',

A sample of the input file (it's really long, and I also can't share it directly)

declare namespace A {
    interface Ab extends b {
        d: string;
        n: number;
    }
    interface Ac<T> {
        d: any[];
        t: T;
        type: string;
    }
    interface D {
        /* a comment */
    }
}

declare namespace A.G {
    interface P<T> extends PromiseLike<T> {
        then<U>(
            hello?: (_: T) => P<U>,
            world?: (_: any) => P<U>,
            something?: (_: any) => void,
        ): P<U>;
        cancel(): void;
    }
    type H = P<void>;

    namespace Hello {
        interface V<T> extends Array<T> {
            a(
                value: T,
                ...extra: any[]
            ): { _: number; _1: boolean }
        }
        namespace Z {
            /** Specifies the type of activation. */
            enum ZZ {
                a, b, c
            }
            abstract class J {
                hello: string:
            }
        }
    }
}

What I see:

$ eslint . --ext .ts,.tsx,.js,.jsx --fix --ignore-path ../../../.eslintignore

Oops! Something went wrong! :(

ESLint: 8.17.0

AssertionError [ERR_ASSERTION]: Fix objects must not be overlapped in a report.
    at mergeFixes (C:\Users\me\repo\node_modules\eslint\lib\linter\report-translator.js:167:9)
    at normalizeFixes (C:\Users\me\repo\node_modules\eslint\lib\linter\report-translator.js:197:16)
    at C:\Users\me\repo\node_modules\eslint\lib\linter\report-translator.js:364:49
    at Object.report (C:\Users\me\repo\node_modules\eslint\lib\linter\linter.js:1085:41)
    at C:\Users\me\repo\node_modules\eslint-plugin-typescript-sort-keys\lib\index.cjs.js:296:25
    at TSTypeLiteral (C:\Users\me\repo\node_modules\eslint-plugin-typescript-sort-keys\lib\index.cjs.js:395:24)    
    at ruleErrorHandler (C:\Users\me\repo\node_modules\eslint\lib\linter\linter.js:1114:28)
    at C:\Users\me\repo\node_modules\eslint\lib\linter\safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (C:\Users\me\repo\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant