beemojs / beemo

🤖 Centralized configuration layer for dev tools. Beep boop.
https://beemo.dev
MIT License
143 stars 9 forks source link

Prettier driver adds double quotes #55

Closed domoritz closed 5 years ago

domoritz commented 5 years ago

My configs/prettier.js file only uses ' but the generated prettier.config.js has ". Can the driver be configured to maintain the original quoting or use what is specified in eslint or prettier?

milesj commented 5 years ago

@domoritz The prettier.config.js is just a JSON dump, it's basically this:

module.exports = JSON.stringify(config);

Since these are auto-generated files, there's no other way around it. If you'd like the config to match your guidelines (I personally gitignore the config files), you can run prettier on it yourself.

beemo prettier ./src && prettier ./*.config.js --write
domoritz commented 5 years ago

I see. I personally don't care what the format is and I am ignoring the files. However, the file causes linting errors later. I just ignored it in my eslint config. Would it make sense to ignore the generated config files by default?

milesj commented 5 years ago

@domoritz I usually ignore them, especially if it's a type of config that changes often.

domoritz commented 5 years ago

I wish beemo ignored generated files automatically but I don't think it's a big issue so I'll close this.

milesj commented 5 years ago

@domoritz What do you mean exactly by beemo ignoring the generated files?

You can use scaffolding to add ignore patterns to gitignore/npmignore/etc. https://milesj.gitbook.io/beemo/scaffolding

domoritz commented 5 years ago

What do you mean exactly by beemo ignoring the generated files?

In my case, beemo generates both the prettier and eslint config files. Therefore, I think prettier and eslint configs should be ignored by prettier and eslint.

milesj commented 5 years ago

@domoritz Not a bad idea, I'll think about it. You can add them to the ignore list manually too.

// configs/prettier.js
module.exports = {
  ignore: ['.eslintrc.js', 'prettier.config.js'], // etc
};