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.

Errors while linting TypeScript

See original GitHub issue

I’ve installed prettier-standard to my monorepo project. When I run prettier-standard --lint on the root, I get the following errors:


   7 | export interface EnvVars {
   8 |   HOST_SSL?: string
>  9 |   HOST_DOMAIN?: string
     |   ^
  10 |   SERVER_PORT?: string
  11 |   WEB_CLIENTS?: string
  12 |   CORS_WHITELIST?: string
error  Parsing error: Unexpected token, expected "]"

  10 | export const getRequired = (config: RequiredConfig = {}) => {
  11 |   return Object.keys(config).reduce((required, key) => {
> 12 |     return config[key as keyof EnvVars] ? required.concat(key) : required
     |                       ^
  13 |   }, [] as string[])
  14 | }
error  'Record' is not defined  no-undef
error  Parsing error: Unexpected token, expected ";"

  15 |  * Console methods.
  16 |  */
> 17 | export type ConsoleMethod = keyof Omit<Console, 'Console'>
error  Parsing error: Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.

  3 | 
  4 | @Resolver()
> 5 | export class CommonResolver {

Am I missing something?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ahuggins-nhscommented, Sep 1, 2020

I’m having the same issues as the OP. There’s actually a couple of different scenarios:

Combinations of:

pretter-standard@16.4.1
typescript@4.0.2
@typescript-eslint/parser@4.0.1

or

pretter-standard@16.4.1
typescript@3.9.7
@typescript-eslint/parser@3.0.0

Results in eslint parsing errors.

Rolling back to 16.3.0 resolves my issue.

1reaction
einSelbstcommented, Apr 24, 2022

@HoraceShmorace this library doesn’t seem to be maintained anymore

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint not reporting TypeScript compiler type checking errors
Unfortunately ESLint only reports errors from it's own linters, it does not report typescript compilation failures.
Read more >
Common React TypeScript ESLint / Lint Errors & Warning ...
In this article, I cover common lint error messages I found in my projects and how I fixed them. Yes, Google and StackOverflow...
Read more >
Linting with Type Information | typescript-eslint
With that done, run the same lint command you ran before. You may see new rules reporting errors based on type information!
Read more >
ESLint can't detect error from typescript · Issue #352 - GitHub
It's by design I believe. ESLint is not in business of type checking your code. You should rely on TypeScript for checking for...
Read more >
Linting TypeScript | WebStorm Documentation - JetBrains
WebStorm highlights errors reported by ESLint in .ts and .tsx files when @typescript-eslint/parser is set as a parser in your project ESLint ...
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