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

TypeError: Cannot convert a Symbol value to a string when using this as a resolver to eslint-plugin-import-x #25

Closed
eamodio opened this issue Sep 19, 2024 · 1 comment

Comments

@eamodio
Copy link

eamodio commented Sep 19, 2024

I don't know if the issue is caused by this repo, or more likely https://github.com/oxc-project/oxc-resolver, but I'll start here.

I tried switching to use eslint-import-resolver-oxc as a resolver for eslint-plugin-import-x, but it crashes with the following:

=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=4.7.4 <5.6.0

YOUR TYPESCRIPT VERSION: 5.6.2

Please only submit bug reports when using the officially supported version.

=============

Oops! Something went wrong! :(

ESLint: 9.10.0

TypeError: Cannot convert a Symbol value to a string
Occurred while linting <removed-path>\src\system\iterable.ts:121
Rule: "@typescript-eslint/prefer-promise-reject-errors"
    at getStaticMemberAccessValue (<removed-path>\node_modules\@typescript-eslint\eslint-plugin\dist\util\misc.js:207:43)
    at isStaticMemberAccessOfValue (<removed-path>\node_modules\@typescript-eslint\eslint-plugin\dist\util\misc.js:214:95)
    at CallExpression (<removed-path>\node_modules\@typescript-eslint\eslint-plugin\dist\rules\prefer-promise-reject-errors.js:71:61)
    at ruleErrorHandler (<removed-path>\node_modules\eslint\lib\linter\linter.js:1083:48)
    at <removed-path>\node_modules\eslint\lib\linter\safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (<removed-path>\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (<removed-path>\node_modules\eslint\lib\linter\node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (<removed-path>\node_modules\eslint\lib\linter\node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (<removed-path>\node_modules\eslint\lib\linter\node-event-generator.js:337:14)
error Command failed with exit code 2.

The line it is choking on is:

export function first<T>(source: Iterable<T> | IterableIterator<T>): T | undefined {
	return source[Symbol.iterator]().next().value as T | undefined;  // <--- this line causes the issue
}
@eamodio
Copy link
Author

eamodio commented Sep 19, 2024

Sorry for the noise, this was caused by typescript-eslint/typescript-eslint#9999

@eamodio eamodio closed this as completed Sep 19, 2024
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