Skip to content

Commit 0be91e1

Browse files
committed
docs: mention oxlint config
1 parent 059c83a commit 0be91e1

5 files changed

Lines changed: 30 additions & 18 deletions

File tree

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ If TypeScript is where you're productive, you don't need to learn a new language
1010

1111
## Packages
1212

13-
| Package | Description |
14-
| ------------------------------------------------- | ------------------------------------------------------------- |
15-
| [`@gwigz/slua-types`](packages/types) | Auto-generated TypeScript declarations for all SLua/LSL APIs |
16-
| [`@gwigz/slua-tstl-plugin`](packages/tstl-plugin) | TSTL plugin enforcing SLua constraints |
17-
| [`@gwigz/slua-modules`](packages/modules) | Shared runtime modules (config helpers, testing utilities) |
18-
| [`@gwigz/slua-create`](packages/create) | CLI scaffolding tool for new SLua projects |
19-
| [`@gwigz/slua-json`](packages/json) | Tagged JSON codec for exchanging typed data with SLua scripts |
13+
| Package | Description |
14+
| ----------------------------------------------------- | ------------------------------------------------------------- |
15+
| [`@gwigz/slua-types`](packages/types) | Auto-generated TypeScript declarations for all SLua/LSL APIs |
16+
| [`@gwigz/slua-tstl-plugin`](packages/tstl-plugin) | TSTL plugin enforcing SLua constraints |
17+
| [`@gwigz/slua-modules`](packages/modules) | Shared runtime modules (config helpers, testing utilities) |
18+
| [`@gwigz/slua-oxlint-config`](packages/oxlint-config) | Shared oxlint config catching SLua-incompatible patterns |
19+
| [`@gwigz/slua-create`](packages/create) | CLI scaffolding tool for new SLua projects |
20+
| [`@gwigz/slua-json`](packages/json) | Tagged JSON codec for exchanging typed data with SLua scripts |
2021

2122
## Examples
2223

apps/web/content/docs/create/templates.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,11 @@ Adds a `.stylua.toml` config to your project so you can auto-format compiled
7070

7171
### Linting (`oxlint`)
7272

73-
Adds an `oxlint` config and lint script to your project for fast TypeScript
74-
linting.
73+
Adds [oxlint](https://oxc.rs) with the
74+
[`@gwigz/slua-oxlint-config`](/docs/slua/transpiler-plugin#keeping-output-small)
75+
shared config, which catches TypeScript patterns that don't work in SLua or
76+
pull in large TSTL runtime helpers (`delete`, `Map`/`Set`, `.splice()`,
77+
`async`/`await`, browser/Node APIs, and more).
7578

7679
### Formatting (`oxfmt`)
7780

apps/web/content/docs/slua/transpiler-plugin.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ Safe for string and number defaults (both truthy in Lua). Not applied to `false`
324324

325325
Some TypeScript patterns pull in large TSTL runtime helpers. Here are recommendations for keeping output lean.
326326

327+
<Callout type="info" title="Enforce with oxlint">
328+
Install `@gwigz/slua-oxlint-config` to catch these patterns automatically at lint time. See the
329+
[README](https://github.com/gwigz/slua/tree/main/packages/oxlint-config) for setup instructions.
330+
</Callout>
331+
327332
### Avoid `delete` on objects
328333

329334
The `delete` operator pulls in `__TS__Delete`, which depends on the entire Error class hierarchy, `__TS__Class`, `__TS__ClassExtends`, `__TS__New`, and `__TS__ObjectGetOwnPropertyDescriptors`, roughly **150 lines** of runtime code.

packages/create/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ bunx @gwigz/slua-create my-project
3333

3434
## Extras
3535

36-
| Extra | Description |
37-
| ----------------- | -------------------------------------------------------------------------------------- |
38-
| JSX templates | [@gwigz/jsx-inline](https://github.com/gwigz/jsx-inline) |
39-
| Config module | [@gwigz/slua-modules/config](https://github.com/gwigz/slua/tree/main/packages/modules) |
40-
| Yield module | [@gwigz/slua-modules/yield](https://github.com/gwigz/slua/tree/main/packages/modules) |
41-
| StyLua formatting | Lua output formatting via [StyLua](https://github.com/JohnnyMorganz/StyLua) |
42-
| Linting | TypeScript linting via [oxlint](https://oxc.rs) |
43-
| Formatting | TypeScript formatting via [oxfmt](https://oxc.rs) |
36+
| Extra | Description |
37+
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
38+
| JSX templates | [@gwigz/jsx-inline](https://github.com/gwigz/jsx-inline) |
39+
| Config module | [@gwigz/slua-modules/config](https://github.com/gwigz/slua/tree/main/packages/modules) |
40+
| Yield module | [@gwigz/slua-modules/yield](https://github.com/gwigz/slua/tree/main/packages/modules) |
41+
| StyLua formatting | Lua output formatting via [StyLua](https://github.com/JohnnyMorganz/StyLua) |
42+
| Linting | TypeScript linting via [oxlint](https://oxc.rs) with [@gwigz/slua-oxlint-config](https://github.com/gwigz/slua/tree/main/packages/oxlint-config) |
43+
| Formatting | TypeScript formatting via [oxfmt](https://oxc.rs) |
4444

4545
## Documentation
4646

packages/tstl-plugin/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,10 @@ Safe for string and number defaults (both truthy in Lua). Not applied to `false`
354354

355355
## Keeping output small
356356

357-
Some TypeScript patterns pull in large TSTL runtime helpers. Here are recommendations for keeping output lean:
357+
Some TypeScript patterns pull in large TSTL runtime helpers. Here are recommendations for keeping output lean.
358+
359+
> [!TIP]
360+
> Install [`@gwigz/slua-oxlint-config`](../oxlint-config) to enforce these recommendations at lint time.
358361
359362
### Avoid `delete` on objects
360363

0 commit comments

Comments
 (0)