DefinitelyTyped/scripts/generate-tsconfigs.ts
Ryan Cavanaugh e7c111c4b7 Merge remote-tracking branch 'upstream/master' into types2.0
Add tsconfig files everywhere

# Conflicts:
#	azure-mobile-services-client/AzureMobileServicesClient.d.ts
#	bookshelf/bookshelf.d.ts
#	hapi/hapi.d.ts
#	helmet/helmet.d.ts
#	mongodb/mongodb.d.ts
#	nock/nock.d.ts
#	react-bootstrap/react-bootstrap.d.ts
#	react-helmet/react-helmet.d.ts
#	restify/restify.d.ts
#	sequelize/sequelize.d.ts
2016-04-27 20:40:21 -07:00

36 lines
727 B
TypeScript

/// <reference path="../node/node.d.ts" />
import * as fs from 'fs';
import * as path from 'path';
const template = {
compilerOptions: {
module: "commonjs",
target: "es2015",
noImplicitAny: true,
strictNullChecks: true,
baseUrl: "../"
}
};
const home = path.join(__dirname, '..');
fs.readdir(home, (err, dirs) => {
if (err) throw err;
for (const dir of dirs.map(d => path.join(home, d))) {
fs.lstat(dir, (err, stats) => {
if (err) throw err;
if (stats.isDirectory()) {
const target = path.join(dir, 'tsconfig.json');
fs.exists(target, exists => {
if (!exists) {
fs.writeFile(target, JSON.stringify(template, undefined, 4), { encoding: 'utf-8' });
}
});
}
});
}
});