Repository navigation
feat: allow using both prettier and standardjs - #5679
Conversation
7923111 to
af4026d
Compare
af4026d to
8efbb5b
Compare
1f20935 to
ec450c5
Compare
9763a5b to
a3c69e4
Compare
|
@zkoppert can you please review this one? Thanks a lot! |
😅 |
- Allow using both Prettier and StandardJS at the same time by removing JAVASCRIPT_DEFAULT_STYLE and TYPESCRIPT_DEFAULT_STYLE configuration variables. They create a confusing corner case that Super-linter already handles with its core logic that's in place to enable and disable linters. - Document VALIDATE_JAVASCRIPT_PRETTIER and VALIDATE_TYPESCRIPT_PRETTIER because they were missing from the README. - Add missing TYPESCRIPT_PRETTIER tests.
a3c69e4 to
0f9bab9
Compare
|
sorry, forgot to fix the upgrade guide :) |
|
This was correctly labelled as a breaking change, as it means that super-linter behaviour changes unless you update the configuration options, and yet it was released without a major version bump. This is a shame; I'm sure a lot of CI runs will currently be failing due to the change. The changes also mean that with default configuration, both the standard and prettier formatters are enabled. I don't think these two have compatible styles, so doesn't that mean all JS/TS files will fail linting by default? |
|
Hi! You might have a point here, although the reason why we didn't mark this as a breaking change is that enabling this behavior has always been possible, but it wasn't documented. The fact that they didn't run at the same time created a confusing corner case, which we classified as a bug, as you can also see from the fact that we were missing both documentation and a test case. |
|
The thing that makes it a "confusing corner case" is that standard and prettier are formatters, not linters. It makes sense to run lots of linters to pick up issues in a variety of file types. IMO it never makes sense to run multiple formatters (for the same file type), as they are not going to agree on the correct style - if they did then one of them would be redundant. The old config option made much more sense to me that what was introduced here. Layer on top of that the fact it breaks existing configuration without a major version bump, and probably breaks out-of-the-box default configuration for JS/TS files, then my suggestion would be to roll back the change and re-consider how and when the changes should be re-introduced. |
|
Again, you have a point in suggesting that users might want to run only one formatter per file type. The confusing corner case I'm referring to is that, before this change, to do that for Standard and Prettier, you would need to set the The issue, in this case, is that the
This is why this change was necessary. The points you're raising warrant an addition to the upgrade guide, though. I'll provide it in a separate PR. |
Proposed changes
JAVASCRIPT_DEFAULT_STYLE and TYPESCRIPT_DEFAULT_STYLE
configuration variables. They create a confusing corner case that
Super-linter already handles with its core logic that's in place to
enable and disable linters.
because they were missing from the README.
See the Upgrade guide for guidance about how to update your Super-linter configuration.
Readiness checklist
In order to have this pull request merged, complete the following tasks.
Pull request author tasks
I added the
Fix #ISSUE_NUMBERlabel to the description of the pull request.Super-linter maintainer tasks
breakingif this change breaks compatibility with the previous released version.automation,bug,documentation,enhancement,infrastructure.