Closed nolanlawson closed 2 years ago
When trying to release into eslint-config-lwc, I noticed a bug in the no-disallowed-lwc-imports rule. It fails on code like this:
eslint-config-lwc
no-disallowed-lwc-imports
export function foo() {}
export const foo = 'foo'
This throws TypeError: Cannot read properties of null (reading 'type') at this line:
TypeError: Cannot read properties of null (reading 'type')
https://github.com/salesforce/eslint-plugin-lwc/blob/6128fbe36a262b12a8e66d9d3d2a2a902ea4afde/lib/rules/no-disallowed-lwc-imports.js#L37
The problem is that we weren't distinguishing these usages from exports like export { foo } from 'lwc'.
export { foo } from 'lwc'
This PR fixes that.
When trying to release into
eslint-config-lwc
, I noticed a bug in theno-disallowed-lwc-imports
rule. It fails on code like this:This throws
TypeError: Cannot read properties of null (reading 'type')
at this line:https://github.com/salesforce/eslint-plugin-lwc/blob/6128fbe36a262b12a8e66d9d3d2a2a902ea4afde/lib/rules/no-disallowed-lwc-imports.js#L37
The problem is that we weren't distinguishing these usages from exports like
export { foo } from 'lwc'
.This PR fixes that.