@iobroker/create-adapter
Version:
Command line utility to create customized ioBroker adapters
30 lines • 955 B
JavaScript
;
const JSON5 = require("json5");
const templateFunction = answers => {
const useESLint = answers.tools && answers.tools.indexOf("ESLint") > -1;
const usePrettier = answers.tools && answers.tools.indexOf("Prettier") > -1;
const useTypeScript = answers.language === "TypeScript";
if (!useESLint && !usePrettier && !useTypeScript)
return;
const template = `
{
${useTypeScript ? `"typescript.tsdk": "node_modules/typescript/lib",` : ""}
${useESLint ? `"eslint.enable": true,` : ""}
${usePrettier ? (`
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
${useTypeScript ? (`
"[typescript]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
},
`) : ""}
`) : ""}
}
`;
return JSON.stringify(JSON5.parse(template), null, 4);
};
templateFunction.customPath = ".vscode/settings.json";
module.exports = templateFunction;
//# sourceMappingURL=settings.json.js.map