mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
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
36 lines
727 B
TypeScript
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' });
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|