Skip to content

Commit 651c978

Browse files
Implement requested changes
1 parent f0a9471 commit 651c978

File tree

4 files changed

+484
-117
lines changed

4 files changed

+484
-117
lines changed

README.md

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,50 @@ More detailed documentation and info on writing declarations can be found [on th
1414

1515
**Compile Files**
1616

17-
`tstl path/to-my-file.ts path/to-my-other-file.ts`
17+
`tstl path/to/file.ts path/to/other-file.ts`
1818

1919
**Compile Projects**
2020

21-
`tstl -p path/to-my/tsconfig.json`
21+
`tstl -p path/to/tsconfig.json`
2222

2323
**Options**
2424
```
25-
Syntax: tstl [options] [files...]
25+
tstl [options] [files...]
2626
27-
In addtion to the options listed below you can also pass options for the
28-
typescript compiler (For a list of options use tsc -h). NOTE: The tsc options
29-
might have no effect.
27+
In addition to the options listed below you can also pass options for the
28+
typescript compiler (For a list of options use tsc -h).
29+
30+
NOTES:
31+
- The tsc options might have no effect.
32+
- Options in tsconfig.json are prioritized.
3033
3134
Options:
32-
--version Show version number
33-
--luaTarget, -l Specify Lua target version: 'JIT' (Default), '5.1', '5.2',
34-
'5.3'
35-
--project, -p Compile the project given the path to its configuration file,
36-
or to a folder with a 'tsconfig.json'
37-
--help Show this message
35+
--help Show help [boolean]
36+
--version Show version number [boolean]
37+
--lt, --luaTarget Specify Lua target version.
38+
[string] [choices: "JIT", "5.1", "5.2", "5.3"] [default: "JIT"]
39+
--lld, --luaLibDir Specify typescript_lualib.lua location relative to outDir.
40+
[string] [default: "./"]
41+
--ah, --addHeader Specify if a header will be added to compiled files.
42+
[boolean] [default: true]
43+
44+
Examples:
45+
tstl path/to/file.ts [...] Compile files
46+
tstl -p path/to/tsconfig.json Compile project
3847
```
3948

40-
**Optionally:**
41-
Add the lualib files from dist/ to your project. This helper library unlocks additional typescript functions:
42-
- Ternary operator
43-
- Functional-style list operations (forEach/map/filter/every/some)
44-
- Includes lua `Map<S,T>` and `Set<T>` implementations
45-
Add `require("typescript")` in your code code if you want to use the lualib functionality.
49+
**Example tsconfig.json**
50+
```
51+
{
52+
"compilerOptions": {
53+
"noImplicitAny" : true,
54+
"noImplicitThis" : true,
55+
"alwaysStrict" : true,
56+
"strictNullChecks": true,
57+
"luaTarget": "JIT"
58+
}
59+
}
60+
```
4661

4762
## Sublime Text integration
4863
This compiler works great in combination with the [Sublime Text Typescript plugin](https://github.com/Microsoft/TypeScript-Sublime-Plugin) (available through the package manager as `TypeScript`).

0 commit comments

Comments
 (0)