anandthakker / doiuse

:bomb: Lint CSS for browser support against caniuse database.
MIT License
1.24k stars 51 forks source link

Remove default error from feature detect #75

Closed ismay closed 6 years ago

ismay commented 6 years ago

Currently doiuse will throw an error for unrecognised node types. Users using LESS with import statements are running into problems with this because the less parser introduced a new node type for import statements:

I believe the Less parser introduced a new node type (import) to the AST and it is entitled to do so. All PostCSS plugins should probably ignore node types they don't recognise, rather than throwing an error, as this allows for additional node types to be added to the AST by either the PostCSS standard CSS parser or by any of other PostCSS parsers (postcss-less, postcss-scss, sugarss etc).

By ignoring unrecognised node types doiuse will only warn about known syntax, and we can leave the check for syntax validity to other tools.

See discussion in https://github.com/ismay/stylelint-no-unsupported-browser-features/issues/36 and https://github.com/stylelint/stylelint/issues/2904.

As users might depend on their build breaking because of this I'm intending to publish this as a breaking change (i.e. new major version).

ismay commented 6 years ago

@ai, @anandthakker Requested a review, just to make sure noone disagrees with the decision to handle the problem in doiuse. I know you're both busy, so I'm not expecting any replies, but I just wanted to keep you both informed and give you the opportunity to object if you disagree.

If there aren't any objections I'll try to merge and release a new version this week.