-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade Prettier to v3 changelog: Internal, Dependencies, Update dependencies to latest versions * Update normalize specs * Use consistent syntax for version ranges * Upgrade stylelint-prettier * Update yarn.lock
- Loading branch information
Showing
13 changed files
with
245 additions
and
59 deletions.
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
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,10 @@ | ||
## Unreleased | ||
|
||
### Breaking Changes | ||
|
||
- `normalize` method now returns a `Promise`, resolving to a `string` | ||
- `prettier` peer dependency now requires v3 or newer | ||
|
||
## v1.0.0 | ||
|
||
- Initial release |
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
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 |
---|---|---|
@@ -1,39 +1,39 @@ | ||
import normalize from './index.js'; | ||
|
||
describe('normalize', () => { | ||
it('applies smart quotes', () => { | ||
it('applies smart quotes', async () => { | ||
const original = '---\na: \'<strong class="example...">Hello "world"...</strong>\''; | ||
const expected = '---\na: \'<strong class="example...">Hello “world”…</strong>\'\n'; | ||
|
||
expect(normalize(original)).to.equal(expected); | ||
expect(await normalize(original)).to.equal(expected); | ||
}); | ||
|
||
it('retains comments', () => { | ||
it('retains comments', async () => { | ||
const original = '---\n# Comment\na: true'; | ||
const expected = '---\n# Comment\na: true\n'; | ||
|
||
expect(normalize(original)).to.equal(expected); | ||
expect(await normalize(original)).to.equal(expected); | ||
}); | ||
|
||
it('sorts keys', () => { | ||
it('sorts keys', async () => { | ||
const original = '---\nmap:\n b: false\n a: true'; | ||
const expected = '---\nmap:\n a: true\n b: false\n'; | ||
|
||
expect(normalize(original)).to.equal(expected); | ||
expect(await normalize(original)).to.equal(expected); | ||
}); | ||
|
||
it('formats using prettier', () => { | ||
it('formats using prettier', async () => { | ||
const original = "---\nfoo: 'bar' "; | ||
const expected = '---\nfoo: "bar"\n'; | ||
const prettierConfig = { singleQuote: false }; | ||
|
||
expect(normalize(original, { prettierConfig })).to.equal(expected); | ||
expect(await normalize(original, { prettierConfig })).to.equal(expected); | ||
}); | ||
|
||
it('allows formatting with excluded formatters', () => { | ||
it('allows formatting with excluded formatters', async () => { | ||
const original = '---\nmap:\n b: ...\n a: ...'; | ||
const expected = '---\nmap:\n a: ...\n b: ...\n'; | ||
|
||
expect(normalize(original, { exclude: ['smartPunctuation'] })).to.equal(expected); | ||
expect(await normalize(original, { exclude: ['smartPunctuation'] })).to.equal(expected); | ||
}); | ||
}); |
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 |
---|---|---|
|
@@ -37,6 +37,6 @@ | |
"yaml": "^2.3.1" | ||
}, | ||
"peerDependencies": { | ||
"prettier": "*" | ||
"prettier": ">=3" | ||
} | ||
} |
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
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
Oops, something went wrong.