ember-eslint-parser 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/parser/ts-patch.js +12 -5
package/package.json
CHANGED
package/src/parser/ts-patch.js
CHANGED
|
@@ -23,15 +23,19 @@ try {
|
|
|
23
23
|
];
|
|
24
24
|
},
|
|
25
25
|
fileExists(fileName) {
|
|
26
|
-
return fs.existsSync(fileName.replace(/\.
|
|
26
|
+
return fs.existsSync(fileName.replace(/\.m?ts$/, '.gts')) || fs.existsSync(fileName);
|
|
27
27
|
},
|
|
28
28
|
readFile(fname) {
|
|
29
29
|
let fileName = fname;
|
|
30
30
|
let content = '';
|
|
31
|
+
if (fileName.endsWith('tsconfig.tsbuildinfo')) {
|
|
32
|
+
return content;
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
try {
|
|
32
36
|
content = fs.readFileSync(fileName).toString();
|
|
33
37
|
} catch {
|
|
34
|
-
fileName = fileName.replace(/\.
|
|
38
|
+
fileName = fileName.replace(/\.m?ts$/, '.gts');
|
|
35
39
|
content = fs.readFileSync(fileName).toString();
|
|
36
40
|
}
|
|
37
41
|
if (fileName.endsWith('.gts')) {
|
|
@@ -83,8 +87,8 @@ try {
|
|
|
83
87
|
const sourceFiles = program.getSourceFiles();
|
|
84
88
|
for (const sourceFile of sourceFiles) {
|
|
85
89
|
// check for deleted gts files, need to remove mts as well
|
|
86
|
-
if (sourceFile.path.
|
|
87
|
-
const gtsFile = program.getSourceFile(sourceFile.path.replace(/\.
|
|
90
|
+
if (sourceFile.path.match(/\.m?ts$/) && sourceFile.isVirtualGts) {
|
|
91
|
+
const gtsFile = program.getSourceFile(sourceFile.path.replace(/\.m?ts$/, '.gts'));
|
|
88
92
|
if (!gtsFile) {
|
|
89
93
|
sourceFile.version = null;
|
|
90
94
|
}
|
|
@@ -93,7 +97,10 @@ try {
|
|
|
93
97
|
/**
|
|
94
98
|
* @type {ts.SourceFile}
|
|
95
99
|
*/
|
|
96
|
-
|
|
100
|
+
let mtsSourceFile = program.getSourceFile(sourceFile.path.replace(/\.gts$/, '.mts'));
|
|
101
|
+
if (!mtsSourceFile) {
|
|
102
|
+
mtsSourceFile = program.getSourceFile(sourceFile.path.replace(/\.gts$/, '.ts'));
|
|
103
|
+
}
|
|
97
104
|
if (mtsSourceFile) {
|
|
98
105
|
const keep = {
|
|
99
106
|
fileName: mtsSourceFile.fileName,
|