eslint-plugin-import: v0.23.0 has a TypeError in newline-after-import

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

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 28
  • Comments: 20 (6 by maintainers)

Commits related to this issue

Most upvoted comments

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)

me too…

@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

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.

@martinstark as long as it’s fixed for you, then no 😃

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

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

same issue

Oops! Something went wrong! :(

ESLint: 7.26.0

TypeError: Cannot read property 'type' of null