gtap-dev / javascript

JavaScript Style Guide
MIT License
0 stars 0 forks source link

Recommend Prettier instead of manual formatting rules #19

Open mjomble opened 2 months ago

mjomble commented 2 months ago

We have several rules that specify how to format code manually (for example, 19.x).

In some projects (for example DaaS, BuildingBrief, Kinola), we have started using Prettier for automatic code formatting. It doesn't always do a perfect job, but it's good enough, especially given how much time it saves (in both initial editing as well as code reviews).

Should we perhaps recommend its use more widely instead of the manual rules? With a recommended configuration, for example:

printWidth: 100,
singleQuote: true,
tabWidth: 4,
overrides: [
    {
        files: '*.scss',
        options: {
            singleQuote: false,
        },
    },
],

Ideally I'd like to add semi: false, as well. 3 years ago, the "no semicolons" proposal was rejected, but maybe times have changed? 🤓