typescript不';t在编译时排除节点_模块

typescript不';t在编译时排除节点_模块,typescript,yarn-workspaces,Typescript,Yarn Workspaces,每次我试图构建代码时都会出现这个错误,而且我忘了告诉大家我正在使用Thread workspace,并且我在所有Tconfig中都排除了node_模块 实际误差: $ rimraf ./dist && tsc ../../node_modules/graphql-toolkit/dist/esnext/utils/validate-documents.d.ts:7:115 - error TS1005: ',' expected. 7 export declare const

每次我试图构建代码时都会出现这个错误,而且我忘了告诉大家我正在使用Thread workspace,并且我在所有Tconfig中都排除了node_模块

实际误差:

$ rimraf ./dist && tsc
../../node_modules/graphql-toolkit/dist/esnext/utils/validate-documents.d.ts:7:115 - error TS1005: ',' expected.

7 export declare const validateGraphQlDocuments: (schema: GraphQLSchema, documentFiles: DocumentFile[]) => readonly LoadDocumentError[];
                                                                                                                    ~~~~~~~~~~~~~~~~~


../../node_modules/graphql-toolkit/dist/esnext/utils/validate-documents.d.ts:7:132 - error TS1005: ',' expected.

7 export declare const validateGraphQlDocuments: (schema: GraphQLSchema, documentFiles: DocumentFile[]) => readonly LoadDocumentError[];

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
即使我排除了node_模块和skipLibCheck,我也无法让它工作:是的,但似乎没有任何帮助

我的tsconfig.json


{
  "compilerOptions": {
    "target": "es6",
    "module": "commonjs",
    "lib": ["dom", "es6", "es2017", "esnext", "esnext.asynciterable"],
    "sourceMap": true,
    "outDir": "./dist",
    "moduleResolution": "node",
    "removeComments": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "noImplicitThis": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "allowSyntheticDefaultImports": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "skipLibCheck": true
  },
  "exclude": ["node_modules"],
  "include": ["./src/**/*.tsx", "./src/**/*.ts"]
}


我想用无错误编译它,并排除节点模块中的.d.ts文件

您可能只需要升级到TypeScript版本>=3.4(其中存在
只读
语法)。我使用TypeScript v3.8.3-但面临同样的问题,您可能只需要升级到TypeScript版本>=3.4(这里有
readonly
语法)。我使用typescript v3.8.3,但面临同样的问题