lydell / eslint-plugin-simple-import-sort

Easy autofixable import sorting.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: parentNode.body is not iterable in v11

jakebailey opened this issue · comments

I tried updating to v11 on the TypeScript repo, and got this:

Oops! Something went wrong! :(

ESLint: 8.56.0

TypeError: parentNode.body is not iterable
Occurred while linting /home/jabaile/work/TypeScript/src/harness/fourslashInterfaceImpl.ts:1
Rule: "simple-import-sort/imports"
    at Object.extractChunks (/home/jabaile/work/TypeScript/node_modules/eslint-plugin-simple-import-sort/shared.js:10:33)
    at Program:exit (/home/jabaile/work/TypeScript/node_modules/eslint-plugin-simple-import-sort/imports.js:67:38)
    at ruleErrorHandler (/home/jabaile/work/TypeScript/node_modules/eslint/lib/linter/linter.js:1076:28)
    at /home/jabaile/work/TypeScript/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/home/jabaile/work/TypeScript/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/home/jabaile/work/TypeScript/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (/home/jabaile/work/TypeScript/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.leaveNode (/home/jabaile/work/TypeScript/node_modules/eslint/lib/linter/node-event-generator.js:349:14)
    at CodePathAnalyzer.leaveNode (/home/jabaile/work/TypeScript/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:824:23)

This is one of the few files with import declarations, so no doubt this was introduced in #149.

@jakebailey please give some code to reproduce

This snippet does it:

export namespace Completion {
    export import CompletionSource = ts.Completions.CompletionSource;
}

@jakebailey Thank you. Can you give your config for this rule?
Everything seems to be fine with the default configuration.

Finnaly, I got it. I'll fix