-
Notifications
You must be signed in to change notification settings - Fork 26
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
Added prettier-plugin for formatting glimmer component templates #117
Conversation
6496f59
to
5ab013f
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preliminary review. Made some comments.
"prepublishOnly": "scripts/build.js", | ||
"problems": "tsc -p tsconfig.json --noEmit", | ||
"start": "webpack-dev-server", | ||
"storybook": "yarn build && yarn workspace basic-example-app storybook", | ||
"test": "yarn lint && testem ci && yarn test:babel-plugins", | ||
"test": "yarn format:check && yarn lint && testem ci && yarn test:babel-plugins && yarn test:prettier", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may not want this here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I respond to this in a comment by @chiragpat below.
This comment has been minimized.
This comment has been minimized.
@@ -13,15 +13,17 @@ | |||
], | |||
"scripts": { | |||
"build": "scripts/build.js", | |||
"format:check": "prettier --check 'packages/**/*.{js,ts}'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this just be done by the prettier plugin in eslint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When prettier and eslint both do formatting we get sometimes a double rewrite of a file, with the collision of rules being applied to a tagged template expression.
What we're doing now is simply using prettier to do a style-check format and do a check then use eslint lint for anti-patterns.
node.type === 'TaggedTemplateExpression' && | ||
node.tag.type === 'Identifier' && | ||
node.tag.name === 'hbs' && | ||
name === 'quasi' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't cover any renames of the named hbs import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will create an issue for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue created: #121
hbs
tagged template expressions with prettier's glimmer printer.2.3.1