Skip to content

Commit

Permalink
Fix behavior for extensionless files with .mime file (denoland#1779)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkassimo authored and ry committed Feb 15, 2019
1 parent 2241049 commit fe0ceae
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ yarn.lock
node_modules
# editor files
.idea
.vscode
# export dir for gh-pages
/gh-pages
# temp benchmark data
Expand Down
1 change: 1 addition & 0 deletions js/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class Compiler implements ts.LanguageServiceHost, ts.FormatDiagnosticsHost {
// arguments
private readonly _options: ts.CompilerOptions = {
allowJs: true,
allowNonTsExtensions: true,
checkJs: true,
esModuleInterop: true,
module: ts.ModuleKind.ESNext,
Expand Down
5 changes: 3 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,12 @@ export default function makeConfig(commandOptions) {
"createLanguageService",
"formatDiagnostics",
"formatDiagnosticsWithColorAndContext",
"version",
"Extension",
"ModuleKind",
"ScriptKind",
"ScriptSnapshot",
"ScriptTarget",
"version"
"ScriptTarget"
]
}
}),
Expand Down
1 change: 1 addition & 0 deletions tests/023_no_ext_with_mime
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("HELLO");
1 change: 1 addition & 0 deletions tests/023_no_ext_with_mime.mime
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
application/javascript
1 change: 1 addition & 0 deletions tests/023_no_ext_with_mime.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HELLO
2 changes: 2 additions & 0 deletions tests/023_no_ext_with_mime.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
args: tests/023_no_ext_with_mime --reload --recompile
output: tests/023_no_ext_with_mime.out
2 changes: 2 additions & 0 deletions tests/024_import_no_ext_with_mime.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
args: tests/024_import_no_ext_with_mime.ts --reload --recompile
output: tests/024_import_no_ext_with_mime.ts.out
1 change: 1 addition & 0 deletions tests/024_import_no_ext_with_mime.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "./023_no_ext_with_mime";
1 change: 1 addition & 0 deletions tests/024_import_no_ext_with_mime.ts.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HELLO

0 comments on commit fe0ceae

Please sign in to comment.