🏗 Pre-emptive lint fixes + clean up#30700
🏗 Pre-emptive lint fixes + clean up#30700rsimha merged 4 commits intoampproject:masterfrom rsimha:2020-10-16-PrettierFixes
Conversation
|
@morsssss to approve doc changes. |
morsssss
left a comment
There was a problem hiding this comment.
To me at least, in general the HTML that was changed here looked better before these linting changes. In some cases, there were ellipses indicating more HTML would be used in the real world... I also prefer that templates be on their own line, not sandwiched between <template> and </template> on a single line.
What do you think? Do you prefer the new layouts? Or are these simply a result of standardizing linting?
In a couple of cases, the <template> tags did seem to confuse the linter.
|
Hey @gmajoulet, @newmuis, @Enriqe! These files were changed: |
There was a problem hiding this comment.
What do you think? Do you prefer the new layouts? Or are these simply a result of standardizing linting?
@morsssss This is the eternal battle between flexibility and standardization that Prettier makes us wage 😃
From a technical standpoint, Prettier isn't making these decisions, it's merely using the underlying markdown formatting standard, which now prescribes unwrapping multi-line blocks that can fit on a single line. Personally, I'm not against the unwrapping because there are already several similar instances across our code base (example). I can add manual overrides to prevent these <template> blocks from being unwrapped, but it will introduce a maintenance burden on MD authors, and potentially result in a loss of standardization in future.
I'm happy to defer to you on this one. Let me know what you think!
|
After chatting offline with @morsssss, we decided to disable all automatic language-specific formatting inside MD files. As a result, this PR no longer contains any of the unwrapping it earlier did. |
kristoferbaxter
left a comment
There was a problem hiding this comment.
One small question, otherwise looks great.
|
thanks @rsimha ! |
Yarn can sometimes incorrectly resolve caret semver versions in its lockfile (typically during upgrades). E.g.
prettierversion^2.0.0is resolved to2.0.1instead of2.1.2inyarn.lock(search for"prettier@^2.0.0:"). NPM correctly resolves caret versions, and doesn't have this bug.This PR contains a couple of pre-emptive fixes that will prevent a bunch of new Prettier errors from appearing when we switch from Yarn to NPM:
gulp lintto explicitly ignore files in.gitignoreprettierversion forgulp lintandgulp prettifyWith this PR, the switch from Yarn to NPM should be free of any new linting errors.
Unblocks #30694