Skip to content

Commit 5a53391

Browse files
committed
wip
1 parent 0d06579 commit 5a53391

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

packages/plugin-typescript/src/lib/normalize-compiler-options.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { join } from 'node:path';
33
import * as process from 'node:process';
44
import type { CompilerOptions } from 'typescript';
55
import { TS_ERROR_CODES } from './runner/ts-error-codes.js';
6+
import type { DiagnosticsOptions } from './runner/ts-runner.js';
67
import {
78
loadTargetConfig,
89
loadTsConfigDefaultsByVersion,
910
} from './runner/utils.js';
10-
import type { TypescriptPluginOptions } from './types.js';
1111

1212
/**
1313
* It will evaluate if the option strict is enabled. If so, it must enable all it's dependencies.
@@ -36,9 +36,7 @@ export function handleCompilerOptionStrict(options: CompilerOptions) {
3636
* later if existing
3737
* @param options Plugin options
3838
*/
39-
export async function normalizeCompilerOptions(
40-
options: Required<Pick<TypescriptPluginOptions, 'tsConfigPath'>>,
41-
) {
39+
export async function normalizeCompilerOptions(options: DiagnosticsOptions) {
4240
const { tsConfigPath } = options;
4341
const { compilerOptions: defaultCompilerOptions } =
4442
await loadTsConfigDefaultsByVersion();

packages/plugin-typescript/src/lib/runner/ts-error-codes.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
11
/* eslint-disable @typescript-eslint/no-magic-numbers, unicorn/numeric-separators-style */
22

3-
/**
4-
* Strict grouping: https://github.com/microsoft/TypeScript/blob/56a08250f3516b3f5bc120d6c7ab4450a9a69352/src/compiler/utilities.ts Line 9113
5-
* noImplicitThis: {
6-
* dependencies: ["strict"],
7-
* computeValue: compilerOptions => {
8-
* return getStrictOptionValue(compilerOptions, "noImplicitThis");
9-
* },
10-
* },
11-
* Line 9262
12-
* export function getStrictOptionValue(compilerOptions: CompilerOptions, flag: StrictOptionName): boolean {
13-
* return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag];
14-
* }
15-
* https://github.com/microsoft/TypeScript/blob/56a08250f3516b3f5bc120d6c7ab4450a9a69352/src/compiler/utilities.ts#L9262
16-
*/
17-
183
/** This is the list of error codes that can be triggered by the TypeScript compiler.
19-
* It's divided into: category -> compiler option -> error codes (that might trigger)
4+
* It's divided into: group -> compiler option as audit -> error codes
5+
*
6+
* Source:
7+
* https://github.com/microsoft/TypeScript/blob/56a08250f3516b3f5bc120d6c7ab4450a9a69352/src/compiler/diagnosticMessages.json
208
*/
219
export const TS_ERROR_CODES = {
2210
languageAndEnvironment: {

0 commit comments

Comments
 (0)