Add missing index.ts files to user projects (#39163)
This makes the language service treat .js files inside node_modules as part of the parent project, so that you can view the same errors in the editor as you see in the baselines. Also update a comment in the parser that I missed in an earlier PR.
This commit is contained in:
parent
2f793892f1
commit
acac035aed
|
@ -3527,7 +3527,7 @@ namespace ts {
|
|||
type = finishNode(factory.createJSDocNonNullableType(type), pos);
|
||||
break;
|
||||
case SyntaxKind.QuestionToken:
|
||||
// If not in JSDoc and next token is start of a type we have a conditional type
|
||||
// If next token is start of a type we have a conditional type
|
||||
if (lookAhead(nextTokenIsStartOfType)) {
|
||||
return type;
|
||||
}
|
||||
|
|
1
tests/cases/user/acorn/index.ts
Normal file
1
tests/cases/user/acorn/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('acorn');
|
|
@ -7,8 +7,16 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/acorn"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/acorn",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/adonis-framework/index.ts
Normal file
1
tests/cases/user/adonis-framework/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('adonis-framework/src/View');
|
|
@ -7,8 +7,16 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/adonis-framework"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/adonis-framework",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/assert/index.ts
Normal file
1
tests/cases/user/assert/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('assert');
|
|
@ -7,8 +7,16 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/assert"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/assert",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/async/index.ts
Normal file
1
tests/cases/user/async/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import async_ = require('async');
|
|
@ -10,5 +10,5 @@
|
|||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
},
|
||||
"include": ["node_modules/async"]
|
||||
"include": ["index.ts", "node_modules/async"]
|
||||
}
|
||||
|
|
1
tests/cases/user/bcryptjs/index.ts
Normal file
1
tests/cases/user/bcryptjs/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('bcryptjs');
|
|
@ -7,12 +7,18 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"node_modules/bcryptjs/scripts",
|
||||
"node_modules/bcryptjs/src",
|
||||
"node_modules/bcryptjs/tests"
|
||||
"node_modules/bcryptjs/tests",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
||||
}
|
1
tests/cases/user/bluebird/index.ts
Normal file
1
tests/cases/user/bluebird/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('bluebird');
|
|
@ -7,8 +7,16 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/bluebird/js/release"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/bluebird/js/release",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/clear-require/index.ts
Normal file
1
tests/cases/user/clear-require/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('clear-require');
|
|
@ -7,8 +7,16 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": ["node"]
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
],
|
||||
"types": [
|
||||
"node"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/clear-require"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/clear-require",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/clone/index.ts
Normal file
1
tests/cases/user/clone/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('clone');
|
|
@ -7,8 +7,16 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/clone"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/clone",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/content-disposition/index.ts
Normal file
1
tests/cases/user/content-disposition/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('content-disposition');
|
|
@ -7,8 +7,16 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/content-disposition"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/content-disposition",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/debug/index.ts
Normal file
1
tests/cases/user/debug/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import debug = require('debug');
|
|
@ -10,5 +10,5 @@
|
|||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
},
|
||||
"include": ["node_modules/debug"]
|
||||
"include": ["index.ts", "node_modules/debug"]
|
||||
}
|
||||
|
|
1
tests/cases/user/enhanced-resolve/index.ts
Normal file
1
tests/cases/user/enhanced-resolve/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('enhanced-resolve');
|
|
@ -7,10 +7,18 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
],
|
||||
"module": "CommonJS",
|
||||
"target": "esnext",
|
||||
"target": "esnext"
|
||||
},
|
||||
"include": ["node_modules/enhanced-resolve"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/enhanced-resolve",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/follow-redirects/index.ts
Normal file
1
tests/cases/user/follow-redirects/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('follow-redirects');
|
|
@ -7,8 +7,16 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/follow-redirects"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/follow-redirects",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/graceful-fs/index.ts
Normal file
1
tests/cases/user/graceful-fs/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('graceful-fs');
|
|
@ -7,8 +7,16 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/graceful-fs"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/graceful-fs",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/lodash/index.ts
Normal file
1
tests/cases/user/lodash/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('lodash');
|
|
@ -7,9 +7,19 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/lodash"],
|
||||
"exclude": ["node_modules/lodash/lodash.js"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/lodash",
|
||||
"index.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules/lodash/lodash.js"
|
||||
]
|
||||
}
|
1
tests/cases/user/minimatch/index.ts
Normal file
1
tests/cases/user/minimatch/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('minimatch');
|
|
@ -7,8 +7,16 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/minimatch"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/minimatch",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/npm/index.ts
Normal file
1
tests/cases/user/npm/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('npm');
|
|
@ -7,8 +7,17 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom", "scripthost"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom",
|
||||
"scripthost"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/npm"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/npm",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/npmlog/index.ts
Normal file
1
tests/cases/user/npmlog/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('npmlog');
|
|
@ -7,8 +7,16 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/npmlog"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/npmlog",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/uglify-js/index.ts
Normal file
1
tests/cases/user/uglify-js/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('uglify-js');
|
|
@ -7,8 +7,16 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/uglify-js"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/uglify-js",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/url-search-params/index.ts
Normal file
1
tests/cases/user/url-search-params/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('url-search-params');
|
|
@ -7,8 +7,16 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/url-search-params/build/url-search-params.node.js"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/url-search-params/build/url-search-params.node.js",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
1
tests/cases/user/util/index.ts
Normal file
1
tests/cases/user/util/index.ts
Normal file
|
@ -0,0 +1 @@
|
|||
import x = require('util');
|
|
@ -7,8 +7,16 @@
|
|||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": ["node"],
|
||||
"lib": ["esnext", "dom"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom"
|
||||
]
|
||||
},
|
||||
"include": ["node_modules/util"]
|
||||
}
|
||||
"include": [
|
||||
"node_modules/util",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue