Skip to content

v0.23.0 has a TypeError in newline-after-import #2056

Closed
@ddolcimascolo

Description

@ddolcimascolo

Hi guys,

Our build fails when upgrading to v2.23.0 with lots of
error Unexpected use of file extension "js" for "./AboutInfo.js" import/extensions

The rule's actually right, this is something we need to fix. But if it's a change in some defaults, maybe you should have released a major version. WDYT?
Typically minors and patches do not introduce breaking changes.

Cheers!

David

Activity

likezero

likezero commented on May 14, 2021

@likezero

image

tgxpuisb

tgxpuisb commented on May 14, 2021

@tgxpuisb
martinstark

martinstark commented on May 14, 2021

@martinstark

Can chime in that something is broken in 2.23.0

TypeError: Cannot read property 'type' of null
Occurred while linting /home/ms/dev/web-player/cc-sender/src/index.tsx:8
    at isExportNameClass (/home/ms/dev/web-player/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js:51:69)
    at checkForNewLine (/home/ms/dev/web-player/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js:79:45)
    at checkImport (/home/ms/dev/web-player/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js:133:9)
    at /home/ms/dev/web-player/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/home/ms/dev/web-player/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/home/ms/dev/web-player/node_modules/eslint/lib/linter/node-event-generator.js:256:26)
    at NodeEventGenerator.applySelectors (/home/ms/dev/web-player/node_modules/eslint/lib/linter/node-event-generator.js:285:22)
    at NodeEventGenerator.enterNode (/home/ms/dev/web-player/node_modules/eslint/lib/linter/node-event-generator.js:299:14)
    at CodePathAnalyzer.enterNode (/home/ms/dev/web-player/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:711:23)
nthtrung09it

nthtrung09it commented on May 14, 2021

@nthtrung09it
starandtina

starandtina commented on May 14, 2021

@starandtina
added a commit that references this issue on May 14, 2021
minwe

minwe commented on May 14, 2021

@minwe
mlbiche

mlbiche commented on May 14, 2021

@mlbiche
SoloJiang

SoloJiang commented on May 14, 2021

@SoloJiang

We also have something wrong with this version:
image

waitingsong

waitingsong commented on May 14, 2021

@waitingsong
joriewong

joriewong commented on May 14, 2021

@joriewong
slaweet

slaweet commented on May 14, 2021

@slaweet

Same issue:

$ vue-cli-service lint
 ERROR  TypeError: Cannot read property 'type' of null
Occurred while linting /home/runner/_work/frontend/frontend/src/api/mocks/index.ts:2
TypeError: Cannot read property 'type' of null
Occurred while linting /home/runner/_work/frontend/frontend/src/api/mocks/index.ts:2
    at isExportNameClass (/home/runner/_work/frontend/frontend/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js:51:69)
    at checkForNewLine (/home/runner/_work/frontend/frontend/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js:79:45)
    at checkImport (/home/runner/_work/frontend/frontend/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js:133:9)
    at /home/runner/_work/frontend/frontend/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/home/runner/_work/frontend/frontend/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/home/runner/_work/frontend/frontend/node_modules/eslint/lib/linter/node-event-generator.js:256:26)
    at NodeEventGenerator.applySelectors (/home/runner/_work/frontend/frontend/node_modules/eslint/lib/linter/node-event-generator.js:285:22)
    at NodeEventGenerator.enterNode (/home/runner/_work/frontend/frontend/node_modules/eslint/lib/linter/node-event-generator.js:299:14)
    at CodePathAnalyzer.enterNode (/home/runner/_work/frontend/frontend/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:711:23)
error Command failed with exit code 1.
info Visit yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.
ljharb

ljharb commented on May 14, 2021

@ljharb
Member

Please do not post “same issue” unless you can provide new information. I will fix the type error as soon as i can.

@ddolcimascolo a new eslint warning that should have always appeared is typically not considered a breaking change, otherwise every bugfix would be one. Unfortunately your issue has been hijacked by the type error, so I’ll get to that after publishing a v2.23.1 that fixes the crash.

12 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ljharb@starandtina@martinstark@slaweet@waitingsong

        Issue actions

          v0.23.0 has a TypeError in newline-after-import · Issue #2056 · import-js/eslint-plugin-import