question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

prevent-abbreviations: Fix objects must not be overlapped in a report.

See original GitHub issue

Hello, I’m testing stability of well known community ESLint plugins with eslint-remote-tester. This ESLint plugin seems to contain a rule which causes linter to crash. ESLint rules should not crash in any condition since this makes all valid linting problems disappear. If this is a false flag please let me know.

This issue was spotted by automated CI run: https://github.com/AriPerkkio/eslint-remote-tester/runs/1487452403

Crashing rule:

prevent-abbreviations

If name of the VariableExpression and name of the TSTypeReference are identical unicorn/prevent-abbreviations crashes.

Minimal repro:

This seems to be valid typescript: https://www.typescriptlang.org/play?#code/JYOwLgpgTgZghgYwgAgApQPYAdkG8BQyRywAJgFzIgCuAtgEbQDc+AvvvghiAM5hqYsldNmQBePCQrIAjMlYt8EAB5YMUfqQjxqAG34isTIA

interface Prop {
    id: number;
}

const Prop: Prop = { id: 1 };

export default Prop;

This causes ESlint to dispaly an error:

$ ./node_modules/.bin/eslint lib

Oops! Something went wrong! :(

ESLint: 7.12.1

AssertionError [ERR_ASSERTION]: Fix objects must not be overlapped in a report.
    at mergeFixes (/<root-path-removed>/node_modules/eslint/lib/linter/report-translator.js:152:9)
    at normalizeFixes (/<root-path-removed>/node_modules/eslint/lib/linter/report-translator.js:182:16)
    at /<root-path-removed>/node_modules/eslint/lib/linter/report-translator.js:347:49
    at Object.report (/<root-path-removed>/node_modules/eslint/lib/linter/linter.js:920:41)
    at checkVariable (/<root-path-removed>/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:653:11)
    at checkPossiblyWeirdClassVariable (/<root-path-removed>/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:567:10)
    at /<root-path-removed>/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:657:39
    at Array.forEach (<anonymous>)
    at checkVariables (/<root-path-removed>/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:657:19)
    at checkScope (/<root-path-removed>/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:665:3)
Errors from real-world projects

Rule: prevent-abbreviations

  • Message: Fix objects must not be overlapped in a report. Occurred while linting <text>:1
  • Path: microsoft/fluentui/packages/codemods/src/modRunner/tests/mocks/MockMods/CodeMod.mock.ts
  • Link

AssertionError [ERR_ASSERTION]: Fix objects must not be overlapped in a report.
    at mergeFixes (/<root-path-removed>/node_modules/eslint/lib/linter/report-translator.js:152:9)
    at normalizeFixes (/<root-path-removed>/node_modules/eslint/lib/linter/report-translator.js:182:16)
    at /<root-path-removed>/node_modules/eslint/lib/linter/report-translator.js:347:49
    at Object.report (/<root-path-removed>/node_modules/eslint/lib/linter/linter.js:920:41)
    at checkVariable (/<root-path-removed>/ci/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:653:11)
    at checkPossiblyWeirdClassVariable (/<root-path-removed>/ci/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:567:10)
    at /<root-path-removed>/ci/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:657:39
    at Array.forEach (<anonymous>)
    at checkVariables (/<root-path-removed>/ci/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:657:19)
    at checkScope (/<root-path-removed>/ci/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:665:3)

Rule: prevent-abbreviations

  • Message: Fix objects must not be overlapped in a report. Occurred while linting <text>:1
  • Path: microsoft/fluentui/packages/fluentui/docs/src/components/ComponentDoc/ComponentPropsTable/ComponentPropsTable.tsx
  • Link

AssertionError [ERR_ASSERTION]: Fix objects must not be overlapped in a report.
    at mergeFixes (/<root-path-removed>/node_modules/eslint/lib/linter/report-translator.js:152:9)
    at normalizeFixes (/<root-path-removed>/node_modules/eslint/lib/linter/report-translator.js:182:16)
    at /<root-path-removed>/node_modules/eslint/lib/linter/report-translator.js:347:49
    at Object.report (/<root-path-removed>/node_modules/eslint/lib/linter/linter.js:920:41)
    at checkVariable (/<root-path-removed>/ci/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:653:11)
    at checkPossiblyWeirdClassVariable (/<root-path-removed>/ci/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:567:10)
    at /<root-path-removed>/ci/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:657:39
    at Array.forEach (<anonymous>)
    at checkVariables (/<root-path-removed>/ci/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:657:19)
    at checkScope (/<root-path-removed>/ci/node_modules/eslint-plugin-unicorn/rules/prevent-abbreviations.js:665:3)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
fiskercommented, Dec 4, 2020

That’s fast!

1reaction
AriPerkkiocommented, Dec 4, 2020

https://github.com/AriPerkkio/eslint-remote-tester/actions/runs/400370452

2020-12-04T09:44:59.9814689Z [STARTING] angular/angular
2020-12-04T09:45:00.8470164Z [CLONING] angular/angular
2020-12-04T09:45:07.1292427Z [READING] angular/angular
2020-12-04T09:45:07.5325792Z [LINTING] angular/angular - 7235 files
2020-12-04T09:47:18.1100434Z [DONE] angular/angular 0 errors
2020-12-04T09:47:18.1101915Z [DONE] Finished scan of 1 repositories
2020-12-04T09:47:18.1450667Z 
2020-12-04T09:47:18.1452038Z Results:
2020-12-04T09:47:18.1453248Z No errors
2020-12-04T09:47:18.1526302Z 
2020-12-04T09:47:18.1604167Z Done in 139.51s.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix objects must not be overlapped in a report. #912 - Issuehunt
Hello, I'm testing stability of well known community ESLint plugins with eslint-remote-tester . This ESLint plugin seems to contain a rule which causes ......
Read more >
Setting up efficient workflows with ESLint, Prettier and ...
In this article I would like to start very easily and go into more depth from topic to topic. In the first step...
Read more >
Eslint --fix removes type annotation - Stack Overflow
After command eslint --fix i will get next code: formCtrlName = '';. and error: 26:3 error expected formCtrlName to have a type annotation ......
Read more >
The eslint-remote-tester from AriPerkkio - GithubHelp
Run eslint-remote-tester locally; Apply code changes of the fix back ... prevent-abbreviations: Fix objects must not be overlapped in a report.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found