-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
Simplify eslint configs, modernize eslint config for docsJS #42270
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
Open
mdo
wants to merge
1
commit into
v6-dev
Choose a base branch
from
v6-js-tweaks
base: v6-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
You can't just use latest. What is latest now, won't be the same latest later and so on... IMHO we should just stop having hardcoded browser versions in .browserslistrc and just support latest. Then, this change would be OK too and we could drop babel and co altogether.
Uh oh!
There was an error while loading. Please reload this page.
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.
To be fair our browserslist is outdated anyway or should I say incompatible with the CSS features we use in v6 (and maybe even v5 to some extent).
While Babel handles transpiling/polyfilling our JS, not sure about the CSS. I know we have autoprefixer in place but that handles only vendor prefixes not any sort of workarounds or polyfills. (Maybe postcss does?)
I wanted to open a discussion about this already, but due lack of time (as usual 😔) I wasn't able to, yet. I meant to propose to maybe use some baseline definition e.g.
baseline widely available(see https://github.com/browserslist/browserslist?tab=readme-ov-file#queries). To read more about baseline in general you may want to check out https://web-platform-dx.github.io/web-features/. Besides that MDN or CanIUse shows the baseline support too, so I'd say it's already something that is well adopted.Also I already locally tested some stylelint plugins to check if we use CSS that matches the browsers we wanted to support.
Those three I tried been
stylelint-no-unsupported-browser-features,stylelint-browser-compatandstylelint-plugin-use-baseline.There are pros and cons to all of them -
stylelint-no-unsupported-browser-featuresandstylelint-browser-compatare more verbose about browser incompatibility like showing versions that don't support a certain feature, on the other handstylelint-plugin-use-baselinedoesn't. It just tell you that a feature isn't available.On the positive side
stylelint-plugin-use-baselineis very configurable compared to the other two and it looks like it's the most consistent in finding unsupported properties/values.Eslint has support for baseline too: https://baselinejs.vercel.app/ or eslint-plugin-compat
Last but not least with our current browserslist we support 87.5% of global users (according to https://browsersl.ist/)
While
baseline widely available with downstreamcovers 89.3%Important
I have to mention that we use some CSS in v6 that isn't "widely available" yet because it's too new.
@mdo @XhmikosR thoughts?