Introduce a shared tsconfig for extensions
Setup a baseline tsconfig for extensions to extend. This will help make sure thatof our built-in extensions are using the recommended settings for target and so on. it also reduces duplicated code and will make updating tsconfig settings easier
This commit is contained in:
parent
199c51f4a5
commit
402106a699
|
@ -21,6 +21,7 @@ const nlsDev = require('vscode-nls-dev');
|
|||
const root = path.dirname(__dirname);
|
||||
const commit = util.getVersion(root);
|
||||
const plumber = require('gulp-plumber');
|
||||
const _ = require('underscore');
|
||||
|
||||
const extensionsPath = path.join(path.dirname(__dirname), 'extensions');
|
||||
|
||||
|
@ -35,7 +36,9 @@ const tasks = compilations.map(function (tsconfigFile) {
|
|||
const absolutePath = path.join(extensionsPath, tsconfigFile);
|
||||
const relativeDirname = path.dirname(tsconfigFile);
|
||||
|
||||
const tsOptions = require(absolutePath).compilerOptions;
|
||||
const tsconfig = require(absolutePath);
|
||||
const tsOptions = _.assign({}, tsconfig.compilerOptions, tsconfig.extends ? require(path.join(extensionsPath, relativeDirname, tsconfig.extends)).compilerOptions : {});
|
||||
|
||||
tsOptions.verbose = false;
|
||||
tsOptions.sourceMap = true;
|
||||
|
||||
|
|
16
extensions/shared.tsconfig.json
Normal file
16
extensions/shared.tsconfig.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2017",
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"es2015.promise"
|
||||
],
|
||||
"strict": true,
|
||||
"alwaysStrict": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitReturns": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true
|
||||
}
|
||||
}
|
|
@ -1,18 +1,7 @@
|
|||
{
|
||||
"extends": "../shared.tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "es2017",
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"es2015.promise"
|
||||
],
|
||||
"outDir": "./out",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitReturns": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"strict": true,
|
||||
"alwaysStrict": true,
|
||||
"experimentalDecorators": true
|
||||
},
|
||||
"include": [
|
||||
|
|
Loading…
Reference in a new issue