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

newline-after-import: "Cannot read property 'type' of null" in isExportNameClass #2079

Closed
jens-duttke opened this issue May 15, 2021 · 1 comment

Comments

@jens-duttke
Copy link

Using version 2.23.1 I'm getting the following error:

TypeError: Cannot read property 'type' of null
Occurred while linting P:\HexEd.it\src\ts\context\editors\index.tsx:23
    at isExportNameClass (P:\linter-bundle\node_modules\eslint-plugin-import\lib\rules\newline-after-import.js:51:69)
    at checkForNewLine (P:\linter-bundle\node_modules\eslint-plugin-import\lib\rules\newline-after-import.js:79:45)
    at checkImport (P:\linter-bundle\node_modules\eslint-plugin-import\lib\rules\newline-after-import.js:133:9)
    at P:\linter-bundle\node_modules\eslint\lib\linter\timing.js:142:13
    at P:\linter-bundle\node_modules\eslint\lib\linter\safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (P:\linter-bundle\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (P:\linter-bundle\node_modules\eslint\lib\linter\node-event-generator.js:256:26)
    at NodeEventGenerator.applySelectors (P:\linter-bundle\node_modules\eslint\lib\linter\node-event-generator.js:285:22)
    at NodeEventGenerator.enterNode (P:\linter-bundle\node_modules\eslint\lib\linter\node-event-generator.js:299:14)

The source file (P:\HexEd.it\src\ts\context\editors\index.tsx) looks like this:

/**
 * ...
 * ...
 * ...
 * ...
 * ...
 */

import * as Sentry from '@sentry/browser';
import type { EditorOptions, ContextMenuData, CursorChangeData, DataChangeData, InvalidUserInputData, SizeChangeData, InternalEventData, LayoutOptions } from 'hexedit';
import { Editor, BlobDataProvider } from 'hexedit';
import * as React from 'react';

import type { I18N } from '@context/i18n';
import type { Settings } from '@context/settings';
import { withContext } from '@context/withContext';
import * as IntelHexHelper from '@helper/IntelHex';
import * as MotorolaSRecordHelper from '@helper/MotorolaSRecord';
import * as RevertNativeMethodOverridesHelper from '@helper/RevertNativeMethodOverrides';
import * as TypedArrayHelper from '@helper/TypedArray';
import * as Utils from '@utils';

import styles from './styles.module.scss'; // This is line 23

export { default as editorsStyles } from './styles.module.scss';

(See the comment // This is line 23 for the errornous line)

The configuration of the newline-after-import rule looks like this:

'import/newline-after-import': 'error',
@ljharb
Copy link
Member

ljharb commented May 15, 2021

This was already fixed in 8d7ec17 (but due to #2077, was mistakenly omitted from the release). The next release will include it.

Duplicate of #2063. Duplicate of #2065.

@ljharb ljharb closed this as completed May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants