Open muescha opened 4 years ago
@wooorm you have any idea why this error is there?
I donβt know TS so, /cc @ChristianMurphy!
note: it is just a plain checkout of the fork with no changes.
it looks like there is a breaking change:
https://github.com/iamturns/eslint-config-airbnb-typescript/pull/63
just now i have no clue how a tsconfig.json
should need to look
We donβt use eslint-config-airbnb π€
The error is coming from xo
, if it is locked to version 0.27.0
it works, version 0.27.2
errors, upgrading to ^0.30.0
also resolves the issue, but introduces some new rules which may request changes.
is the best if i stick to 0.27.0 now?
That works for me
with 0.27.0 all works except test-types
:
error TS2688: Cannot find type definition file for 'babel__core'.
error TS2688: Cannot find type definition file for 'babel__template'.
/Users/muescha/.nvm/versions/node/v12.13.1/bin/node /Users/muescha/.nvm/versions/node/v12.13.1/lib/node_modules/npm/bin/npm-cli.js run test-types --scripts-prepend-node-path=auto
> vfile-location@3.0.1 test-types /Users/muescha/Work/github/muescha/vfile-location
> dtslint types
Error: Errors in typescript@4.0 for external dependencies:
error TS2688: Cannot find type definition file for 'babel__core'.
error TS2688: Cannot find type definition file for 'babel__template'.
at /Users/muescha/Work/github/muescha/vfile-location/node_modules/dtslint/bin/index.js:198:19
at Generator.next (<anonymous>)
at fulfilled (/Users/muescha/Work/github/muescha/vfile-location/node_modules/dtslint/bin/index.js:6:58)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vfile-location@3.0.1 test-types: `dtslint types`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vfile-location@3.0.1 test-types script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/muescha/.npm/_logs/2020-05-20T16_11_59_063Z-debug.log
Process finished with exit code 1
@muescha could you try clearing node_modules
and running npm install
again?
The typings don't use any of babel's types, and with a clean install I don't see that error.
i deleted the dir and checked out again.
then i changed:
-"xo": "^0.27.0"
+"xo": "0.27.0"
but get the same error.
i tested also with npm instead of yarn, and also with node 12.14.0
i have no idea what is different :(
:thinking: the error specifically happens in TypeScript 4, with is the unreleased next major version.
If you clear dtslint's cached typescript installs, usually in ~/.dts/typescript-installs
.
And run npm run test-types
does that resolve the issue?
if i delete the 4.0 then it reinstalls it?
$rm -rf ~/.dts/typescript-installs/4.0/
$yarn test-types
yarn run v1.22.4
$ dtslint types
Installing to /Users/muescha/.dts/typescript-installs/4.0...
Installed!
Error: Errors in typescript@4.0 for external dependencies:
error TS2688: Cannot find type definition file for 'babel__core'.
error TS2688: Cannot find type definition file for 'babel__template'.
at /Users/muescha/Work/github/muescha/vfile-location/node_modules/dtslint/bin/index.js:198:19
at Generator.next (<anonymous>)
at fulfilled (/Users/muescha/Work/github/muescha/vfile-location/node_modules/dtslint/bin/index.js:6:58)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
did you need my yarn.lock?
it looks like dtslint depends on the next:
yarn why typescript
yarn why v1.22.4
[1/4] π€ Why do we have the module "typescript"...?
[2/4] π Initialising dependency graph...
[3/4] π Finding dependency...
[4/4] π‘ Calculating file sizes...
=> Found "typescript@4.0.0-dev.20200520"
info Reasons this module exists
- "dtslint" depends on it
- Hoisted from "dtslint#typescript"
info Disk size without dependencies: "52.65MB"
info Disk size with unique dependencies: "52.65MB"
info Disk size with transitive dependencies: "52.65MB"
info Number of shared dependencies: 0
=> Found "dts-critic#typescript@3.9.3"
info This module exists because "dtslint#dts-critic" depends on it.
info Disk size without dependencies: "52.31MB"
info Disk size with unique dependencies: "52.31MB"
info Disk size with transitive dependencies: "52.31MB"
info Number of shared dependencies: 0
β¨ Done in 0.89s.
from yarn.lock:
dtslint@^3.0.0:
version "3.6.3"
resolved "https://registry.yarnpkg.com/dtslint/-/dtslint-3.6.3.tgz#be93c74fe00f99be6a89bab3b943d733c8c27893"
integrity sha512-7zm45PbN6TQ6N/5gFPKveHt6zybgO+Xq50cviemLLyfbAhkh7I5ZZAE5adn5WjryjN36amkL0vtf1r0+7gWE2w==
dependencies:
"@definitelytyped/header-parser" "0.0.34"
"@definitelytyped/typescript-versions" "0.0.34"
"@definitelytyped/utils" "0.0.34"
dts-critic "^3.2.2"
fs-extra "^6.0.1"
json-stable-stringify "^1.0.1"
strip-json-comments "^2.0.1"
tslint "5.14.0"
typescript next
yargs "^15.1.0"
if i delete the 4.0 then it reinstalls it?
Exactly, it's a cache, dtslint
automatically regenerates it when it's cleared
Error: Errors in typescript@4.0 for external dependencies:
error TS2688: Cannot find type definition file for 'babel__core'.
error TS2688: Cannot find type definition file for 'babel__template'.
One more thing to try, add "skipLibCheck: true,
in tsconfig.json under compilerOptions.
If the issue still persists, it's most likely bug in dtslint or TypeScript, we don't use the babel typings, they shouldn't be checked.
I've mostly been testing with npm, I checked with yarn and didn't see any difference. Attached is the yarn file locked to dependency versions that work on my machine.
I'm running
$ node --version
v14.3.0
$ npm --version
6.14.5
$ yarn --version
1.22.4
this is my setup:
$node --version
v12.14.0
$npm --version
6.13.4
$yarn --version
1.22.4
i will upgrade node via nvm and then npm too
and i check if your lockfile works better
PS: i will continue it tomorrow :)
i get this error while using:
full log:
Full Logfile
```shell [17:21:48] muescha:~/Work/github/muescha/vfile-location $ nvm use 13.7.0 Now using node v13.7.0 (npm v6.13.6) [17:22:10] muescha:~/Work/github/muescha/vfile-location $ node --version v13.7.0 [17:22:13] muescha:~/Work/github/muescha/vfile-location $ yarn yarn install v1.22.4 info No lockfile found. [1/4] π Resolving packages... warning dtslint > @definitelytyped/utils > npm-registry-client > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 warning xo > globby > fast-glob > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated warning xo > globby > fast-glob > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated [2/4] π Fetching packages... [3/4] π Linking dependencies... [4/4] π¨ Building fresh packages... success Saved lockfile. β¨ Done in 57.64s. [17:23:15] muescha:~/Work/github/muescha/vfile-location $ yarn test yarn run v1.22.4 $ npm run format && npm run build && npm run test-coverage && npm run test-types npm WARN lifecycle The node binary used for scripts is /var/folders/0j/6_kmjc_51bv7nn26xx2dvrdm0000gn/T/yarn--1589988229732-0.8324450352172217/node but npm is using /Users/muescha/.nvm/versions/node/v13.7.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with. > vfile-location@3.0.1 format /Users/muescha/Work/github/muescha/vfile-location > remark . -qfo && prettier --write "**/*.{js,ts}" && xo --fix index.js 101ms test.js 45ms types/index.d.ts 276ms types/vfile-location-tests.ts 26ms Error: Error while loading rule '@typescript-eslint/await-thenable': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser. Occurred while linting /Users/muescha/Work/github/muescha/vfile-location/types/vfile-location-tests.ts at Object.getParserServices (/Users/muescha/Work/github/muescha/vfile-location/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/getParserServices.js:15:15) at create (/Users/muescha/Work/github/muescha/vfile-location/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js:30:37) at Object.create (/Users/muescha/Work/github/muescha/vfile-location/node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.js:12:24) at createRuleListeners (/Users/muescha/Work/github/muescha/vfile-location/node_modules/eslint/lib/linter/linter.js:746:21) at /Users/muescha/Work/github/muescha/vfile-location/node_modules/eslint/lib/linter/linter.js:916:31 at Array.forEach (