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

set astroAllowShorthand to default off #143

Merged
merged 4 commits into from
Mar 28, 2022
Merged

set astroAllowShorthand to default off #143

merged 4 commits into from
Mar 28, 2022

Conversation

manigandham
Copy link
Contributor

Shorthand removes attribute keys and breaks Typescript which is used by Astro. It's also uncommon and should be disabled by default, and only opt-in for those that specifically want it.

Changes

  • Sets astroAllowShorthand to default false

Testing

No new tests.

Docs

No documentation to update.

@antonyfaris
Copy link
Member

Sorry for the late reply. This indeed will be the new default. We are in the process of migrating to the new Astro compiler. Thanks for opening this pr.

@antonyfaris antonyfaris changed the base branch from main to next March 24, 2022 21:52
@antonyfaris
Copy link
Member

@manigandham Could you please rebase on next & add a changeset?

Shorthand removes attribute keys and breaks Typescript which is used by Astro. It's also uncommon and should be disabled by default, and only opt-in for those that specifically want it.
@manigandham
Copy link
Contributor Author

@antonyfaris done!

@antonyfaris
Copy link
Member

@manigandham Can you fix the tests? Now that the default is false some tests are not to passing.

- shorthand off by default
- comment (and should remove) can format to shorthand because this is covered in the options test
@manigandham
Copy link
Contributor Author

@manigandham Can you fix the tests? Now that the default is false some tests are not to passing.

Done. I commented out the converts-to-shorthand test because it's already covered by the option-astro-allow-shorthand-true and option-astro-allow-shorthand-false tests now.

.changeset/selfish-cherries-grab.md Outdated Show resolved Hide resolved
test/tests/other.test.ts Outdated Show resolved Hide resolved
@manigandham
Copy link
Contributor Author

All set

@antonyfaris
Copy link
Member

Thank you!

@antonyfaris antonyfaris merged commit 73e81bd into withastro:next Mar 28, 2022
@manigandham manigandham deleted the patch-1 branch March 28, 2022 19:54
Princesseuh added a commit that referenced this pull request Jun 24, 2022
* [WIP] Add new compiler (#135)

* add new compiler

* chore: update compiler, make-synchronous

* chore: use compiler's AST types

* feat: use new Astro compiler

* fix: use `type` keyword for type exports

* fix: update compiler

* remove old parser

* wip: format basic Astro file

* bump @astrojs/compiler

* fix: format basic Astro file

* bump @astrojs/compiler

* fix: format with a single style element

* format frontmatter and simple expression

* fix: format with embedded JSX expressions

* fix: JSX expressions in attribute values

* format html comments

* format shorthand

* fix: format components

* format unclosed tags

* fix: format script tag

* format with prettier ignore in frontmatter

* fix: format spread operator

* format nested comment

* fix: format attribute with expression as value

* uncomment working tests

* fix: format style element content and attributes

* fix: format style element with sass and scss

* bump compiler

* fix: inline element white space

* fix: format fragments

* fix: format markdown content

* enter pre release mode

* fix: pre release workflow

* run ci and format workflows on next branch

Co-authored-by: Nate Moore <nate@skypack.dev>

* add changeset

* change version from patch to minor

* Version Packages (next) (#148)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* [ci] yarn format

* fix: skip handling comments

* Version Packages (next) (#149)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* [ci] yarn format

* Move from ava to vitest (#151)

* Move from ava to vitest

* chore: add changeset

* Fix eslint (#153)

* fix: eslint

* retrigger checks

* remove node 12 from ci (#154)

* chore: add changeset

* Change prettier width (#155)

* chore: change prettier width from 180 to 80

* chore: add changeset

* fix: format expression (#150)

* Format `directives` (#156)

* format directives

* chore: add changeset

* chore: fix test title

* Version Packages (next) (#152)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* update readme & contributing (#157)

* set `astroAllowShorthand` to default off (#143)

* set `astroAllowShorthand` to default off

Shorthand removes attribute keys and breaks Typescript which is used by Astro. It's also uncommon and should be disabled by default, and only opt-in for those that specifically want it.

* Create selfish-cherries-grab.md

* fix tests for shorthand formatting

- shorthand off by default
- comment (and should remove) can format to shorthand because this is covered in the options test

* remove obsolete shorthand tests, update changeset

* Version Packages (next) (#161)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* try out synckit (#166)

* Version Packages (next) (#167)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Refactor tests for better watch mode (#170)

* Refactor tests for better watch mode

* small refactor

* Update dependencies (#172)

* Fix: format indented sass (#173)

* Fix: format indented sass

* chore: add changeset

* Disable vitest multi-threading (#176)

* Fix: duplicate text (#177)

* Fix: prevent duplicate text

* typo

* Add new line after comments (#178)

* Add new line after comments

* chore: add changeset

* Refactor test-utils (#179)

* Update @astrojs/compiler and fix for spread in expression (#206)

* Update @astrojs/compiler and fix for spread in expression

* add changeset

* Version Packages (next) (#171)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Cleanup repo (#216)

* Update README

* Update configuration files

* Format repo with new rules

* Add .git-blame-ignore-revs

* Update CONTRIBUTING.md

* Update links in package.json

* Fix README example indentation

* Fix README mistake, update ignore-revs id to right one

* Exit pre mode

Co-authored-by: Antony Faris <acp325@gmail.com>
Co-authored-by: Nate Moore <nate@skypack.dev>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: antonyfaris <antonyfaris@users.noreply.github.com>
Co-authored-by: Mani Gandham <manigandham@gmail.com>
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
Co-authored-by: Yosuke Ota <otameshiyo23@gmail.com>
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

Successfully merging this pull request may close these issues.

2 participants