-
Notifications
You must be signed in to change notification settings - Fork 13
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
chore(deps): update dependency prettier to v3 + stylelint #1623
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d076c57
chore(deps): update dependency prettier to v3 + stylelint
47bc625
Fix scss conflicts and imports
fe0a9a2
Fix dom migration
53c621b
Fix most of the module not found
5247fa3
Use Prettier standalone which doesn't require node packages
17655c4
Fix imports
bfa83d0
Fix default import
537842d
Lint
a4e79da
Add support in documentation v-7
2b83502
Rever any change to old documentation v6
9a6bb35
Fix import
imagoiq 44803ca
Fix pnpm lock
imagoiq 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
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,16 +1,17 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
import prettier from 'prettier'; | ||
import htmlParser from 'prettier/parser-html'; | ||
import babelParser from 'prettier/parser-babel'; | ||
import babelParser from 'prettier/plugins/babel'; | ||
import htmlParser from 'prettier/plugins/html'; | ||
import prettier from 'prettier/standalone'; | ||
import { Observable, from, of } from 'rxjs'; | ||
|
||
@Pipe({ | ||
name: 'formatCode' | ||
}) | ||
export class FormatCodePipe implements PipeTransform { | ||
|
||
transform(value: string, parser: prettier.BuiltInParserName | prettier.CustomParser = 'html'): string { | ||
if (!value || !value.length) { return value; } | ||
return prettier.format(value, { parser, plugins: [htmlParser, babelParser], htmlWhitespaceSensitivity: 'ignore' }); | ||
transform(value: string): Observable<string> { | ||
if (!value || !value.length) { return of(value); } | ||
return from(prettier.format(value, { parser: 'html', plugins: [htmlParser, babelParser], htmlWhitespaceSensitivity: 'ignore'})); | ||
} | ||
|
||
} |
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
2 changes: 1 addition & 1 deletion
2
packages/documentation-v7/.storybook/helpers/prettier-options.ts
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
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ import { canMigrateFile, createMigrationProgram } from '@angular/core/schematics | |
import * as cheerio from 'cheerio/lib/slim'; | ||
import { relative } from 'path'; | ||
import * as prettier from 'prettier'; | ||
import * as htmlParser from 'prettier/parser-html'; | ||
import * as htmlParser from 'prettier/plugins/html'; | ||
import { SourceFile } from 'typescript'; | ||
import { DomUpdate } from './dom-update'; | ||
|
||
|
@@ -103,7 +103,7 @@ export function getDomMigrationRule(...updates: DomUpdate[]): Rule { | |
const treeUpdateRecorder = tree.beginUpdate(treeFilePath); | ||
|
||
sourceElements | ||
.forEach(source => { | ||
.forEach(async source => { | ||
// get corresponding outputelement by cheerio-id | ||
const distElement = $outputElements.filter((_i, element) => $(element).data('cheerio-id') === source.id) | ||
.first() | ||
|
@@ -117,9 +117,14 @@ export function getDomMigrationRule(...updates: DomUpdate[]): Rule { | |
// remove old "element" out of tree file | ||
treeUpdateRecorder.remove(source.start, source.end - source.start); | ||
// write new "element" into the tree file | ||
|
||
|
||
const content = await prettier.format(distElement, PRETTIER_OPTIONS); | ||
const contentWithoutBreak = content.replace(/(\n|\r\n)$/, ''); | ||
Comment on lines
+122
to
+123
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. format method is now async: prettier/prettier#4459 (comment) |
||
|
||
treeUpdateRecorder.insertLeft( | ||
source.start, | ||
prettier.format(distElement, PRETTIER_OPTIONS).replace(/(\n|\r\n)$/, ''), | ||
contentWithoutBreak | ||
); | ||
}); | ||
|
||
|
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 |
---|---|---|
|
@@ -17,7 +17,9 @@ | |
|
||
// added a transition delay on the "z-index" so the button only moves back after all other transitions | ||
z-index: 0; | ||
transition: z-index 0s ease (0.5 * button.$btn-transition-duration), button.$btn-transition; | ||
transition: | ||
z-index 0s ease (0.5 * button.$btn-transition-duration), | ||
button.$btn-transition; | ||
Comment on lines
+20
to
+22
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. |
||
|
||
@include utilities.high-contrast-mode() { | ||
transition: none !important; | ||
|
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.
Oops, something went wrong.
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.
This rule is conflicting with the new prettier line break: https://prettier.io/blog/2023/07/05/3.0.0.html#fix-line-break-in-css-declaration-with-comma-14208httpsgithubcomprettierprettierpull14208-by-mvorisekhttpsgithubcommvorisek