-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Description
To avoid the usage of JS functions which are not supported by some browsers we should introduce eslinter for this.
There exist a plugin for this type of linting:
npm install --save-dev eslint-plugin-compatBased on the browserslist which can be dumped by running:
npx browserslistand configured the following way in the project package.json:
"browserslist": [
"> 0.25% in my stats",
"> 0.5% in CH",
"last 3 version and not dead"
]if a polyfill is added it can be configured the following way:
{
"root": true,
"extends": [
// ...
"plugin:compat/recommended"
],
"settings": {
"polyfills": [
"fetch",
"Object.values",
"Object.assign",
"Promise",
"URL",
"URLSearchParams",
"Symbol",
"Array.keys",
"Array.from"
]
},
// ...
}polyfills can mostly be included over the exist core-js or whatwg-fetch from github:
import 'whatwg-fetch';
import 'core-js/features/url';
import 'core-js/features/url-search-params';
import 'core-js/features/object/assign';
import 'core-js/features/object/values';
import 'core-js/features/promise';
import 'core-js/features/symbol';
import 'core-js/features/array/keys';
import 'core-js/features/array/from';
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request