diff --git a/index.js b/index.js index 83a50a1..4180e7b 100644 --- a/index.js +++ b/index.js @@ -143,13 +143,7 @@ export default function createConfig ({ } if (needsPrettier) { // Prettier recommends an explicit configuration file to let the editor know that it's used. - files['.prettierrc.json'] = prettierrcs[styleGuide] || `{ - "semi": false, - "tabWidth": 2, - "singleQuote": true, - "printWidth": 100, - "trailingComma": "none" -}` + files['.prettierrc.json'] = prettierrcs[styleGuide] } return { diff --git a/templates/prettierrc-default.json b/templates/prettierrc-default.json new file mode 100644 index 0000000..ecdf3e0 --- /dev/null +++ b/templates/prettierrc-default.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "semi": false, + "tabWidth": 2, + "singleQuote": true, + "printWidth": 100, + "trailingComma": "none" +} diff --git a/templates/prettierrcs.cjs b/templates/prettierrcs.cjs index 607fdab..3d6f476 100644 --- a/templates/prettierrcs.cjs +++ b/templates/prettierrcs.cjs @@ -1,2 +1,3 @@ exports.airbnb = require('./prettierrc-airbnb.json') +exports.default = require('./prettierrc-default.json') exports.standard = require('./prettierrc-standard.json')