From bb61ee1fa1963d745b61f38ea897fe3f5d59aaa0 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Tue, 19 Sep 2023 16:19:48 +0100 Subject: [PATCH] chore: lint for browser compatability so humans don't have to (#17527) * chore: lint for browser compatability so humans don't have to * Doh * Update UI snapshots for `chromium` (1) * we already do not support opera mini * Update UI snapshots for `chromium` (1) --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- .eslintrc.js | 3 ++- package.json | 3 ++- pnpm-lock.yaml | 37 +++++++++++++++++++++++++++++++++---- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 3d730b9f777bc..fd211bf936672 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -26,6 +26,7 @@ module.exports = { 'plugin:eslint-comments/recommended', 'plugin:storybook/recommended', 'prettier', + 'plugin:compat/recommended', ], globals, parser: '@typescript-eslint/parser', @@ -36,7 +37,7 @@ module.exports = { ecmaVersion: 2018, sourceType: 'module', }, - plugins: ['prettier', 'react', 'cypress', '@typescript-eslint', 'no-only-tests', 'jest'], + plugins: ['prettier', 'react', 'cypress', '@typescript-eslint', 'no-only-tests', 'jest', 'compat'], rules: { 'no-console': ['error', { allow: ['warn', 'error'] }], 'no-debugger': 'error', diff --git a/package.json b/package.json index be3be7cd6ae02..fdba7a9ba481e 100644 --- a/package.json +++ b/package.json @@ -236,6 +236,7 @@ "cypress-terminal-report": "^5.1.1", "eslint": "^7.8.0", "eslint-config-prettier": "^8.8.0", + "eslint-plugin-compat": "^4.2.0", "eslint-plugin-cypress": "^2.13.3", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-jest": "^27.2.3", @@ -305,7 +306,7 @@ "last 2 edge versions" ], "production": [ - "defaults" + "defaults and not not op_mini all" ] }, "browser": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 301601dff1e49..fe9b10658597e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -513,6 +513,9 @@ devDependencies: eslint-config-prettier: specifier: ^8.8.0 version: 8.8.0(eslint@7.32.0) + eslint-plugin-compat: + specifier: ^4.2.0 + version: 4.2.0(eslint@7.32.0) eslint-plugin-cypress: specifier: ^2.13.3 version: 2.13.3(eslint@7.32.0) @@ -3146,6 +3149,10 @@ packages: maxmind: 4.3.8 dev: false + /@mdn/browser-compat-data@5.3.16: + resolution: {integrity: sha512-b0kKg2weqKDLI+Ai5+tocgUEIidccdSfzUndbS2YnwIp5aVvd3M0D+DCcbrsSOSgMyrV9QKMqogtqMIjKwvDxw==} + dev: true + /@mdx-js/react@2.3.0(react@16.14.0): resolution: {integrity: sha512-zQH//gdOmuu7nt2oJR29vFhDv88oGPmVw6BggmrHeMI+xgEkp1B2dX9/bMBSYtK0dyLX/aOmesKS09g222K1/g==} peerDependencies: @@ -7222,6 +7229,12 @@ packages: util: 0.12.5 dev: true + /ast-metadata-inferer@0.8.0: + resolution: {integrity: sha512-jOMKcHht9LxYIEQu+RVd22vtgrPaVCtDRQ/16IGmurdzxvYbDd5ynxjnyrzLnieG96eTcAyaoj/wN/4/1FyyeA==} + dependencies: + '@mdn/browser-compat-data': 5.3.16 + dev: true + /ast-types@0.14.2: resolution: {integrity: sha512-O0yuUDnZeQDL+ncNGlJ78BiO4jnYI3bvMsD5prT0/nsgijG/LpNBIr63gTjVTNsiGkgQhiyCShTgxt8oXOrklA==} engines: {node: '>=4'} @@ -7655,7 +7668,7 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001521 + caniuse-lite: 1.0.30001538 electron-to-chromium: 1.4.492 node-releases: 2.0.13 update-browserslist-db: 1.0.11(browserslist@4.21.10) @@ -7800,7 +7813,7 @@ packages: resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} dependencies: browserslist: 4.21.10 - caniuse-lite: 1.0.30001521 + caniuse-lite: 1.0.30001538 lodash.memoize: 4.1.2 lodash.uniq: 4.5.0 dev: true @@ -7809,8 +7822,8 @@ packages: resolution: {integrity: sha512-IB1BXTZKPDVPM7cnV4iaKaHxckvdr/3xtctB3f7Hmenx3qYBhGtTZ//7EllK66aKXW98Lx0+7Yr0kxBtIt3tzg==} dev: true - /caniuse-lite@1.0.30001521: - resolution: {integrity: sha512-fnx1grfpEOvDGH+V17eccmNjucGUnCbP6KL+l5KqBIerp26WK/+RQ7CIDE37KGJjaPyqWXXlFUyKiWmvdNNKmQ==} + /caniuse-lite@1.0.30001538: + resolution: {integrity: sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw==} /case-anything@2.1.10: resolution: {integrity: sha512-JczJwVrCP0jPKh05McyVsuOg6AYosrB9XWZKbQzXeDAm2ClE/PJE/BcrrQrVyGYH7Jg8V/LDupmyL4kFlVsVFQ==} @@ -9837,6 +9850,22 @@ packages: eslint: 7.32.0 dev: true + /eslint-plugin-compat@4.2.0(eslint@7.32.0): + resolution: {integrity: sha512-RDKSYD0maWy5r7zb5cWQS+uSPc26mgOzdORJ8hxILmWM7S/Ncwky7BcAtXVY5iRbKjBdHsWU8Yg7hfoZjtkv7w==} + engines: {node: '>=14.x'} + peerDependencies: + eslint: ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + '@mdn/browser-compat-data': 5.3.16 + ast-metadata-inferer: 0.8.0 + browserslist: 4.21.10 + caniuse-lite: 1.0.30001538 + eslint: 7.32.0 + find-up: 5.0.0 + lodash.memoize: 4.1.2 + semver: 7.5.4 + dev: true + /eslint-plugin-cypress@2.13.3(eslint@7.32.0): resolution: {integrity: sha512-nAPjZE5WopCsgJwl3vHm5iafpV+ZRO76Z9hMyRygWhmg5ODXDPd+9MaPl7kdJ2azj+sO87H3P1PRnggIrz848g==} peerDependencies: