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): Cannot read properties of undefined (reading 'getTokensBefore') #121

Open
2 tasks done
bab2683 opened this issue Apr 2, 2024 · 7 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@bab2683
Copy link

bab2683 commented Apr 2, 2024

Describe the bug

Getting that error when running the linter

Code example

const something = {
  b: false,
  a: true,
};

ESLint version

8.36

ESLint Plugin Perfectionist version

2.7.0

Additional comments

Apple M3 Pro
macOS Sonoma 14.3

Validations

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

azat-io commented Apr 2, 2024

Looks like a problem with the typescript-eslint version.
What package manager are you using?

@bab2683
Copy link
Author

bab2683 commented Apr 2, 2024

We're using yarn@1.22.211 and @typescript-eslint/utils@6.8.0

@bab2683
Copy link
Author

bab2683 commented Apr 3, 2024

BTW, I just tried upgrading @typescript-eslint/eslint-plugin, @typescript-eslint/parser and @typescript-eslint/utils to latest non breaking version 6.21.0 and the issue is still reproducible

@azat-io
Copy link
Owner

azat-io commented Apr 3, 2024

Do you have the ability to create a small repository to reproduce the problem?

@bab2683
Copy link
Author

bab2683 commented Apr 10, 2024

Hi, sorry for the delay, you can reproduce it here:
https://github.com/bab2683/perfectionist-121

@azat-io
Copy link
Owner

azat-io commented Apr 13, 2024

image

Looks like the removing parser fix this issue.

@bab2683
Copy link
Author

bab2683 commented Apr 15, 2024

To use typescript however, is necessary due to the differences in AST format. at least that's what they say right in the first line https://typescript-eslint.io/packages/parser/. I thought this eslint plugin was compatible with the whole @typescript-eslint suite due to the sort-interfaces rule and also because it's listed as dependency.

We use the parser in the overwrites because we have both js and ts files in the project

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