Package Exports
- eslint-plugin-compat
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-compat) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
eslint-plugin-compat
WORK IN PROGRESS
Goals
- Allow configuration of target browser/s, percentage of feature supported
- Errors should report with the list of browsers no supported and the percentage of the feature
- Speed. This may involve caching the caniuse db
- Only lint against ES features and Web API's that cannot be polyfilled or transpiled
- Use caniuse and @kangax's compta table as endpoints for determining coverage
- Check the environment using
.eslintrcand enable rules like such.
"env": {
"browser": true,
"node": true,
"es6": true
},Idea
Default
22: navigator.serviceWorker
^^^^^^^^^^^^^ `ServiceWorker` is not supported in IE, Edge and Safari.
Has about 60% browser coverage 😢Targeting Browsers
// in `.eslintrc`
{
browsers: ['chrome >= 50', 'firefox', 'edge', 'safari >= 9'] // screw IE
compiler: 'babel'
} 22: navigator.serviceWorker
^^^^^^^^^^^^^ `ServiceWorker` is not supported in two of your target
browsers: Safari and Edge.Inspiration
This project was inspired by a two hour argument I had with someone on the experience of web development and if it is terrible or not. The premise they argued was that x browser doesn't support y feature while z browser does. Eventually, I agreed with him on this and checked made this plugin to save web developers from having to memorize browser compatibility of specs.