multi-account-containers/.eslintrc.js
Stephen Thompson 65243e2c06 eslint ecmaVersion to 2021
CONTRIBUTING.md specifies the minimum supported Firefox version as 91.1.0.

Based on the caniuse.com data for ECMAScript features listed at https://gist.github.com/Julien-Marcou/156b19aea4704e1d2f48adafc6e2acbf, I determined the following minimum Firefox versions that support each ECMAScript version:

- ECMAScript 2018 (current setting) = Firefox 78
- ECMAScript 2019 = Firefox 64
- ECMAScript 2020 = Firefox 80
- ECMAScript 2021 = Firefox 79
- ECMAScript 2022 = Firefox 92
- ECMAScript 2023 = Firefox 104
- ECMAScript 2024 = Firefox 119+ (not exactly sure)

This project is using v7 of eslint which depends on v7 of espree for JavaScript parsing. espree v7 has a maximum ECMAScript support version of ECMAScript 2021.

Based on these findings, increasing the configured `parser.ecmaVersion` from `2018` to `2021` will allow using all JavaScript syntax supported in Firefox 91.1.0+ without raising eslint errors.
2025-04-23 15:09:26 -04:00

69 lines
1.5 KiB
JavaScript

module.exports = {
"parserOptions": {
"ecmaVersion": 2021
},
"env": {
"browser": true,
"es6": true,
"node": true,
"webextensions": true
},
"globals": {
"Utils": true,
"CustomizableUI": true,
"CustomizableWidgets": true,
"SessionStore": true,
"Services": true,
"Components": true,
"XPCOMUtils": true,
"OS": true,
"ADDON_UNINSTALL": true,
"ADDON_DISABLE": true,
"CONTAINER_ORDER_STORAGE_KEY": true,
"proxifiedContainers": true,
"MozillaVPN": true,
"MozillaVPN_Background": true
},
"plugins": [
"promise",
"no-unsanitized"
],
"extends": [
"eslint:recommended"
],
"root": true,
"rules": {
"promise/always-return": "off",
"promise/avoid-new": "off",
"promise/catch-or-return": "error",
"promise/no-callback-in-promise": "warn",
"promise/no-native": "off",
"promise/no-nesting": "warn",
"promise/no-promise-in-callback": "warn",
"promise/no-return-wrap": "error",
"promise/param-names": "error",
"no-unsanitized/method": [
"error"
],
"no-unsanitized/property": [
"error",
{
"escape": {
"taggedTemplates": ["Utils.escaped"]
}
}
],
"eqeqeq": "error",
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"no-throw-literal": "error",
"no-warning-comments": "warn",
"no-var": "error",
"prefer-const": "error",
"quotes": ["error", "double"],
"radix": "error",
"semi": ["error", "always"]
}
};