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
Consistently quote Sass modules strings #11461
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
38e427d
Consistently quote Sass modules strings
niksy 3f23e9f
Add module rule name check function
niksy a2054a9
Add more tests for `@use` and `@forward`
niksy bdc3e84
Lint changelog
niksy 9e3df9a
Lint files
niksy 18e2451
Merge branch 'main' into sass-modules-quotes
sosukesuzuki File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!-- | ||
|
||
1. Choose a folder based on which language your PR is for. | ||
|
||
- For JavaScript, choose `javascript/` etc. | ||
- For TypeScript specific syntax, choose `typescript/`. | ||
- If your PR applies to multiple languages, such as TypeScript/Flow, choose one folder and mention which languages it applies to. | ||
|
||
2. In your chosen folder, create a file with your PR number: `XXXX.md`. For example: `typescript/6728.md`. | ||
|
||
3. Copy the content below and paste it in your new file. | ||
|
||
4. Fill in a title, the PR number and your user name. | ||
|
||
5. Optionally write a description. Many times it’s enough with just sample code. | ||
|
||
6. Change ```jsx to your language. For example, ```yaml. | ||
|
||
7. Change the `// Input` and `// Prettier` comments to the comment syntax of your language. For example, `# Input`. | ||
|
||
8. Choose some nice input example code. Paste it along with the output before and after your PR. | ||
|
||
--> | ||
|
||
#### Consistently quote Sass modules strings (#11461 by @niksy) | ||
|
||
<!-- Optional description if it makes sense. --> | ||
|
||
<!-- prettier-ignore --> | ||
```scss | ||
// Input | ||
@use "sass:math"; | ||
@forward "list"; | ||
|
||
// Prettier stable | ||
@use "sass:math"; | ||
@forward "list"; | ||
|
||
// Prettier main | ||
@use 'sass:math'; | ||
@forward 'list'; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`quotes.scss - {"singleQuote":true} format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["scss"] | ||
printWidth: 80 | ||
singleQuote: true | ||
| printWidth | ||
=====================================input====================================== | ||
@use "module"; | ||
@forward "module"; | ||
|
||
=====================================output===================================== | ||
@use 'module'; | ||
@forward 'module'; | ||
|
||
================================================================================ | ||
`; | ||
|
||
exports[`quotes.scss format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["scss"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
@use "module"; | ||
@forward "module"; | ||
|
||
=====================================output===================================== | ||
@use "module"; | ||
@forward "module"; | ||
|
||
================================================================================ | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
run_spec(__dirname, ["scss"]); | ||
run_spec(__dirname, ["scss"], { singleQuote: true }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@use "module"; | ||
@forward "module"; | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 need more tests here, because we use parser here and it can break output, please add:
ideally even more