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

Bug: sort-object-types - Fix objects must not be overlapped in a report. #13

Closed
2 tasks done
dylang opened this issue Jun 10, 2023 · 2 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@dylang
Copy link

dylang commented Jun 10, 2023

Describe the bug

New bug from v1.1.1:

Fix objects must not be overlapped in a report.
Occurred while linting /project/file-with-error.ts:10
Rule: "perfectionist/sort-object-types"
AssertionError [ERR_ASSERTION]: Fix objects must not be overlapped in a report.
    at mergeFixes (/project/node_modules/eslint/lib/linter/report-translator.js:152:9)
    at normalizeFixes (/project/node_modules/eslint/lib/linter/report-translator.js:182:16)
    at /project/node_modules/eslint/lib/linter/report-translator.js:349:49
    at Object.report (/project/node_modules/eslint/lib/linter/linter.js:1021:41)
    at /project/node_modules/eslint-plugin-perfectionist/dist/index.js:1:7540
    at I (/project/node_modules/eslint-plugin-perfectionist/dist/index.js:1:2732)
    at TSTypeLiteral (/project/node_modules/eslint-plugin-perfectionist/dist/index.js:1:7516)
    at /project/node_modules/eslint/lib/linter/timing.js:141:28
    at ruleErrorHandler (/project/node_modules/eslint/lib/linter/linter.js:1050:28)
    at /project/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/project/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/project/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (/project/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (/project/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
    at CodePathAnalyzer.enterNode (/project/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:795:23)
    at /project/node_modules/eslint/lib/linter/linter.js:1085:32
    at Array.forEach (<anonymous>)
    at runRules (/project/node_modules/eslint/lib/linter/linter.js:1080:15)
    at Linter._verifyWithoutProcessors (/project/node_modules/eslint/lib/linter/linter.js:1330:31)
    at Linter._verifyWithConfigArray (/project/node_modules/eslint/lib/linter/linter.js:1706:21)
    at Linter.verify (/project/node_modules/eslint/lib/linter/linter.js:1412:65)
    at Linter.verifyAndFix (/project/node_modules/eslint/lib/linter/linter.js:1967:29)
    at verifyText (/project/node_modules/eslint/lib/cli-engine/cli-engine.js:245:48)
    at CLIEngine.executeOnFiles (/project/node_modules/eslint/lib/cli-engine/cli-engine.js:825:28)
    at ESLint.lintFiles (/project/node_modules/eslint/lib/eslint/eslint.js:551:23)

Code example

Seems like the // should just be string is the cause.

export const generateListOfChanges = ({
    arrayOfChanges,
    propNameForWhatChanged,
    formatValue = (value) => `${value}%`
}: {
    arrayOfChanges: {
        isIncreased: boolean;
        isImproved: boolean;
        change: number;
        isSame: boolean;
        [propNameForWhatChanged: string]: boolean | number | string | unknown; // should just be string
    }[];
    propNameForWhatChanged: string;
    formatValue?: (value: number) => string;
}) => {
};

ESLint version

v8.41.0

ESLint Plugin Perfectionist version

v1.1.1

Additional comments

Thanks for fixing these so quickly!

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@dylang dylang added the bug Something isn't working label Jun 10, 2023
@azat-io
Copy link
Owner

azat-io commented Jun 10, 2023

Thanks. This seems to be a similar problem to #11
I will fix it soon.

@azat-io
Copy link
Owner

azat-io commented Jun 10, 2023

Fixed in 03e5508

Released in v1.1.2

@azat-io azat-io closed this as completed Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants