Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to 5.5 and update compiler options #3175

Merged
merged 5 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/proud-pants-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/eslint": "7.29.0",
"assert": "2.0.0",
"rollup-plugin-typescript2": "0.34.1",
"typescript": "5.4.5",
"typescript": "5.5.3",
"tslib": "^2.6.2",
"prettier": "^2.0.2",
"sharp": "0.28.1"
Expand Down
88 changes: 55 additions & 33 deletions packages/documentation/copy/en/project-config/Compiler Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,182 +686,204 @@ tsc app.ts util.ts --target esnext --outfile index.js
<p>Include source code in the sourcemaps inside the emitted JavaScript.</p>
</td></tr>

<tr class='odd' name='isolatedModules'>
<td><code><a href='/tsconfig/#isolatedModules'>--isolatedModules</a></code></td>
<tr class='odd' name='isolatedDeclarations'>
<td><code><a href='/tsconfig/#isolatedDeclarations'>--isolatedDeclarations</a></code></td>
<td><p><code>boolean</code></p>
</td>
<td><p><code>false</code></p>
</td>
</tr>
<tr class="option-description odd"><td colspan="3">
<p>Does something</p>
</td></tr>

<tr class='even' name='isolatedModules'>
<td><code><a href='/tsconfig/#isolatedModules'>--isolatedModules</a></code></td>
<td><p><code>boolean</code></p>
</td>
<td><p><code>false</code></p>
</td>
</tr>
<tr class="option-description even"><td colspan="3">
<p>Ensure that each file can be safely transpiled without relying on other imports.</p>
</td></tr>

<tr class='even' name='jsx'>
<tr class='odd' name='jsx'>
<td><code><a href='/tsconfig/#jsx'>--jsx</a></code></td>
<td><p><code>preserve</code>, <code>react</code>, <code>react-native</code>, <code>react-jsx</code>, or <code>react-jsxdev</code></p>
</td>
<td>
</td>
</tr>
<tr class="option-description even"><td colspan="3">
<tr class="option-description odd"><td colspan="3">
<p>Specify what JSX code is generated.</p>
</td></tr>

<tr class='odd' name='jsxFactory'>
<tr class='even' name='jsxFactory'>
<td><code><a href='/tsconfig/#jsxFactory'>--jsxFactory</a></code></td>
<td><p><code>string</code></p>
</td>
<td><p><code>React.createElement</code></p>
</td>
</tr>
<tr class="option-description odd"><td colspan="3">
<tr class="option-description even"><td colspan="3">
<p>Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'.</p>
</td></tr>

<tr class='even' name='jsxFragmentFactory'>
<tr class='odd' name='jsxFragmentFactory'>
<td><code><a href='/tsconfig/#jsxFragmentFactory'>--jsxFragmentFactory</a></code></td>
<td><p><code>string</code></p>
</td>
<td><p><code>React.Fragment</code></p>
</td>
</tr>
<tr class="option-description even"><td colspan="3">
<tr class="option-description odd"><td colspan="3">
<p>Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.</p>
</td></tr>

<tr class='odd' name='jsxImportSource'>
<tr class='even' name='jsxImportSource'>
<td><code><a href='/tsconfig/#jsxImportSource'>--jsxImportSource</a></code></td>
<td><p><code>string</code></p>
</td>
<td><p><code>react</code></p>
</td>
</tr>
<tr class="option-description odd"><td colspan="3">
<tr class="option-description even"><td colspan="3">
<p>Specify module specifier used to import the JSX factory functions when using <code>jsx: react-jsx*</code>.</p>
</td></tr>

<tr class='even' name='keyofStringsOnly'>
<tr class='odd' name='keyofStringsOnly'>
<td><code><a href='/tsconfig/#keyofStringsOnly'>--keyofStringsOnly</a></code></td>
<td><p><code>boolean</code></p>
</td>
<td><p><code>false</code></p>
</td>
</tr>
<tr class="option-description even"><td colspan="3">
<tr class="option-description odd"><td colspan="3">
<p>Make keyof only return strings instead of string, numbers or symbols. Legacy option.</p>
</td></tr>

<tr class='odd' name='lib'>
<tr class='even' name='lib'>
<td><code><a href='/tsconfig/#lib'>--lib</a></code></td>
<td><p><code>list</code></p>
</td>
<td>
</td>
</tr>
<tr class="option-description odd"><td colspan="3">
<tr class="option-description even"><td colspan="3">
<p>Specify a set of bundled library declaration files that describe the target runtime environment.</p>
</td></tr>

<tr class='even' name='listEmittedFiles'>
<tr class='odd' name='listEmittedFiles'>
<td><code><a href='/tsconfig/#listEmittedFiles'>--listEmittedFiles</a></code></td>
<td><p><code>boolean</code></p>
</td>
<td><p><code>false</code></p>
</td>
</tr>
<tr class="option-description even"><td colspan="3">
<tr class="option-description odd"><td colspan="3">
<p>Print the names of emitted files after a compilation.</p>
</td></tr>

<tr class='odd' name='listFiles'>
<tr class='even' name='listFiles'>
<td><code><a href='/tsconfig/#listFiles'>--listFiles</a></code></td>
<td><p><code>boolean</code></p>
</td>
<td><p><code>false</code></p>
</td>
</tr>
<tr class="option-description odd"><td colspan="3">
<tr class="option-description even"><td colspan="3">
<p>Print all of the files read during the compilation.</p>
</td></tr>

<tr class='even' name='mapRoot'>
<tr class='odd' name='mapRoot'>
<td><code><a href='/tsconfig/#mapRoot'>--mapRoot</a></code></td>
<td><p><code>string</code></p>
</td>
<td>
</td>
</tr>
<tr class="option-description even"><td colspan="3">
<tr class="option-description odd"><td colspan="3">
<p>Specify the location where debugger should locate map files instead of generated locations.</p>
</td></tr>

<tr class='odd' name='maxNodeModuleJsDepth'>
<tr class='even' name='maxNodeModuleJsDepth'>
<td><code><a href='/tsconfig/#maxNodeModuleJsDepth'>--maxNodeModuleJsDepth</a></code></td>
<td><p><code>number</code></p>
</td>
<td><p><code>0</code></p>
</td>
</tr>
<tr class="option-description odd"><td colspan="3">
<tr class="option-description even"><td colspan="3">
<p>Specify the maximum folder depth used for checking JavaScript files from <code>node_modules</code>. Only applicable with <a href="#allowJs"><code>allowJs</code></a>.</p>
</td></tr>

<tr class='even' name='module'>
<tr class='odd' name='module'>
<td><code><a href='/tsconfig/#module'>--module</a></code></td>
<td><p><code>none</code>, <code>commonjs</code>, <code>amd</code>, <code>umd</code>, <code>system</code>, <code>es6</code>/<code>es2015</code>, <code>es2020</code>, <code>es2022</code>, <code>esnext</code>, <code>node16</code>, <code>nodenext</code>, or <code>preserve</code></p>
</td>
<td><p><code>CommonJS</code> if <a href="#target"><code>target</code></a> is <code>ES3</code> or <code>ES5</code>; <code>ES6</code>/<code>ES2015</code> otherwise.</p>
</td>
</tr>
<tr class="option-description even"><td colspan="3">
<tr class="option-description odd"><td colspan="3">
<p>Specify what module code is generated.</p>
</td></tr>

<tr class='odd' name='moduleDetection'>
<tr class='even' name='moduleDetection'>
<td><code><a href='/tsconfig/#moduleDetection'>--moduleDetection</a></code></td>
<td><p><code>legacy</code>, <code>auto</code>, or <code>force</code></p>
</td>
<td><p>"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.</p>
</td>
</tr>
<tr class="option-description odd"><td colspan="3">
<tr class="option-description even"><td colspan="3">
<p>Specify what method is used to detect whether a file is a script or a module.</p>
</td></tr>

<tr class='even' name='moduleResolution'>
<tr class='odd' name='moduleResolution'>
<td><code><a href='/tsconfig/#moduleResolution'>--moduleResolution</a></code></td>
<td><p><code>classic</code>, <code>node10</code>/<code>node</code>, <code>node16</code>, <code>nodenext</code>, or <code>bundler</code></p>
</td>
<td><p><code>Classic</code> if <a href="#module"><code>module</code></a> is <code>AMD</code>, <code>UMD</code>, <code>System</code>, or <code>ES6</code>/<code>ES2015</code>; Matches if <a href="#module"><code>module</code></a> is <code>node16</code> or <code>nodenext</code>; <code>Node</code> otherwise.</p>
</td>
</tr>
<tr class="option-description even"><td colspan="3">
<tr class="option-description odd"><td colspan="3">
<p>Specify how TypeScript looks up a file from a given module specifier.</p>
</td></tr>

<tr class='odd' name='moduleSuffixes'>
<tr class='even' name='moduleSuffixes'>
<td><code><a href='/tsconfig/#moduleSuffixes'>--moduleSuffixes</a></code></td>
<td><p><code>list</code></p>
</td>
<td>
</td>
</tr>
<tr class="option-description odd"><td colspan="3">
<tr class="option-description even"><td colspan="3">
<p>List of file name suffixes to search when resolving a module.</p>
</td></tr>

<tr class='even' name='newLine'>
<tr class='odd' name='newLine'>
<td><code><a href='/tsconfig/#newLine'>--newLine</a></code></td>
<td><p><code>crlf</code> or <code>lf</code></p>
</td>
<td><p><code>lf</code></p>
</td>
</tr>
<tr class="option-description even"><td colspan="3">
<tr class="option-description odd"><td colspan="3">
<p>Set the newline character for emitting files.</p>
</td></tr>

<tr class='even' name='noCheck'>
<td><code><a href='/tsconfig/#noCheck'>--noCheck</a></code></td>
<td><p><code>boolean</code></p>
</td>
<td><p><code>false</code></p>
</td>
</tr>
<tr class="option-description even"><td colspan="3">
<p>Does something</p>
</td></tr>

<tr class='odd' name='noEmit'>
<td><code><a href='/tsconfig/#noEmit'>--noEmit</a></code></td>
<td><p><code>boolean</code></p>
Expand Down Expand Up @@ -1370,7 +1392,7 @@ tsc app.ts util.ts --target esnext --outfile index.js

<tr class='odd' name='target'>
<td><code><a href='/tsconfig/#target'>--target</a></code></td>
<td><p><code>es3</code>, <code>es5</code>, <code>es6</code>/<code>es2015</code>, <code>es2016</code>, <code>es2017</code>, <code>es2018</code>, <code>es2019</code>, <code>es2020</code>, <code>es2021</code>, <code>es2022</code>, or <code>esnext</code></p>
<td><p><code>es3</code>, <code>es5</code>, <code>es6</code>/<code>es2015</code>, <code>es2016</code>, <code>es2017</code>, <code>es2018</code>, <code>es2019</code>, <code>es2020</code>, <code>es2021</code>, <code>es2022</code>, <code>es2023</code>, or <code>esnext</code></p>
</td>
<td><p><code>ES3</code></p>
</td>
Expand Down
2 changes: 1 addition & 1 deletion packages/sandbox/src/compilerOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const getCompilerOptionsFromParams = (
let toSet = undefined
if (val === "true" && playgroundDefaults[key] !== true) {
toSet = true
} else if (val === "false" && playgroundDefaults[key] !== false) {
} else if (val === "false" && (playgroundDefaults[key] as any) !== false) { // TODO(jakebailey): remove as any, check undefined above
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may have been hiding a bug, but I don't want to change this PR to modify the behavior in this PR.

toSet = false
} else if (!isNaN(parseInt(val, 10)) && playgroundDefaults[key] !== parseInt(val, 10)) {
toSet = parseInt(val, 10)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
display: "isolatedDeclarations"
oneline: "Does something"
jakebailey marked this conversation as resolved.
Show resolved Hide resolved
---
Require sufficient annotation on exports so other tools can trivially generate declaration files.

6 changes: 6 additions & 0 deletions packages/tsconfig-reference/copy/en/options/noCheck.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
display: "noCheck"
oneline: "Does something"
---
Disable full type checking (only critical parse and emit errors will be reported).

2 changes: 2 additions & 0 deletions packages/tsconfig-reference/data/_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ export type CompilerOptionName =
| "composite"
| "tsBuildInfoFile"
| "removeComments"
| "noCheck"
| "noEmit"
| "importHelpers"
| "importsNotUsedAsValues"
| "downlevelIteration"
| "isolatedModules"
| "verbatimModuleSyntax"
| "isolatedDeclarations"
| "strict"
| "noImplicitAny"
| "strictNullChecks"
Expand Down
4 changes: 2 additions & 2 deletions packages/tsconfig-reference/scripts/schema/generateJSON.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ filteredOptions.forEach((option) => {

You're also probably going to need to make the new Markdown file for the compiler flag, run:

\n echo '---\\ndisplay: "${option.name}"\\noneline: "Does something"\\n---\\n${option.description.message}\\n ' > ${sectionsPath}\n\nThen add some docs and run: \n> pnpm run --filter=tsconfig-reference build\n\n
\n echo '---\\ndisplay: "${option.name}"\\noneline: "Does something"\\n---\\n${option.description.message}\\n ' > ${fileURLToPath(sectionsPath)}\n\nThen add some docs and run: \n> pnpm run --filter=tsconfig-reference build\n\n
`;

throw new Error([title, headline, msg, ""].join("\n\n"));
Expand All @@ -100,7 +100,7 @@ You're also probably going to need to make the new Markdown file for the compile
} catch (error) {
// prettier-ignore
throw new Error(
`\n echo '---\\ndisplay: "${option.name}"\\noneline: "Does something" \\n---\\n${option.description.message.replace(/'/g, "`")}\\n ' > ${sectionsPath}\n\nThen add some docs and run: \n> pnpm run --filter=tsconfig-reference build\n\n`
`\n echo '---\\ndisplay: "${option.name}"\\noneline: "Does something" \\n---\\n${option.description.message.replace(/'/g, "`")}\\n ' > ${fileURLToPath(sectionsPath)}\n\nThen add some docs and run: \n> pnpm run --filter=tsconfig-reference build\n\n`
);
}

Expand Down
Loading
Loading