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
HTML: Fix format on style[lang="sass"]
#9051
Changes from 7 commits
481ea90
b4c262f
100a577
9f79b08
0719a03
58539a0
5aa8b06
665d344
e5d325c
daea3f6
e9ac48a
ac1c5e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#### Fix format on `style[lang="sass"]` ([#9051](https://github.com/prettier/prettier/pull/9051) by [@fisker](https://github.com/fisker)) | ||
|
||
<!-- prettier-ignore --> | ||
```jsx | ||
<!-- Input --> | ||
<style lang="sass"> | ||
.hero | ||
@include background-centered | ||
</style> | ||
|
||
<!-- Prettier stable --> | ||
<style lang="sass"> | ||
.hero @include background-centered; | ||
</style> | ||
|
||
<!-- Prettier master --> | ||
<style lang="sass"> | ||
.hero | ||
@include background-centered | ||
</style> | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`unknow-lang.html format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["html"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<style lang="unknown"> | ||
foo | ||
bar | ||
</style> | ||
|
||
<script lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown" lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
</body> | ||
</html> | ||
|
||
=====================================output===================================== | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<style lang="unknown"> | ||
foo | ||
bar | ||
fisker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</style> | ||
|
||
<script lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown" lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
</body> | ||
</html> | ||
|
||
================================================================================ | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
run_spec(__dirname, ["html"]); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<style lang="unknown"> | ||
foo | ||
bar | ||
</style> | ||
|
||
<script lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown" lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,6 +164,66 @@ printWidth: 80 | |
================================================================================ | ||
`; | ||
|
||
exports[`unknow.vue format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["vue"] | ||
printWidth: 80 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add tests for the case There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| printWidth | ||
=====================================input====================================== | ||
<style lang="unknown"> | ||
foo | ||
bar | ||
</style> | ||
|
||
<script lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown" lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<template lang="unknown"> | ||
foo | ||
bar | ||
</template> | ||
|
||
=====================================output===================================== | ||
<style lang="unknown"> | ||
foo | ||
bar | ||
</style> | ||
|
||
<script lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown" lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<template lang="unknown"> | ||
foo | ||
bar | ||
</template> | ||
|
||
================================================================================ | ||
`; | ||
|
||
exports[`vue-component.vue format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["vue"] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<style lang="unknown"> | ||
foo | ||
bar | ||
</style> | ||
|
||
<script lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown" lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<template lang="unknown"> | ||
foo | ||
bar | ||
</template> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rename: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo |
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.
One second, I need change this to valid css, because the parser might still be
css
and it throws.