question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] webhint ignores .browserslistrc in subfolder

See original GitHub issue

Environment (please complete the following information):

  • OS: Windows 10
  • Extension version: 2.0.0
  • Angular application (13.1.0)

Describe the bug:

I have an angular application and browsers are restricted to last 2 Edge versions in .browserslistrc. There are still hints (warnings/errors) about browser compatability. E.g. scss width: fit-content produces

width: fit-content’ is not supported by Firefox, Firefox for Android. Add ‘width: -moz-fit-content’ to support Firefox 3+, Firefox for Android 4+.Microsoft Edge Tools compat-api/css

Adding a .hintrc with

{
  "browserslist": [
    "last 2 Edge versions"
  ]
}

didn’t help either.

(When I open a folder with only a scss file with such a property and the .hintrc it does work as expected.)

Repro steps:

  1. Create new angular application
  2. Restrict .browserslistrc to last 2 Edge versions (or major)
  3. Add .test { width: fit-content; } to app.component.scss

Expected behavior:

Only hint warnings/errors for browsers supported by the application.

Additional context:

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gunnarburmeistercommented, Jun 13, 2022

@antross Sorry for the late reply. I got sick and will only be able to check on this next week again on work. I didn’t update the .browserslistrc for this originally though. I just switched from the deprecated edge debugger to the new extension.

I did a quick test on my home machine and it seems to work fine here (not my work projekt though). Maybe I have some other conflicting extension installed on my work machine.

0reactions
antrosscommented, Jun 14, 2022

Thanks @gunnarburmeister for the additional detail. Indeed, webhint only currently looks in the root of the workspace which seems to be the problem. I updated the issue title slightly to reflect this.

A full fix here likely involves having webhint lookup configs on a per-file basis (so it can look up the ancestor folder hierarchy of each given file for relevant configs rather than assuming the configs live at the workspace level).

FYI @vidorteg

Read more comments on GitHub >

github_iconTop Results From Across the Web

Browser configuration | webhint documentation
If you need to configure browsers for webhint without affecting other tools, you can specify a browserslist property in your .hintrc file using...
Read more >
vscode-edge-devtools - bytemeta
Unable to start webhint. Ensure you are using the latest version of the `hint` ... [BUG] webhint ignores .browserslistrc in subfolder. Lakshmikanth2001.
Read more >
open column ranges for more commands - Shenwei356/Csvtk
[BUG] webhint ignores .browserslistrc in subfolder, 7, 2022-06-08, 2022-08-29. Support optional YAML per AppConfigStore instance for feature_flags ...
Read more >
Can the grid template columns of internet explorer be compatible ...
#663 opened this issue Nov 18, 2021 · 10 comments Assignees Labels bug Something isn't working tracked Comments Copy link commented • edited....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found