9romise / eslint-import-resolver-oxc

A simply wrapped oxc-resolver for eslint-plugin-import-x
MIT License
20 stars 0 forks source link

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

Closed eamodio closed 1 month ago

eamodio commented 1 month ago

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 commented 1 month ago

Sorry for the noise, this was caused by https://github.com/typescript-eslint/typescript-eslint/issues/9999