question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript error in plugin

See original GitHub issue

Getting error for this code:

import * as _ from "lodash";

Error occurs only when the file contains single line.

TypeError: Cannot read property 'loc' of null
Occurred while linting ...\tests\index.ts:1
    at Object.problem.fix (...\node_modules\eslint-plugin-unused-imports\lib\rules\predicates.js:57:38)
    at normalizeFixes (...\node_modules\eslint\lib\linter\report-translator.js:193:28)
    at ...\node_modules\eslint\lib\linter\report-translator.js:364:49
    at Object.report (...\node_modules\eslint\lib\linter\linter.js:920:41)
    at Object.value [as report] (...\node_modules\eslint-rule-composer\lib\rule-composer.js:147:31)
    at Program:exit (...\node_modules\@typescript-eslint\eslint-plugin\dist\rules\no-unused-vars.js:302:33)
    at ...\node_modules\eslint\lib\linter\safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (...\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (...\node_modules\eslint\lib\linter\node-event-generator.js:293:26)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
laleksiunascommented, Jul 3, 2021

I can no longer reproduce the issue. Thanks!

0reactions
sweeplinecommented, Jul 1, 2021

This should be fixed by #34, can you confirm using v1.1.2?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to catch @rollup/plugin-typescript errors - Stack Overflow
I use api rollup. watch(options) to build typescript. By default @rollup/plugin-typescript will print an error message in the console if there ...
Read more >
Typescript plugin 4.0.0 Error: Unexpected token (Note that you ...
Typescript plugin 4.0.0 Error: Unexpected token (Note that you need plugins to import files that are not JavaScript) #287.
Read more >
JavaScript and TypeScript Plugin error report on cold start of ...
JavaScript and TypeScript Plugin error report on cold start of IDEA. Relates to 1. Relates to 1 issue (1 unresolved). What steps will...
Read more >
babel/plugin-transform-typescript
This plugin adds support for the types syntax used by the TypeScript programming language. However, this plugin does not add the ability to...
Read more >
@rollup/plugin-typescript - npm
This can fix plugin errors when parsing files outside the current working directory (process.cwd()). tsconfig. Type: String | Boolean Default: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found