Add eslint-plugin-compat package

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2020-06-09 16:32:18 -03:00
parent 044b6dca2b
commit f43537e460
5 changed files with 75 additions and 3 deletions

View File

@ -1,7 +1,8 @@
{
"extends": [
"eslint:recommended",
"plugin:no-jquery/deprecated"
"plugin:no-jquery/deprecated",
"plugin:compat/recommended"
],
"plugins": ["no-jquery"],
"env": {

View File

@ -181,7 +181,7 @@ var Console = {
var data = JSON.parse(xhr.responseText);
Console.ajaxCallback(data);
} catch (e) {
// eslint-disable-next-line no-console
// eslint-disable-next-line no-console, compat/compat
console.trace();
// eslint-disable-next-line no-console
console.log('Failed to parse JSON: ' + e.message);

View File

@ -527,6 +527,7 @@ Functions.suggestPassword = function (passwordForm) {
var pwchars = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWYXZ@!_.*/()[]-';
var passwordlength = 16; // do we want that to be dynamic? no, keep it simple :)
var passwd = passwordForm.generated_pw;
// eslint-disable-next-line compat/compat
var randomWords = new Int32Array(passwordlength);
passwd.value = '';
@ -534,7 +535,9 @@ Functions.suggestPassword = function (passwordForm) {
var i;
// First we're going to try to use a built-in CSPRNG
// eslint-disable-next-line compat/compat
if (window.crypto && window.crypto.getRandomValues) {
// eslint-disable-next-line compat/compat
window.crypto.getRandomValues(randomWords);
} else if (window.msCrypto && window.msCrypto.getRandomValues) {
// Because of course IE calls it msCrypto instead of being standard
@ -4498,12 +4501,14 @@ AJAX.registerOnload('functions.js', function () {
*/
$('a.take_theme').on('click', function () {
var what = this.name;
/* eslint-disable compat/compat */
if (window.opener && window.opener.document.forms.setTheme.elements.set_theme) {
window.opener.document.forms.setTheme.elements.set_theme.value = what;
window.opener.document.forms.setTheme.submit();
window.close();
return false;
}
/* eslint-enable compat/compat */
return true;
});
});

View File

@ -36,6 +36,7 @@
},
"devDependencies": {
"eslint": "^6.8.0",
"eslint-plugin-compat": "^3.7.0",
"eslint-plugin-no-jquery": "^2.3.2",
"stylelint": "^13.3.2",
"stylelint-config-recommended-scss": "^4.2.0",

View File

@ -322,6 +322,11 @@ arrify@^1.0.1:
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=
ast-metadata-inferer@^0.2.0-0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/ast-metadata-inferer/-/ast-metadata-inferer-0.2.0.tgz#a470e5d1d7402b18c6f7a1f3d6900723cfa07392"
integrity sha512-6yPph2NeCHNxoI/ZmjklYaLOSZDAx+0L0+wsXnF56FxmjxvUlYZSWcj1KXtXO8IufruQTzVFOjg1+IzdDazSPg==
astral-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
@ -390,6 +395,16 @@ browserslist@^4.11.1:
node-releases "^1.1.53"
pkg-up "^2.0.0"
browserslist@^4.12.0:
version "4.12.0"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.12.0.tgz#06c6d5715a1ede6c51fc39ff67fd647f740b656d"
integrity sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg==
dependencies:
caniuse-lite "^1.0.30001043"
electron-to-chromium "^1.3.413"
node-releases "^1.1.53"
pkg-up "^2.0.0"
callsites@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
@ -409,11 +424,21 @@ camelcase@^5.0.0, camelcase@^5.3.1:
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
caniuse-db@^1.0.30001059:
version "1.0.30001079"
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30001079.tgz#b12d77d8d09fc82a6eda726c93a6eb09b5c440e1"
integrity sha512-FDEnaPlS5YwjUaieK8lzcLFjvv4w6dpvuZvG56XZoxwlEkRpTkVVe+tiU2Rsl4iqpf/K0hae38w7G2jwMz8Thg==
caniuse-lite@^1.0.30001038, caniuse-lite@^1.0.30001039:
version "1.0.30001040"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001040.tgz#103fc8e6eb1d7397e95134cd0e996743353d58ea"
integrity sha512-Ep0tEPeI5wCvmJNrXjE3etgfI+lkl1fTDU6Y3ZH1mhrjkPlVI9W4pcKbMo+BQLpEWKVYYp2EmYaRsqpPC3k7lQ==
caniuse-lite@^1.0.30001043:
version "1.0.30001079"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001079.tgz#ed3e5225cd9a6850984fdd88bf24ce45d69b9c22"
integrity sha512-2KaYheg0iOY+CMmDuAB3DHehrXhhb4OZU4KBVGDr/YKyYAcpudaiUQ9PJ9rxrPlKEoJ3ATasQ5AN48MqpwS43Q==
ccount@^1.0.0:
version "1.0.4"
resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.4.tgz#9cf2de494ca84060a2a8d2854edd6dfb0445f386"
@ -549,6 +574,11 @@ convert-source-map@^1.7.0:
dependencies:
safe-buffer "~5.1.1"
core-js@^3.6.5:
version "3.6.5"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.5.tgz#7395dc273af37fb2e50e9bd3d9fe841285231d1a"
integrity sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==
cosmiconfig@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-6.0.0.tgz#da4fee853c52f6b1e6935f41c1a2fc50bd4a9982"
@ -653,6 +683,11 @@ electron-to-chromium@^1.3.390:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.403.tgz#c8bab4e2e72bf78bc28bad1cc355c061f9cc1918"
integrity sha512-JaoxV4RzdBAZOnsF4dAlZ2ijJW72MbqO5lNfOBHUWiBQl3Rwe+mk2RCUMrRI3rSClLJ8HSNQNqcry12H+0ZjFw==
electron-to-chromium@^1.3.413:
version "1.3.465"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.465.tgz#d692e5c383317570c2bd82092a24a0308c6ccf29"
integrity sha512-K/lUeT3NLAsJ5SHRDhK3/zd0tw7OUllYD8w+fTOXm6ljCPsp2qq+vMzxpLo8u1M27ZjZAjRbsA6rirvne2nAMQ==
emoji-regex@^7.0.1:
version "7.0.3"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
@ -685,6 +720,19 @@ escape-string-regexp@^1.0.5:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
eslint-plugin-compat@^3.7.0:
version "3.7.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-compat/-/eslint-plugin-compat-3.7.0.tgz#03f1ebb350a3c7eb93b6f461e200048e6008594b"
integrity sha512-A3uzSYqUjNj6rMyaBuU3l8wSCadZjeZRZ7WF3eU9vUT0JItiqRysjmYELkHHCpH8l7wRprUu4MZPr37lFCw7iA==
dependencies:
ast-metadata-inferer "^0.2.0-0"
browserslist "^4.12.0"
caniuse-db "^1.0.30001059"
core-js "^3.6.5"
lodash.memoize "4.1.2"
mdn-browser-compat-data "^1.0.21"
semver "7.3.2"
eslint-plugin-no-jquery@^2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-2.3.2.tgz#f2b007f24dbe2be0c0376323f8aac56b511ab24c"
@ -798,7 +846,7 @@ execall@^2.0.0:
dependencies:
clone-regexp "^2.1.0"
extend@^3.0.0:
extend@3.0.2, extend@^3.0.0:
version "3.0.2"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa"
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==
@ -1380,6 +1428,11 @@ locate-path@^5.0.0:
dependencies:
p-locate "^4.1.0"
lodash.memoize@4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=
lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
@ -1438,6 +1491,13 @@ mdast-util-compact@^2.0.0:
dependencies:
unist-util-visit "^2.0.0"
mdn-browser-compat-data@^1.0.21:
version "1.0.24"
resolved "https://registry.yarnpkg.com/mdn-browser-compat-data/-/mdn-browser-compat-data-1.0.24.tgz#c1ed5d540d090dd581ff86cae6e6a28d355ca421"
integrity sha512-bsddGzmUyQxYJ8yNTcTUuF6O7g/DgMa8/Cc9OHWG5u9zIMyamz6ocYuIQ1VosuLmKp5mIN33Biyf16Gn5Al9Qg==
dependencies:
extend "3.0.2"
meow@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/meow/-/meow-6.1.0.tgz#4ff4641818d3502afcddc631f94cb6971a581cb3"
@ -2034,6 +2094,11 @@ sass@^1.26.3:
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
semver@7.3.2:
version "7.3.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938"
integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==
semver@^6.1.2:
version "6.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"