Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Use tsconfig.json #1

Closed
egoist opened this issue Mar 14, 2021 · 5 comments
Closed

Use tsconfig.json #1

egoist opened this issue Mar 14, 2021 · 5 comments
Labels
question Further information is requested

Comments

@egoist
Copy link

egoist commented Mar 14, 2021

Seems it doesn't respect tsconfig.json, I've already added es2020 to lib but it still throws this error:

image

@johnsoncodehk johnsoncodehk added the question Further information is requested label Mar 14, 2021
@johnsoncodehk
Copy link
Owner

You cannot use tsconfig.json when you specify a file, see: microsoft/TypeScript#29241

@leedalei
Copy link

leedalei commented Apr 9, 2021

You cannot use tsconfig.json when you specify a file, see: microsoft/TypeScript#29241

is there any solutions? when I use husky+lint-staged and push this command vue-tsc --noEmit into lint-staged's options,

"lint-staged": {
    "src/**/*.{ts,tsx,js,json,vue}": [
      "prettier --write",
      "eslint --fix",
      "vue-tsc --noEmit"
    ]
  },

it will report an error

node_modules/@vue/reactivity/dist/reactivity.d.ts(219,13): error TS2550: Property 'matchAll' does not exist on type 'SymbolConstructor'. Do you need to change your target library? Try changing the `lib` compiler option to 'es2020' or later.

Seems lint-staged has helped vue-tsc specify some files only in git stage?

my English is poor,hope you can understand, thanks~

@johnsoncodehk
Copy link
Owner

johnsoncodehk commented Apr 9, 2021

@leedalei This is typescript limit I think, please try to find a solution on tsc first. (replace vue-tsc --noEmit to tsc --noEmit)

@leedalei
Copy link

leedalei commented Apr 9, 2021

@johnsoncodehk when using tsc --noEmit it reports an error

error TS6054: File '/Users/leelei/Documents/Work/moonShop/yarn.lock' has an unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'.
  The file is in the program because:
    Root file specified for compilation   (`Root file specified for compilation` means I've specified some files, right?)

but I've created a tsconfig.json

"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]

Seems lint-staged has helped vue-tsc specify some files only in git stage, so this tsconfig.json doesn't work .

There is no way to solve this the problem cause it's a limit from typescript, right?

@johnsoncodehk
Copy link
Owner

There is no way to solve this the problem cause it's a limit from typescript, right?

@leedalei Yes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants