2019-10-29 19:19:19 +01:00
|
|
|
// get polyfill settings from top level config
|
|
|
|
// @ts-ignore
|
|
|
|
const { settings } = require('../../../.eslintrc.json');
|
|
|
|
|
|
|
|
// Adding non-polyfilable Symbol-related functions as they are most probably
|
|
|
|
// behind the flag
|
|
|
|
|
2019-11-02 13:58:18 +01:00
|
|
|
settings.polyfills.push(
|
|
|
|
'Symbol.toStringTag',
|
|
|
|
'Symbol.for',
|
|
|
|
'Object.getOwnPropertySymbols',
|
|
|
|
'Object.getOwnPropertyDescriptors',
|
|
|
|
'Promise', // Promise is gate checked
|
|
|
|
);
|
2019-10-29 19:19:19 +01:00
|
|
|
|
2019-11-02 13:58:18 +01:00
|
|
|
module.exports = /** @type {import('eslint').Linter.Config} */ ({
|
2019-10-29 19:19:19 +01:00
|
|
|
root: true,
|
2019-11-02 13:58:18 +01:00
|
|
|
extends: ['plugin:compat/recommended'],
|
2019-10-29 19:19:19 +01:00
|
|
|
parserOptions: {
|
|
|
|
// ensure that it's compatible with ES5 browsers, so, no `const`, etc
|
2019-11-02 13:58:18 +01:00
|
|
|
ecmaVersion: 5,
|
2019-10-29 19:19:19 +01:00
|
|
|
},
|
|
|
|
env: {
|
2019-11-02 13:58:18 +01:00
|
|
|
browser: true,
|
2019-10-29 19:19:19 +01:00
|
|
|
},
|
2019-11-02 13:58:18 +01:00
|
|
|
settings,
|
|
|
|
});
|