Skip to content

Commit b3366d7

Browse files
committed
Add missing index.ts files to user projects
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.
1 parent 8683b8a commit b3366d7

File tree

41 files changed

+242
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+242
-77
lines changed

src/compiler/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3355,7 +3355,7 @@ namespace ts {
33553355
type = finishNode(factory.createJSDocNonNullableType(type), pos);
33563356
break;
33573357
case SyntaxKind.QuestionToken:
3358-
// If not in JSDoc and next token is start of a type we have a conditional type
3358+
// If next token is start of a type we have a conditional type
33593359
if (lookAhead(nextTokenIsStartOfType)) {
33603360
return type;
33613361
}

tests/cases/user/acorn/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import x = require('acorn');

tests/cases/user/acorn/tsconfig.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@
77
"noEmit": true,
88
"allowJs": true,
99
"checkJs": true,
10-
"types": ["node"],
11-
"lib": ["esnext", "dom"],
10+
"types": [
11+
"node"
12+
],
13+
"lib": [
14+
"esnext",
15+
"dom"
16+
]
1217
},
13-
"include": ["node_modules/acorn"]
14-
}
18+
"include": [
19+
"node_modules/acorn",
20+
"index.ts"
21+
]
22+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import x = require('adonis-framework/src/View');

tests/cases/user/adonis-framework/tsconfig.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@
77
"noEmit": true,
88
"allowJs": true,
99
"checkJs": true,
10-
"types": ["node"],
11-
"lib": ["esnext", "dom"],
10+
"types": [
11+
"node"
12+
],
13+
"lib": [
14+
"esnext",
15+
"dom"
16+
]
1217
},
13-
"include": ["node_modules/adonis-framework"]
14-
}
18+
"include": [
19+
"node_modules/adonis-framework",
20+
"index.ts"
21+
]
22+
}

tests/cases/user/assert/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import x = require('assert');

tests/cases/user/assert/tsconfig.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@
77
"noEmit": true,
88
"allowJs": true,
99
"checkJs": true,
10-
"types": ["node"],
11-
"lib": ["esnext", "dom"],
10+
"types": [
11+
"node"
12+
],
13+
"lib": [
14+
"esnext",
15+
"dom"
16+
]
1217
},
13-
"include": ["node_modules/assert"]
14-
}
18+
"include": [
19+
"node_modules/assert",
20+
"index.ts"
21+
]
22+
}

tests/cases/user/async/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import async_ = require('async');

tests/cases/user/async/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"types": ["node"],
1111
"lib": ["esnext", "dom"],
1212
},
13-
"include": ["node_modules/async"]
13+
"include": ["index.ts", "node_modules/async"]
1414
}

tests/cases/user/bcryptjs/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import x = require('bcryptjs');

0 commit comments

Comments
 (0)