mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
Fix file matching with tsx and dts of same name are included by include patterns (#55690)
This commit is contained in:
parent
3bc41784f0
commit
3ade5022d7
@ -3849,7 +3849,10 @@ function hasFileWithHigherPriorityExtension(file: string, literalFiles: Map<stri
|
||||
return false;
|
||||
}
|
||||
for (const ext of extensionGroup) {
|
||||
if (fileExtensionIs(file, ext)) {
|
||||
// d.ts files match with .ts extension and with case sensitive sorting the file order for same files with ts tsx and dts extension is
|
||||
// d.ts, .ts, .tsx in that order so we need to handle tsx and dts of same same name case here and in remove files with same extensions
|
||||
// So dont match .d.ts files with .ts extension
|
||||
if (fileExtensionIs(file, ext) && (ext !== Extension.Ts || !fileExtensionIs(file, Extension.Dts))) {
|
||||
return false;
|
||||
}
|
||||
const higherPriorityPath = keyMapper(changeExtension(file, ext));
|
||||
|
||||
@ -141,6 +141,26 @@ const caseSensitiveOrderingDiffersWithCaseHost = new fakes.ParseConfigHost(
|
||||
}),
|
||||
);
|
||||
|
||||
const caseInsensitiveHostWithSameFileNamesWithDifferentExtensions = new fakes.ParseConfigHost(
|
||||
new vfs.FileSystem(/*ignoreCase*/ true, {
|
||||
cwd: caseInsensitiveBasePath,
|
||||
files: {
|
||||
"c:/dev/a.tsx": "",
|
||||
"c:/dev/a.d.ts": "",
|
||||
"c:/dev/b.tsx": "",
|
||||
"c:/dev/b.ts": "",
|
||||
"c:/dev/c.tsx": "",
|
||||
"c:/dev/m.ts": "",
|
||||
"c:/dev/m.d.ts": "",
|
||||
"c:/dev/n.tsx": "",
|
||||
"c:/dev/n.ts": "",
|
||||
"c:/dev/n.d.ts": "",
|
||||
"c:/dev/o.ts": "",
|
||||
"c:/dev/x.d.ts": "",
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
function baselineMatches(subScenario: string, json: any, host: fakes.ParseConfigHost, basePath: string) {
|
||||
const jsonText = JSON.stringify(json, undefined, " ");
|
||||
baselineParseConfig({
|
||||
@ -839,6 +859,51 @@ describe("unittests:: config:: matchFiles", () => {
|
||||
caseInsensitiveBasePath,
|
||||
);
|
||||
});
|
||||
|
||||
describe("sameNamedDeclarations", () => {
|
||||
baselineMatches(
|
||||
"same named declarations with include ts",
|
||||
{ include: ["*.ts"] },
|
||||
caseInsensitiveHostWithSameFileNamesWithDifferentExtensions,
|
||||
caseInsensitiveBasePath,
|
||||
);
|
||||
baselineMatches(
|
||||
"same named declarations with include ts dts",
|
||||
{ include: ["*.ts", "*.d.ts"] },
|
||||
caseInsensitiveHostWithSameFileNamesWithDifferentExtensions,
|
||||
caseInsensitiveBasePath,
|
||||
);
|
||||
baselineMatches(
|
||||
"same named declarations with include tsx",
|
||||
{ include: ["*.tsx"] },
|
||||
caseInsensitiveHostWithSameFileNamesWithDifferentExtensions,
|
||||
caseInsensitiveBasePath,
|
||||
);
|
||||
baselineMatches(
|
||||
"same named declarations with include tsx ts",
|
||||
{ include: ["*.tsx", "*.ts"] },
|
||||
caseInsensitiveHostWithSameFileNamesWithDifferentExtensions,
|
||||
caseInsensitiveBasePath,
|
||||
);
|
||||
baselineMatches(
|
||||
"same named declarations with include ts tsx",
|
||||
{ include: ["*.tsx", "*.ts"] },
|
||||
caseInsensitiveHostWithSameFileNamesWithDifferentExtensions,
|
||||
caseInsensitiveBasePath,
|
||||
);
|
||||
baselineMatches(
|
||||
"same named declarations with include tsx dts",
|
||||
{ include: ["*.tsx", "*.d.ts"] },
|
||||
caseInsensitiveHostWithSameFileNamesWithDifferentExtensions,
|
||||
caseInsensitiveBasePath,
|
||||
);
|
||||
baselineMatches(
|
||||
"same named declarations with include dts tsx",
|
||||
{ include: ["*.tsx", "*.d.ts"] },
|
||||
caseInsensitiveHostWithSameFileNamesWithDifferentExtensions,
|
||||
caseInsensitiveBasePath,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("with files or folders that begin with a .", () => {
|
||||
|
||||
@ -1,11 +1,15 @@
|
||||
import {
|
||||
noop,
|
||||
} from "../../_namespaces/ts";
|
||||
import {
|
||||
noChangeRun,
|
||||
verifyTsc,
|
||||
} from "../helpers/tsc";
|
||||
import {
|
||||
loadProjectFromFiles,
|
||||
} from "../helpers/vfs";
|
||||
|
||||
describe("unittests:: tsbuild - clean", () => {
|
||||
describe("unittests:: tsbuild - clean::", () => {
|
||||
verifyTsc({
|
||||
scenario: "clean",
|
||||
subScenario: `file name and output name clashing`,
|
||||
@ -19,4 +23,26 @@ describe("unittests:: tsbuild - clean", () => {
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
verifyTsc({
|
||||
scenario: "clean",
|
||||
subScenario: "tsx with dts emit",
|
||||
fs: () =>
|
||||
loadProjectFromFiles({
|
||||
"/src/project/src/main.tsx": "export const x = 10;",
|
||||
"/src/project/tsconfig.json": JSON.stringify({
|
||||
compilerOptions: { declaration: true },
|
||||
include: ["src/**/*.tsx", "src/**/*.ts"],
|
||||
}),
|
||||
}),
|
||||
commandLineArgs: ["--b", "src/project", "-v", "--explainFiles"],
|
||||
edits: [
|
||||
noChangeRun,
|
||||
{
|
||||
caption: "clean build",
|
||||
edit: noop,
|
||||
commandLineArgs: ["-b", "/src/project", "--clean"],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
@ -0,0 +1,78 @@
|
||||
config:
|
||||
{
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.d.ts"
|
||||
]
|
||||
}
|
||||
Fs::
|
||||
//// [c:/dev/a.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/a.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/b.ts]
|
||||
|
||||
|
||||
//// [c:/dev/b.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/c.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/m.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/m.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/o.ts]
|
||||
|
||||
|
||||
//// [c:/dev/x.d.ts]
|
||||
|
||||
|
||||
|
||||
configFileName:: c:/dev/tsconfig.json
|
||||
Result
|
||||
{
|
||||
"options": {
|
||||
"configFilePath": "c:/dev/tsconfig.json"
|
||||
},
|
||||
"fileNames": [
|
||||
"c:/dev/a.tsx",
|
||||
"c:/dev/b.tsx",
|
||||
"c:/dev/c.tsx",
|
||||
"c:/dev/n.tsx",
|
||||
"c:/dev/m.d.ts",
|
||||
"c:/dev/x.d.ts"
|
||||
],
|
||||
"typeAcquisition": {
|
||||
"enable": false,
|
||||
"include": [],
|
||||
"exclude": []
|
||||
},
|
||||
"raw": {
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.d.ts"
|
||||
],
|
||||
"compileOnSave": false
|
||||
},
|
||||
"wildcardDirectories": {
|
||||
"c:/dev": "WatchDirectoryFlags.None"
|
||||
},
|
||||
"compileOnSave": false
|
||||
}
|
||||
Errors::
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
config:
|
||||
{
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.d.ts"
|
||||
]
|
||||
}
|
||||
Fs::
|
||||
//// [c:/dev/a.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/a.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/b.ts]
|
||||
|
||||
|
||||
//// [c:/dev/b.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/c.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/m.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/m.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/o.ts]
|
||||
|
||||
|
||||
//// [c:/dev/x.d.ts]
|
||||
|
||||
|
||||
|
||||
configFileName:: c:/dev/tsconfig.json
|
||||
Result
|
||||
{
|
||||
"options": {
|
||||
"configFilePath": "c:/dev/tsconfig.json"
|
||||
},
|
||||
"fileNames": [
|
||||
"c:/dev/a.tsx",
|
||||
"c:/dev/b.tsx",
|
||||
"c:/dev/c.tsx",
|
||||
"c:/dev/n.tsx",
|
||||
"c:/dev/m.d.ts",
|
||||
"c:/dev/x.d.ts"
|
||||
],
|
||||
"typeAcquisition": {
|
||||
"enable": false,
|
||||
"include": [],
|
||||
"exclude": []
|
||||
},
|
||||
"raw": {
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.d.ts"
|
||||
]
|
||||
},
|
||||
"wildcardDirectories": {
|
||||
"c:/dev": "WatchDirectoryFlags.None"
|
||||
},
|
||||
"compileOnSave": false
|
||||
}
|
||||
Errors::
|
||||
|
||||
@ -0,0 +1,78 @@
|
||||
config:
|
||||
{
|
||||
"include": [
|
||||
"*.ts",
|
||||
"*.d.ts"
|
||||
]
|
||||
}
|
||||
Fs::
|
||||
//// [c:/dev/a.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/a.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/b.ts]
|
||||
|
||||
|
||||
//// [c:/dev/b.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/c.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/m.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/m.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/o.ts]
|
||||
|
||||
|
||||
//// [c:/dev/x.d.ts]
|
||||
|
||||
|
||||
|
||||
configFileName:: c:/dev/tsconfig.json
|
||||
Result
|
||||
{
|
||||
"options": {
|
||||
"configFilePath": "c:/dev/tsconfig.json"
|
||||
},
|
||||
"fileNames": [
|
||||
"c:/dev/a.d.ts",
|
||||
"c:/dev/b.ts",
|
||||
"c:/dev/m.ts",
|
||||
"c:/dev/n.ts",
|
||||
"c:/dev/o.ts",
|
||||
"c:/dev/x.d.ts"
|
||||
],
|
||||
"typeAcquisition": {
|
||||
"enable": false,
|
||||
"include": [],
|
||||
"exclude": []
|
||||
},
|
||||
"raw": {
|
||||
"include": [
|
||||
"*.ts",
|
||||
"*.d.ts"
|
||||
],
|
||||
"compileOnSave": false
|
||||
},
|
||||
"wildcardDirectories": {
|
||||
"c:/dev": "WatchDirectoryFlags.None"
|
||||
},
|
||||
"compileOnSave": false
|
||||
}
|
||||
Errors::
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
config:
|
||||
{
|
||||
"include": [
|
||||
"*.ts",
|
||||
"*.d.ts"
|
||||
]
|
||||
}
|
||||
Fs::
|
||||
//// [c:/dev/a.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/a.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/b.ts]
|
||||
|
||||
|
||||
//// [c:/dev/b.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/c.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/m.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/m.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/o.ts]
|
||||
|
||||
|
||||
//// [c:/dev/x.d.ts]
|
||||
|
||||
|
||||
|
||||
configFileName:: c:/dev/tsconfig.json
|
||||
Result
|
||||
{
|
||||
"options": {
|
||||
"configFilePath": "c:/dev/tsconfig.json"
|
||||
},
|
||||
"fileNames": [
|
||||
"c:/dev/a.d.ts",
|
||||
"c:/dev/b.ts",
|
||||
"c:/dev/m.ts",
|
||||
"c:/dev/n.ts",
|
||||
"c:/dev/o.ts",
|
||||
"c:/dev/x.d.ts"
|
||||
],
|
||||
"typeAcquisition": {
|
||||
"enable": false,
|
||||
"include": [],
|
||||
"exclude": []
|
||||
},
|
||||
"raw": {
|
||||
"include": [
|
||||
"*.ts",
|
||||
"*.d.ts"
|
||||
]
|
||||
},
|
||||
"wildcardDirectories": {
|
||||
"c:/dev": "WatchDirectoryFlags.None"
|
||||
},
|
||||
"compileOnSave": false
|
||||
}
|
||||
Errors::
|
||||
|
||||
@ -0,0 +1,79 @@
|
||||
config:
|
||||
{
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.ts"
|
||||
]
|
||||
}
|
||||
Fs::
|
||||
//// [c:/dev/a.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/a.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/b.ts]
|
||||
|
||||
|
||||
//// [c:/dev/b.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/c.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/m.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/m.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/o.ts]
|
||||
|
||||
|
||||
//// [c:/dev/x.d.ts]
|
||||
|
||||
|
||||
|
||||
configFileName:: c:/dev/tsconfig.json
|
||||
Result
|
||||
{
|
||||
"options": {
|
||||
"configFilePath": "c:/dev/tsconfig.json"
|
||||
},
|
||||
"fileNames": [
|
||||
"c:/dev/a.tsx",
|
||||
"c:/dev/c.tsx",
|
||||
"c:/dev/b.ts",
|
||||
"c:/dev/m.ts",
|
||||
"c:/dev/n.ts",
|
||||
"c:/dev/o.ts",
|
||||
"c:/dev/x.d.ts"
|
||||
],
|
||||
"typeAcquisition": {
|
||||
"enable": false,
|
||||
"include": [],
|
||||
"exclude": []
|
||||
},
|
||||
"raw": {
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.ts"
|
||||
],
|
||||
"compileOnSave": false
|
||||
},
|
||||
"wildcardDirectories": {
|
||||
"c:/dev": "WatchDirectoryFlags.None"
|
||||
},
|
||||
"compileOnSave": false
|
||||
}
|
||||
Errors::
|
||||
|
||||
@ -0,0 +1,78 @@
|
||||
config:
|
||||
{
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.ts"
|
||||
]
|
||||
}
|
||||
Fs::
|
||||
//// [c:/dev/a.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/a.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/b.ts]
|
||||
|
||||
|
||||
//// [c:/dev/b.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/c.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/m.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/m.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/o.ts]
|
||||
|
||||
|
||||
//// [c:/dev/x.d.ts]
|
||||
|
||||
|
||||
|
||||
configFileName:: c:/dev/tsconfig.json
|
||||
Result
|
||||
{
|
||||
"options": {
|
||||
"configFilePath": "c:/dev/tsconfig.json"
|
||||
},
|
||||
"fileNames": [
|
||||
"c:/dev/a.tsx",
|
||||
"c:/dev/c.tsx",
|
||||
"c:/dev/b.ts",
|
||||
"c:/dev/m.ts",
|
||||
"c:/dev/n.ts",
|
||||
"c:/dev/o.ts",
|
||||
"c:/dev/x.d.ts"
|
||||
],
|
||||
"typeAcquisition": {
|
||||
"enable": false,
|
||||
"include": [],
|
||||
"exclude": []
|
||||
},
|
||||
"raw": {
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.ts"
|
||||
]
|
||||
},
|
||||
"wildcardDirectories": {
|
||||
"c:/dev": "WatchDirectoryFlags.None"
|
||||
},
|
||||
"compileOnSave": false
|
||||
}
|
||||
Errors::
|
||||
|
||||
@ -0,0 +1,76 @@
|
||||
config:
|
||||
{
|
||||
"include": [
|
||||
"*.ts"
|
||||
]
|
||||
}
|
||||
Fs::
|
||||
//// [c:/dev/a.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/a.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/b.ts]
|
||||
|
||||
|
||||
//// [c:/dev/b.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/c.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/m.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/m.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/o.ts]
|
||||
|
||||
|
||||
//// [c:/dev/x.d.ts]
|
||||
|
||||
|
||||
|
||||
configFileName:: c:/dev/tsconfig.json
|
||||
Result
|
||||
{
|
||||
"options": {
|
||||
"configFilePath": "c:/dev/tsconfig.json"
|
||||
},
|
||||
"fileNames": [
|
||||
"c:/dev/a.d.ts",
|
||||
"c:/dev/b.ts",
|
||||
"c:/dev/m.ts",
|
||||
"c:/dev/n.ts",
|
||||
"c:/dev/o.ts",
|
||||
"c:/dev/x.d.ts"
|
||||
],
|
||||
"typeAcquisition": {
|
||||
"enable": false,
|
||||
"include": [],
|
||||
"exclude": []
|
||||
},
|
||||
"raw": {
|
||||
"include": [
|
||||
"*.ts"
|
||||
],
|
||||
"compileOnSave": false
|
||||
},
|
||||
"wildcardDirectories": {
|
||||
"c:/dev": "WatchDirectoryFlags.None"
|
||||
},
|
||||
"compileOnSave": false
|
||||
}
|
||||
Errors::
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
config:
|
||||
{
|
||||
"include": [
|
||||
"*.ts"
|
||||
]
|
||||
}
|
||||
Fs::
|
||||
//// [c:/dev/a.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/a.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/b.ts]
|
||||
|
||||
|
||||
//// [c:/dev/b.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/c.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/m.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/m.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/o.ts]
|
||||
|
||||
|
||||
//// [c:/dev/x.d.ts]
|
||||
|
||||
|
||||
|
||||
configFileName:: c:/dev/tsconfig.json
|
||||
Result
|
||||
{
|
||||
"options": {
|
||||
"configFilePath": "c:/dev/tsconfig.json"
|
||||
},
|
||||
"fileNames": [
|
||||
"c:/dev/a.d.ts",
|
||||
"c:/dev/b.ts",
|
||||
"c:/dev/m.ts",
|
||||
"c:/dev/n.ts",
|
||||
"c:/dev/o.ts",
|
||||
"c:/dev/x.d.ts"
|
||||
],
|
||||
"typeAcquisition": {
|
||||
"enable": false,
|
||||
"include": [],
|
||||
"exclude": []
|
||||
},
|
||||
"raw": {
|
||||
"include": [
|
||||
"*.ts"
|
||||
]
|
||||
},
|
||||
"wildcardDirectories": {
|
||||
"c:/dev": "WatchDirectoryFlags.None"
|
||||
},
|
||||
"compileOnSave": false
|
||||
}
|
||||
Errors::
|
||||
|
||||
@ -0,0 +1,78 @@
|
||||
config:
|
||||
{
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.d.ts"
|
||||
]
|
||||
}
|
||||
Fs::
|
||||
//// [c:/dev/a.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/a.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/b.ts]
|
||||
|
||||
|
||||
//// [c:/dev/b.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/c.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/m.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/m.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/o.ts]
|
||||
|
||||
|
||||
//// [c:/dev/x.d.ts]
|
||||
|
||||
|
||||
|
||||
configFileName:: c:/dev/tsconfig.json
|
||||
Result
|
||||
{
|
||||
"options": {
|
||||
"configFilePath": "c:/dev/tsconfig.json"
|
||||
},
|
||||
"fileNames": [
|
||||
"c:/dev/a.tsx",
|
||||
"c:/dev/b.tsx",
|
||||
"c:/dev/c.tsx",
|
||||
"c:/dev/n.tsx",
|
||||
"c:/dev/m.d.ts",
|
||||
"c:/dev/x.d.ts"
|
||||
],
|
||||
"typeAcquisition": {
|
||||
"enable": false,
|
||||
"include": [],
|
||||
"exclude": []
|
||||
},
|
||||
"raw": {
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.d.ts"
|
||||
],
|
||||
"compileOnSave": false
|
||||
},
|
||||
"wildcardDirectories": {
|
||||
"c:/dev": "WatchDirectoryFlags.None"
|
||||
},
|
||||
"compileOnSave": false
|
||||
}
|
||||
Errors::
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
config:
|
||||
{
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.d.ts"
|
||||
]
|
||||
}
|
||||
Fs::
|
||||
//// [c:/dev/a.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/a.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/b.ts]
|
||||
|
||||
|
||||
//// [c:/dev/b.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/c.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/m.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/m.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/o.ts]
|
||||
|
||||
|
||||
//// [c:/dev/x.d.ts]
|
||||
|
||||
|
||||
|
||||
configFileName:: c:/dev/tsconfig.json
|
||||
Result
|
||||
{
|
||||
"options": {
|
||||
"configFilePath": "c:/dev/tsconfig.json"
|
||||
},
|
||||
"fileNames": [
|
||||
"c:/dev/a.tsx",
|
||||
"c:/dev/b.tsx",
|
||||
"c:/dev/c.tsx",
|
||||
"c:/dev/n.tsx",
|
||||
"c:/dev/m.d.ts",
|
||||
"c:/dev/x.d.ts"
|
||||
],
|
||||
"typeAcquisition": {
|
||||
"enable": false,
|
||||
"include": [],
|
||||
"exclude": []
|
||||
},
|
||||
"raw": {
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.d.ts"
|
||||
]
|
||||
},
|
||||
"wildcardDirectories": {
|
||||
"c:/dev": "WatchDirectoryFlags.None"
|
||||
},
|
||||
"compileOnSave": false
|
||||
}
|
||||
Errors::
|
||||
|
||||
@ -0,0 +1,79 @@
|
||||
config:
|
||||
{
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.ts"
|
||||
]
|
||||
}
|
||||
Fs::
|
||||
//// [c:/dev/a.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/a.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/b.ts]
|
||||
|
||||
|
||||
//// [c:/dev/b.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/c.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/m.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/m.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/o.ts]
|
||||
|
||||
|
||||
//// [c:/dev/x.d.ts]
|
||||
|
||||
|
||||
|
||||
configFileName:: c:/dev/tsconfig.json
|
||||
Result
|
||||
{
|
||||
"options": {
|
||||
"configFilePath": "c:/dev/tsconfig.json"
|
||||
},
|
||||
"fileNames": [
|
||||
"c:/dev/a.tsx",
|
||||
"c:/dev/c.tsx",
|
||||
"c:/dev/b.ts",
|
||||
"c:/dev/m.ts",
|
||||
"c:/dev/n.ts",
|
||||
"c:/dev/o.ts",
|
||||
"c:/dev/x.d.ts"
|
||||
],
|
||||
"typeAcquisition": {
|
||||
"enable": false,
|
||||
"include": [],
|
||||
"exclude": []
|
||||
},
|
||||
"raw": {
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.ts"
|
||||
],
|
||||
"compileOnSave": false
|
||||
},
|
||||
"wildcardDirectories": {
|
||||
"c:/dev": "WatchDirectoryFlags.None"
|
||||
},
|
||||
"compileOnSave": false
|
||||
}
|
||||
Errors::
|
||||
|
||||
@ -0,0 +1,78 @@
|
||||
config:
|
||||
{
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.ts"
|
||||
]
|
||||
}
|
||||
Fs::
|
||||
//// [c:/dev/a.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/a.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/b.ts]
|
||||
|
||||
|
||||
//// [c:/dev/b.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/c.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/m.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/m.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/o.ts]
|
||||
|
||||
|
||||
//// [c:/dev/x.d.ts]
|
||||
|
||||
|
||||
|
||||
configFileName:: c:/dev/tsconfig.json
|
||||
Result
|
||||
{
|
||||
"options": {
|
||||
"configFilePath": "c:/dev/tsconfig.json"
|
||||
},
|
||||
"fileNames": [
|
||||
"c:/dev/a.tsx",
|
||||
"c:/dev/c.tsx",
|
||||
"c:/dev/b.ts",
|
||||
"c:/dev/m.ts",
|
||||
"c:/dev/n.ts",
|
||||
"c:/dev/o.ts",
|
||||
"c:/dev/x.d.ts"
|
||||
],
|
||||
"typeAcquisition": {
|
||||
"enable": false,
|
||||
"include": [],
|
||||
"exclude": []
|
||||
},
|
||||
"raw": {
|
||||
"include": [
|
||||
"*.tsx",
|
||||
"*.ts"
|
||||
]
|
||||
},
|
||||
"wildcardDirectories": {
|
||||
"c:/dev": "WatchDirectoryFlags.None"
|
||||
},
|
||||
"compileOnSave": false
|
||||
}
|
||||
Errors::
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
config:
|
||||
{
|
||||
"include": [
|
||||
"*.tsx"
|
||||
]
|
||||
}
|
||||
Fs::
|
||||
//// [c:/dev/a.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/a.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/b.ts]
|
||||
|
||||
|
||||
//// [c:/dev/b.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/c.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/m.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/m.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/o.ts]
|
||||
|
||||
|
||||
//// [c:/dev/x.d.ts]
|
||||
|
||||
|
||||
|
||||
configFileName:: c:/dev/tsconfig.json
|
||||
Result
|
||||
{
|
||||
"options": {
|
||||
"configFilePath": "c:/dev/tsconfig.json"
|
||||
},
|
||||
"fileNames": [
|
||||
"c:/dev/a.tsx",
|
||||
"c:/dev/b.tsx",
|
||||
"c:/dev/c.tsx",
|
||||
"c:/dev/n.tsx"
|
||||
],
|
||||
"typeAcquisition": {
|
||||
"enable": false,
|
||||
"include": [],
|
||||
"exclude": []
|
||||
},
|
||||
"raw": {
|
||||
"include": [
|
||||
"*.tsx"
|
||||
],
|
||||
"compileOnSave": false
|
||||
},
|
||||
"wildcardDirectories": {
|
||||
"c:/dev": "WatchDirectoryFlags.None"
|
||||
},
|
||||
"compileOnSave": false
|
||||
}
|
||||
Errors::
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
config:
|
||||
{
|
||||
"include": [
|
||||
"*.tsx"
|
||||
]
|
||||
}
|
||||
Fs::
|
||||
//// [c:/dev/a.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/a.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/b.ts]
|
||||
|
||||
|
||||
//// [c:/dev/b.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/c.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/m.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/m.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.d.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.ts]
|
||||
|
||||
|
||||
//// [c:/dev/n.tsx]
|
||||
|
||||
|
||||
//// [c:/dev/o.ts]
|
||||
|
||||
|
||||
//// [c:/dev/x.d.ts]
|
||||
|
||||
|
||||
|
||||
configFileName:: c:/dev/tsconfig.json
|
||||
Result
|
||||
{
|
||||
"options": {
|
||||
"configFilePath": "c:/dev/tsconfig.json"
|
||||
},
|
||||
"fileNames": [
|
||||
"c:/dev/a.tsx",
|
||||
"c:/dev/b.tsx",
|
||||
"c:/dev/c.tsx",
|
||||
"c:/dev/n.tsx"
|
||||
],
|
||||
"typeAcquisition": {
|
||||
"enable": false,
|
||||
"include": [],
|
||||
"exclude": []
|
||||
},
|
||||
"raw": {
|
||||
"include": [
|
||||
"*.tsx"
|
||||
]
|
||||
},
|
||||
"wildcardDirectories": {
|
||||
"c:/dev": "WatchDirectoryFlags.None"
|
||||
},
|
||||
"compileOnSave": false
|
||||
}
|
||||
Errors::
|
||||
|
||||
81
tests/baselines/reference/tsbuild/clean/tsx-with-dts-emit.js
Normal file
81
tests/baselines/reference/tsbuild/clean/tsx-with-dts-emit.js
Normal file
@ -0,0 +1,81 @@
|
||||
currentDirectory:: / useCaseSensitiveFileNames: false
|
||||
Input::
|
||||
//// [/lib/lib.d.ts]
|
||||
/// <reference no-default-lib="true"/>
|
||||
interface Boolean {}
|
||||
interface Function {}
|
||||
interface CallableFunction {}
|
||||
interface NewableFunction {}
|
||||
interface IArguments {}
|
||||
interface Number { toExponential: any; }
|
||||
interface Object {}
|
||||
interface RegExp {}
|
||||
interface String { charAt: any; }
|
||||
interface Array<T> { length: number; [n: number]: T; }
|
||||
interface ReadonlyArray<T> {}
|
||||
declare const console: { log(msg: any): void; };
|
||||
|
||||
//// [/src/project/src/main.tsx]
|
||||
export const x = 10;
|
||||
|
||||
//// [/src/project/tsconfig.json]
|
||||
{"compilerOptions":{"declaration":true},"include":["src/**/*.tsx","src/**/*.ts"]}
|
||||
|
||||
|
||||
|
||||
Output::
|
||||
/lib/tsc --b src/project -v --explainFiles
|
||||
[[90m12:00:10 AM[0m] Projects in this build:
|
||||
* src/project/tsconfig.json
|
||||
|
||||
[[90m12:00:11 AM[0m] Project 'src/project/tsconfig.json' is out of date because output file 'src/project/src/main.js' does not exist
|
||||
|
||||
[[90m12:00:12 AM[0m] Building project '/src/project/tsconfig.json'...
|
||||
|
||||
lib/lib.d.ts
|
||||
Default library for target 'es5'
|
||||
src/project/src/main.tsx
|
||||
Matched by include pattern 'src/**/*.tsx' in 'src/project/tsconfig.json'
|
||||
exitCode:: ExitStatus.Success
|
||||
|
||||
|
||||
//// [/src/project/src/main.d.ts]
|
||||
export declare const x = 10;
|
||||
|
||||
|
||||
//// [/src/project/src/main.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.x = void 0;
|
||||
exports.x = 10;
|
||||
|
||||
|
||||
|
||||
|
||||
Change:: no-change-run
|
||||
Input::
|
||||
|
||||
|
||||
Output::
|
||||
/lib/tsc --b src/project -v --explainFiles
|
||||
[[90m12:00:15 AM[0m] Projects in this build:
|
||||
* src/project/tsconfig.json
|
||||
|
||||
[[90m12:00:16 AM[0m] Project 'src/project/tsconfig.json' is up to date because newest input 'src/project/src/main.tsx' is older than output 'src/project/src/main.js'
|
||||
|
||||
exitCode:: ExitStatus.Success
|
||||
|
||||
|
||||
|
||||
|
||||
Change:: clean build
|
||||
Input::
|
||||
|
||||
|
||||
Output::
|
||||
/lib/tsc -b /src/project --clean
|
||||
exitCode:: ExitStatus.Success
|
||||
|
||||
|
||||
//// [/src/project/src/main.d.ts] unlink
|
||||
//// [/src/project/src/main.js] unlink
|
||||
Loading…
x
Reference in New Issue
Block a user