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

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

Closed
ddolcimascolo opened this issue May 14, 2021 · 20 comments
Closed

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

ddolcimascolo opened this issue May 14, 2021 · 20 comments

Comments

@ddolcimascolo
Copy link

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

@likezero
Copy link

image

@tgxpuisb

This comment has been minimized.

@martinstark
Copy link

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

This comment has been minimized.

@starandtina

This comment has been minimized.

@minwe

This comment has been minimized.

@mlbiche

This comment has been minimized.

@SoloJiang
Copy link

We also have something wrong with this version:
image

@waitingsong

This comment has been minimized.

@joriewong

This comment has been minimized.

@slaweet
Copy link

slaweet commented May 14, 2021

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
Copy link
Member

ljharb commented May 14, 2021

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.

@ljharb
Copy link
Member

ljharb commented May 14, 2021

@SoloJiang @mlbiche please file a new issue for that, so it doesn’t get lost in the noise here.

@ljharb ljharb changed the title Possible breaking change in v2.23.0 v0.23.0 has a TypeError in newline-after-import May 14, 2021
@ljharb
Copy link
Member

ljharb commented May 14, 2021

@martinstark @slaweet can you provide the content of /home/ms/dev/web-player/cc-sender/src/index.tsx / /home/runner/_work/frontend/frontend/src/api/mocks/index.ts so i can make a test case?

ljharb added a commit that referenced this issue May 14, 2021
@ljharb
Copy link
Member

ljharb commented May 14, 2021

I believe the crash should be solved in 8d7ec17 / #2063.

I'll close this for now - @ddolcimascolo, would you mind filing a new issue, and include the code that's warning now?

@ljharb ljharb closed this as completed May 14, 2021
@ddolcimascolo
Copy link
Author

@ljharb I could, but it's really any require('×××.js') instead of require('×××'). I'll fix these in our codebase anyway so I'm good

@ljharb
Copy link
Member

ljharb commented May 14, 2021

As long as that's only for relative files (package names ending in ".js" aren't an extension) then that seems like indeed just a bugfix in the rule.

@ddolcimascolo
Copy link
Author

Yes, only relative files. A few require('./index.js') also that should read require('.')

@martinstark
Copy link

@ljharb sorry for the delay! I take it I don't need to provide the code example anymore given this has now been closed

@ljharb
Copy link
Member

ljharb commented May 15, 2021

@martinstark as long as it’s fixed for you, then no :-)

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