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

'order ' rule breaks v2.21.1 - TypeError: Cannot read property 'indexOf' of null #1808

Closed
wentjun opened this issue Jun 8, 2020 · 5 comments · Fixed by #1823
Closed

'order ' rule breaks v2.21.1 - TypeError: Cannot read property 'indexOf' of null #1808

wentjun opened this issue Jun 8, 2020 · 5 comments · Fixed by #1823
Assignees

Comments

@wentjun
Copy link

wentjun commented Jun 8, 2020

I'm currently on the latest version of eslint-plugin-import (2.21.1), and it seems to be breaking my linting stage for some reason.

TypeError: Cannot read property 'indexOf' of null
Occurred while linting/index.ts:40
    at isAbsolute (/node_modules/eslint-plugin-import/lib/core/importType.js:48:15)
    at typeTest (/node_modules/eslint-plugin-import/lib/core/importType.js:117:7)
    at resolveImportType (/node_modules/eslint-plugin-import/lib/core/importType.js:149:10)
    at computeRank (/node_modules/eslint-plugin-import/lib/rules/order.js:315:44)
    at registerNode (/node_modules/eslint-plugin-import/lib/rules/order.js:331:16)
    at handleImports (/node_modules/eslint-plugin-import/lib/rules/order.js:598:9)
    at /node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/node_modules/eslint/lib/linter/node-event-generator.js:254:26)

Can't see how this particular line will go wrong, unless there are any breaking changes in that rule:

export import CreateSomething = _CreateSomething;

I didn't face any of such issues on the previous minor version. If there are any new changes to the rule, it should be reflected as part of the linting result, rather than throwing an error halfway.

@wentjun wentjun changed the title 'order ' rule breaks v2.20.1 - TypeError: Cannot read property 'indexOf' of null 'order ' rule breaks v2.21.1 - TypeError: Cannot read property 'indexOf' of null Jun 8, 2020
@ljharb
Copy link
Member

ljharb commented Jun 8, 2020

export import? I’m not familiar with that syntax.

@ljharb
Copy link
Member

ljharb commented Jun 8, 2020

Looks like it's this: https://stackoverflow.com/a/30714301/632724 but that suggests it should be export import Something = require('something else'), and not = _CreateSomething.

Either way, fix incoming.

@ljharb ljharb self-assigned this Jun 8, 2020
ljharb added a commit to ljharb/eslint-plugin-import that referenced this issue Jun 8, 2020
@ljharb ljharb closed this as completed in cc604c1 Jun 8, 2020
@gbuchthal
Copy link

Looks like this fix isn't actually showing up in the release (2.21.1). Any idea when the release will include this change?

@wentjun
Copy link
Author

wentjun commented Jun 9, 2020

@gbuchthal this happens in the latest release(2.21.1), thus the fix will probably only be fixed in the next patch.

@ljharb
Copy link
Member

ljharb commented Jun 9, 2020

Indeed; this fix is not yet released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants