Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align Prettier configuration between Ember CLI and Embroider addon blueprints #246

Open
jelhan opened this issue Jan 16, 2024 · 1 comment

Comments

@jelhan
Copy link
Contributor

jelhan commented Jan 16, 2024

I noticed a mismatch of the Prettier config between Ember CLI and Embroider addon blueprint.

Embroider addon blueprint configures Prettier to use single quotes for every file type:

module.exports = {
plugins: ['prettier-plugin-ember-template-tag'],
singleQuote: true,
};

module.exports = {
plugins: ['prettier-plugin-ember-template-tag'],
singleQuote: true,
};

Ember CLI blueprints configure Prettier to use single quotes only for JavaScript and TypeScript files:
https://github.com/ember-cli/ember-cli/blob/f824a6aee6e804fe4584fb037e893e3bbf93370a/blueprints/app/files/.prettierrc.js#L3-L12

I think both should be aligned.

Embroider addon blueprint supports template tag out of the box. So we need to extend Ember CLI's Prettier configuration to support .gjs and *.gts files as well. I think it should look like the following:

module.exports = {
  overrides: [
    {
      files: '*.{js,ts,gjs,gts}',
      options: {
        singleQuote: true,
      },
    },
  ],
};

If there aren't any concerns against implementing it, I can try providing a PR this week.

@aklkv
Copy link
Contributor

aklkv commented Jan 16, 2024

Currently, we have double quotes in on all template files, to keep it this way in v2 addon we might want to have the following config:

module.exports = {
  plugins: ['prettier-plugin-ember-template-tag'],
  templateSingleQuote: false,
  overrides: [
    {
      files: '*.{js,ts,gjs,gts}',
      options: {
        singleQuote: true,
      },
    },
  ],
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants