Skip to content

Commit 5a16809

Browse files
authored
Add separate tsconfig for webview development (#3009)
Signed-off-by: Shi Chen <[email protected]>
1 parent 56b2516 commit 5a16809

File tree

12 files changed

+58
-31
lines changed

12 files changed

+58
-31
lines changed

.eslintrc.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"parser": "@typescript-eslint/parser",
77
"parserOptions": {
88
"ecmaVersion": "latest",
9-
"project": "tsconfig.json"
9+
"project": [
10+
"tsconfig.webview.json",
11+
"tsconfig.json"
12+
]
1013
},
1114
"plugins": [
1215
"@typescript-eslint"
@@ -61,7 +64,9 @@
6164
"no-var": "error",
6265
"prefer-arrow-callback": [
6366
"error",
64-
{ "allowNamedFunctions": true }
67+
{
68+
"allowNamedFunctions": true
69+
}
6570
],
6671
"prefer-const": "error",
6772
"prefer-template": "error",

.vscodeignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ images/**
88
.gitignore
99
.github/**
1010
tsconfig.json
11+
tsconfig.webview.json
12+
tsconfig.base.json
1113
vsc-extension-quickstart.md
1214
undefined/**
1315
CONTRIBUTING.md

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@
13901390
"build-server": "./node_modules/.bin/gulp build_server",
13911391
"fast-build-server": "./node_modules/.bin/gulp dev_server",
13921392
"watch-server": "./node_modules/.bin/gulp watch_server",
1393-
"eslint": "eslint --ignore-path .eslintignore --ext .js,.ts ."
1393+
"eslint": "eslint --ignore-path .eslintignore --ext .js,.ts,.tsx ."
13941394
},
13951395
"devDependencies": {
13961396
"@types/fs-extra": "^8.0.0",

src/log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createLogger, format, transports } from 'winston';
2-
import DailyRotateFile from 'winston-daily-rotate-file';
2+
import * as DailyRotateFile from 'winston-daily-rotate-file';
33

44
export function initializeLogFile(filename: string) {
55
logger.add(new DailyRotateFile({

src/webview/changeSignature/App.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ export class App extends React.Component<{}, State> {
519519
</VSCodeDataGridRow>
520520
{
521521
(() => {
522-
const options = [];
522+
const options: JSX.Element[] = [];
523523
for (let row = 0; row < this.state.parameters.length; row++) {
524524
options.push(this.generateParameterDataGridRow(row));
525525
}
@@ -539,7 +539,7 @@ export class App extends React.Component<{}, State> {
539539
</VSCodeDataGridRow>
540540
{
541541
(() => {
542-
const options = [];
542+
const options: JSX.Element[] = [];
543543
for (let row = 0; row < this.state.exceptions.length; row++) {
544544
options.push(this.generateExceptionDataGridRow(row));
545545
}
@@ -577,8 +577,8 @@ export class App extends React.Component<{}, State> {
577577
return Number(idSplit[1]);
578578
}
579579

580-
private getModifierString(accessType: string): string {
581-
if (accessType === "package-private") {
580+
private getModifierString(accessType: string | undefined): string {
581+
if (!accessType || accessType === "package-private") {
582582
return "";
583583
}
584584
return accessType;

test/lightweight-mode-suite/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
// a possible error to the callback or null if none.
1212

1313
import * as path from 'path';
14-
import Mocha from 'mocha';
15-
import glob from 'glob';
14+
import * as Mocha from 'mocha';
15+
import * as glob from 'glob';
1616

1717
export function run(testsRoot: string): Promise<void> {
1818
const mocha = new Mocha({

test/standard-mode-suite/extension.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import assert from 'assert';
1+
import * as assert from 'assert';
22
import * as fs from 'fs';
33
import * as path from 'path';
44
import { env } from 'process';

test/standard-mode-suite/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
// a possible error to the callback or null if none.
1212

1313
import * as path from 'path';
14-
import Mocha from 'mocha';
15-
import glob from 'glob';
14+
import * as Mocha from 'mocha';
15+
import * as glob from 'glob';
1616

1717
export function run(testsRoot: string): Promise<void> {
1818
const mocha = new Mocha({

tsconfig.base.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es6",
4+
"moduleResolution": "node",
5+
"outDir": "out",
6+
"sourceMap": true,
7+
"plugins": [
8+
{
9+
"name": "eslint"
10+
}
11+
],
12+
}
13+
}

tsconfig.json

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,15 @@
11
{
2+
"extends": "./tsconfig.base.json",
23
"compilerOptions": {
3-
"target": "es6",
44
"lib": [
5-
"es6",
6-
"DOM"
5+
"es6"
76
],
87
"module": "commonjs",
9-
"moduleResolution": "node",
10-
"outDir": "out",
11-
"sourceMap": true,
12-
"plugins": [
13-
{
14-
"name": "eslint"
15-
}
16-
],
17-
/* Enabled for React */
18-
"jsx": "react-jsx",
19-
"esModuleInterop": true,
20-
"allowSyntheticDefaultImports": true,
21-
"skipLibCheck": true,
228
},
239
"exclude": [
2410
"node_modules",
2511
"server",
26-
".vscode-test"
12+
".vscode-test",
13+
"src/webview"
2714
]
2815
}

0 commit comments

Comments
 (0)