From 2fa534a2e2aa30010b07791ff8db75689bda21e1 Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Mon, 9 Sep 2024 15:54:49 +0200 Subject: [PATCH] Switch eslint-plugin-jsx-expressions to @eslint-react (#424) --- eslint.config.js | 2 - index.js | 14 +- package.json | 2 +- pnpm-lock.yaml | 202 ++++++++++++++++++ renovate.json5 | 31 ++- .../eslint-plugin-jsx-expressions/README.md | 41 ---- .../dist/index.js | 10 - .../dist/index.js.map | 1 - .../dist/rules/index.js | 11 - .../dist/rules/index.js.map | 1 - .../dist/rules/strict-logical-expressions.js | 127 ----------- .../rules/strict-logical-expressions.js.map | 1 - .../dist/util/createRule.js | 10 - .../dist/util/createRule.js.map | 1 - .../dist/util/types.js | 14 -- .../dist/util/types.js.map | 1 - .../package.json | 3 - 17 files changed, 223 insertions(+), 249 deletions(-) delete mode 100644 vendor/eslint-plugin-jsx-expressions/README.md delete mode 100644 vendor/eslint-plugin-jsx-expressions/dist/index.js delete mode 100644 vendor/eslint-plugin-jsx-expressions/dist/index.js.map delete mode 100644 vendor/eslint-plugin-jsx-expressions/dist/rules/index.js delete mode 100644 vendor/eslint-plugin-jsx-expressions/dist/rules/index.js.map delete mode 100644 vendor/eslint-plugin-jsx-expressions/dist/rules/strict-logical-expressions.js delete mode 100644 vendor/eslint-plugin-jsx-expressions/dist/rules/strict-logical-expressions.js.map delete mode 100644 vendor/eslint-plugin-jsx-expressions/dist/util/createRule.js delete mode 100644 vendor/eslint-plugin-jsx-expressions/dist/util/createRule.js.map delete mode 100644 vendor/eslint-plugin-jsx-expressions/dist/util/types.js delete mode 100644 vendor/eslint-plugin-jsx-expressions/dist/util/types.js.map delete mode 100644 vendor/eslint-plugin-jsx-expressions/package.json diff --git a/eslint.config.js b/eslint.config.js index f71111e..b6503dd 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -7,8 +7,6 @@ const config = [ ignores: [ // Tests '__tests__/**/*', - // Vendored packages (workarounds for incompatibilities) - 'vendor/**/*', ], }, ]; diff --git a/index.js b/index.js index 95627dd..042d9ab 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,7 @@ import eslintImportX from 'eslint-plugin-import-x'; import jsxA11y from 'eslint-plugin-jsx-a11y'; import react from 'eslint-plugin-react'; import reactHooks from 'eslint-plugin-react-hooks'; +import * as reactX from 'eslint-plugin-react-x'; import security from 'eslint-plugin-security'; import sonarjs from 'eslint-plugin-sonarjs'; import unicorn from 'eslint-plugin-unicorn'; @@ -16,7 +17,6 @@ import upleveled from 'eslint-plugin-upleveled'; import globals from 'globals'; import isPlainObject from 'is-plain-obj'; import stripJsonComments from 'strip-json-comments'; -import jsxExpressions from './vendor/eslint-plugin-jsx-expressions/dist/index.js'; /** @type * {import('@typescript-eslint/utils/ts-eslint').FlatConfig.RuleLevelAndOptions} @@ -512,8 +512,9 @@ const configArray = [ '@typescript-eslint': { rules: eslintTypescript.rules, }, + 'import-x': eslintImportX, 'jsx-a11y': jsxA11y, - 'jsx-expressions': jsxExpressions, + 'react-x': reactX, 'react-hooks': // Fix eslint-plugin-react-hooks for ESLint 9 // @@ -526,7 +527,6 @@ const configArray = [ reactHooks ), ), - 'import-x': eslintImportX, react: fixupPluginRules(react), security, sonarjs: { @@ -847,10 +847,6 @@ const configArray = [ // Disable obsolete rule // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/398#issuecomment-728976688 'jsx-a11y/no-onchange': 'off', - // Disallow potentially falsey string and number values in - // logical && expressions - // https://github.com/hpersson/eslint-plugin-jsx-expressions/blob/master/docs/rules/strict-logical-expressions.md - 'jsx-expressions/strict-logical-expressions': 'error', // Warn on async promise executor function // https://github.com/eslint/eslint/blob/main/docs/src/rules/no-async-promise-executor.md 'no-async-promise-executor': 'warn', @@ -930,6 +926,10 @@ const configArray = [ // Error on passing children to void elements // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md 'react/void-dom-elements-no-children': 'error', + // Disallow potentially falsey string and number values in + // logical && expressions + // https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering + 'react-x/no-leaked-conditional-rendering': 'error', // Error on trojan source code attacks using bidirectional // characters // https://github.com/eslint-community/eslint-plugin-security/blob/main/docs/rules/detect-bidi-characters.md diff --git a/package.json b/package.json index 917c92c..1378442 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "files": [ "bin", "templates", - "vendor", "index.js", "index.d.ts", "tsconfig.base.json" @@ -46,6 +45,7 @@ "eslint-plugin-import-x": "4.2.1", "eslint-plugin-jsx-a11y": "6.10.0", "eslint-plugin-react": "7.35.2", + "eslint-plugin-react-x": "1.13.1", "eslint-plugin-react-hooks": "4.6.2", "eslint-plugin-security": "3.0.1", "eslint-plugin-sonarjs": "1.0.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 442ef2c..f97a511 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,6 +53,9 @@ importers: eslint-plugin-react-hooks: specifier: 4.6.2 version: 4.6.2(eslint@9.9.1) + eslint-plugin-react-x: + specifier: 1.13.1 + version: 1.13.1(eslint@9.9.1)(typescript@5.5.4) eslint-plugin-security: specifier: 3.0.1 version: 3.0.1 @@ -249,6 +252,27 @@ packages: resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + '@eslint-react/ast@1.13.1': + resolution: {integrity: sha512-pMAfQ4RWugwhPZJyD5KdPamaniW6XRehcMgGQLcpEyQejOWRF79Zfj7/Rwbt5tmNgymJs/8G0ySw8npswKh8Tg==} + + '@eslint-react/core@1.13.1': + resolution: {integrity: sha512-ZphfhweurpMmGxiMSvPbvqibrK9IN53fCs63YUNONw5xM2QCdqyozamRZlh376YqCuPXl//eqigryXRNLr6Wzw==} + + '@eslint-react/jsx@1.13.1': + resolution: {integrity: sha512-fxcJe7PKUSslRBwpyYDuS57ZnX2TjbvONg2EkM/KDqcgRW43f6RNief6pyZaeI5Q85WveKKNSynexRCh2buCOg==} + + '@eslint-react/shared@1.13.1': + resolution: {integrity: sha512-GTJNQJh2Ne4JD2SY+t3E6Rc1qPBssq+xC7m8aNivWmY6IUb76ePAy7uhoc+xT+Np0yXN1DK/tHO1XAJ8WaX2bA==} + + '@eslint-react/tools@1.13.1': + resolution: {integrity: sha512-Wt6IcAVk91+7OQVUU6GpqgPZuEZQXbp4YtFavZHEyt8bNkABQp26nQiOX06et/Ax3TSPw/OA9GcWHMjQgVO8Qw==} + + '@eslint-react/types@1.13.1': + resolution: {integrity: sha512-MVhBr3XYvug0UZHqbW3uxIVNJsjMi8nAxOtK94ZKNJcI+WHG7N4PXV/TO6SE04GLq+QfKq164l4awwE29wFKPQ==} + + '@eslint-react/var@1.13.1': + resolution: {integrity: sha512-C6DNNbAdIieRl00q08RUA3l5tW3Mh8noB6E8dXHWY+o0Xp28cnSBocf92d3dYJZAREJiNoyOyxyQhNUlCnTL5w==} + '@eslint/compat@1.1.1': resolution: {integrity: sha512-lpHyRyplhGPL5mGEh6M9O5nnKk0Gz4bFI+Zu6tKlPpDUN7XshWvH9C/px4UVm87IAANE0W81CEsNGbS1KlzXpA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -613,6 +637,9 @@ packages: resolution: {integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==} engines: {node: '>=0.6'} + birecord@0.1.1: + resolution: {integrity: sha512-VUpsf/qykW0heRlC8LooCq28Kxn3mAqKohhDG/49rrsQ1dT1CXyj/pgXS+5BSRzFTR/3DyIBOqQOrGyZOh71Aw==} + brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -958,6 +985,16 @@ packages: peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 + eslint-plugin-react-x@1.13.1: + resolution: {integrity: sha512-g80+xGU+Nz7bU/F4MQ3dHoLzfVFDOGTBrVFkuy7XlTzID6h0c6L8ejoD+2Cq0TNHGi3+b+lVTVoizoJDZSO2Qg==} + engines: {bun: '>=1.0.15', node: '>=18.18.0'} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: ^4.9.5 || ^5.3.3 + peerDependenciesMeta: + typescript: + optional: true + eslint-plugin-react@7.35.0: resolution: {integrity: sha512-v501SSMOWv8gerHkk+IIQBkcGRGrO2nfybfj5pLxuJNFTPxxA3PSryhXTK+9pNbtkggheDdsC0E9Q8CuPk6JKA==} engines: {node: '>=4'} @@ -1330,6 +1367,12 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-immutable-type@5.0.0: + resolution: {integrity: sha512-mcvHasqbRBWJznuPqqHRKiJgYAz60sZ0mvO3bN70JbkuK7ksfmgc489aKZYxMEjIbRvyOseaTjaRZLRF/xFeRA==} + peerDependencies: + eslint: '*' + typescript: '>=4.7.4' + is-map@2.0.2: resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==} @@ -1529,6 +1572,10 @@ packages: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} + minimatch@10.0.1: + resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==} + engines: {node: 20 || >=22} + minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -1674,6 +1721,10 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + pluralize@8.0.0: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} @@ -1843,6 +1894,10 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + short-unique-id@5.2.0: + resolution: {integrity: sha512-cMGfwNyfDZ/nzJ2k2M+ClthBIh//GlZl1JEf47Uoa9XR11bz8Pa2T2wQO4bVrRdH48LrIDWJahQziKo3MjhsWg==} + hasBin: true + side-channel@1.0.6: resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} engines: {node: '>= 0.4'} @@ -1897,6 +1952,9 @@ packages: resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} engines: {node: '>= 0.4'} + string-ts@2.2.0: + resolution: {integrity: sha512-VTP0LLZo4Jp9Gz5IiDVMS9WyLx/3IeYh0PXUn0NdPqusUFNgkHPWiEdbB9TU2Iv3myUskraD5WtYEdHUrQEIlQ==} + string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -2002,6 +2060,14 @@ packages: peerDependencies: typescript: '>=4.2.0' + ts-declaration-location@1.0.4: + resolution: {integrity: sha512-r4JoxYhKULbZuH81Pjrp9OEG5St7XWk7zXwGkLKhmVcjiBVHTJXV5wK6dEa9JKW5QGSTW6b1lOjxAKp8R1SQhg==} + peerDependencies: + typescript: '>=4.0.0' + + ts-pattern@5.3.1: + resolution: {integrity: sha512-1RUMKa8jYQdNfmnK4jyzBK3/PS/tnjcZ1CW0v1vWDeYe5RBklc/nquw03MEoB66hVBm4BnlCfmOqDVxHyT1DpA==} + tsconfig-paths@3.15.0: resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} @@ -2284,6 +2350,92 @@ snapshots: '@eslint-community/regexpp@4.11.0': {} + '@eslint-react/ast@1.13.1(eslint@9.9.1)(typescript@5.5.4)': + dependencies: + '@eslint-react/tools': 1.13.1 + '@eslint-react/types': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/typescript-estree': 8.4.0(typescript@5.5.4) + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1)(typescript@5.5.4) + birecord: 0.1.1 + string-ts: 2.2.0 + ts-pattern: 5.3.1 + transitivePeerDependencies: + - eslint + - supports-color + - typescript + + '@eslint-react/core@1.13.1(eslint@9.9.1)(typescript@5.5.4)': + dependencies: + '@eslint-react/ast': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@eslint-react/jsx': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@eslint-react/shared': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@eslint-react/tools': 1.13.1 + '@eslint-react/types': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@eslint-react/var': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.4.0 + '@typescript-eslint/type-utils': 8.4.0(eslint@9.9.1)(typescript@5.5.4) + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1)(typescript@5.5.4) + birecord: 0.1.1 + short-unique-id: 5.2.0 + ts-pattern: 5.3.1 + transitivePeerDependencies: + - eslint + - supports-color + - typescript + + '@eslint-react/jsx@1.13.1(eslint@9.9.1)(typescript@5.5.4)': + dependencies: + '@eslint-react/ast': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@eslint-react/tools': 1.13.1 + '@eslint-react/types': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@eslint-react/var': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.4.0 + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1)(typescript@5.5.4) + ts-pattern: 5.3.1 + transitivePeerDependencies: + - eslint + - supports-color + - typescript + + '@eslint-react/shared@1.13.1(eslint@9.9.1)(typescript@5.5.4)': + dependencies: + '@eslint-react/tools': 1.13.1 + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1)(typescript@5.5.4) + picomatch: 4.0.2 + transitivePeerDependencies: + - eslint + - supports-color + - typescript + + '@eslint-react/tools@1.13.1': {} + + '@eslint-react/types@1.13.1(eslint@9.9.1)(typescript@5.5.4)': + dependencies: + '@eslint-react/tools': 1.13.1 + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1)(typescript@5.5.4) + transitivePeerDependencies: + - eslint + - supports-color + - typescript + + '@eslint-react/var@1.13.1(eslint@9.9.1)(typescript@5.5.4)': + dependencies: + '@eslint-react/ast': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@eslint-react/tools': 1.13.1 + '@eslint-react/types': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.4.0 + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1)(typescript@5.5.4) + ts-pattern: 5.3.1 + transitivePeerDependencies: + - eslint + - supports-color + - typescript + '@eslint/compat@1.1.1': {} '@eslint/config-array@0.18.0': @@ -2739,6 +2891,8 @@ snapshots: big-integer@1.6.51: {} + birecord@0.1.1: {} + brace-expansion@1.1.11: dependencies: balanced-match: 1.0.2 @@ -3281,6 +3435,27 @@ snapshots: dependencies: eslint: 9.9.1 + eslint-plugin-react-x@1.13.1(eslint@9.9.1)(typescript@5.5.4): + dependencies: + '@eslint-react/ast': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@eslint-react/core': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@eslint-react/jsx': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@eslint-react/shared': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@eslint-react/tools': 1.13.1 + '@eslint-react/types': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@eslint-react/var': 1.13.1(eslint@9.9.1)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.4.0 + '@typescript-eslint/type-utils': 8.4.0(eslint@9.9.1)(typescript@5.5.4) + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/utils': 8.4.0(eslint@9.9.1)(typescript@5.5.4) + eslint: 9.9.1 + is-immutable-type: 5.0.0(eslint@9.9.1)(typescript@5.5.4) + ts-pattern: 5.3.1 + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + eslint-plugin-react@7.35.0(eslint@9.9.1): dependencies: array-includes: 3.1.8 @@ -3714,6 +3889,16 @@ snapshots: dependencies: is-extglob: 2.1.1 + is-immutable-type@5.0.0(eslint@9.9.1)(typescript@5.5.4): + dependencies: + '@typescript-eslint/type-utils': 8.4.0(eslint@9.9.1)(typescript@5.5.4) + eslint: 9.9.1 + ts-api-utils: 1.3.0(typescript@5.5.4) + ts-declaration-location: 1.0.4(typescript@5.5.4) + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + is-map@2.0.2: {} is-negative-zero@2.0.3: {} @@ -3880,6 +4065,10 @@ snapshots: min-indent@1.0.1: {} + minimatch@10.0.1: + dependencies: + brace-expansion: 2.0.1 + minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 @@ -4029,6 +4218,8 @@ snapshots: picomatch@2.3.1: {} + picomatch@4.0.2: {} + pluralize@8.0.0: {} possible-typed-array-names@1.0.0: {} @@ -4206,6 +4397,8 @@ snapshots: shebang-regex@3.0.0: {} + short-unique-id@5.2.0: {} + side-channel@1.0.6: dependencies: call-bind: 1.0.7 @@ -4266,6 +4459,8 @@ snapshots: dependencies: internal-slot: 1.0.7 + string-ts@2.2.0: {} + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 @@ -4427,6 +4622,13 @@ snapshots: dependencies: typescript: 5.5.4 + ts-declaration-location@1.0.4(typescript@5.5.4): + dependencies: + minimatch: 10.0.1 + typescript: 5.5.4 + + ts-pattern@5.3.1: {} + tsconfig-paths@3.15.0: dependencies: '@types/json5': 0.0.29 diff --git a/renovate.json5 b/renovate.json5 index a78fe9a..ad79758 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -1,26 +1,21 @@ { - "extends": [ - "github>karlhorky/renovate-config:default.json5" - ], + extends: ['github>karlhorky/renovate-config:default.json5'], // Mostly default configuration for ignorePaths // https://docs.renovatebot.com/presets-default/#ignoremodulesandtests - "ignorePaths": [ - "**/node_modules/**", - "**/bower_components/**", - "**/vendor/**", - "**/examples/**", + ignorePaths: [ + '**/node_modules/**', + '**/bower_components/**', + '**/examples/**', // Allow upgrades to tests // "**/__tests__/**", - "**/test/**", - "**/tests/**", - "**/__fixtures__/**" + '**/test/**', + '**/tests/**', + '**/__fixtures__/**', ], - "packageRules": [ + packageRules: [ { - "matchDepTypes": [ - "peerDependencies" - ], - "rangeStrategy": "bump" - } - ] + matchDepTypes: ['peerDependencies'], + rangeStrategy: 'bump', + }, + ], } diff --git a/vendor/eslint-plugin-jsx-expressions/README.md b/vendor/eslint-plugin-jsx-expressions/README.md deleted file mode 100644 index 14cdd83..0000000 --- a/vendor/eslint-plugin-jsx-expressions/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# eslint-plugin-jsx-expressions - -Rules for safe logical expressions in JSX - -## Installation - -You'll first need to install [ESLint](https://eslint.org/): - -```sh -npm i eslint --save-dev -``` - -Next, install `eslint-plugin-jsx-expressions`: - -```sh -npm install eslint-plugin-jsx-expressions --save-dev -``` - -## Usage - -Add `jsx-expressions` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix: - -```json -{ - "plugins": ["jsx-expressions"] -} -``` - -Then configure the rules you want to use under the rules section. - -```json -{ - "rules": { - "jsx-expressions/strict-logical-expressions": "error" - } -} -``` - -## Supported Rules - -- [jsx-expressions/strict-logical-expressions](https://github.com/hluisson/eslint-plugin-jsx-expressions/blob/master/docs/rules/strict-logical-expressions.md): Enforces logical "&&" expressions do not use potentially falsey numbers or strings. diff --git a/vendor/eslint-plugin-jsx-expressions/dist/index.js b/vendor/eslint-plugin-jsx-expressions/dist/index.js deleted file mode 100644 index 4ba197b..0000000 --- a/vendor/eslint-plugin-jsx-expressions/dist/index.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-nocheck -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -const rules_1 = __importDefault(require("./rules")); -module.exports = { - rules: rules_1.default, -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/vendor/eslint-plugin-jsx-expressions/dist/index.js.map b/vendor/eslint-plugin-jsx-expressions/dist/index.js.map deleted file mode 100644 index 869731a..0000000 --- a/vendor/eslint-plugin-jsx-expressions/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":";;;;AAAA,oDAA4B;AAE5B,iBAAS;IACP,KAAK,EAAL,eAAK;CACN,CAAC"} \ No newline at end of file diff --git a/vendor/eslint-plugin-jsx-expressions/dist/rules/index.js b/vendor/eslint-plugin-jsx-expressions/dist/rules/index.js deleted file mode 100644 index 3a0e741..0000000 --- a/vendor/eslint-plugin-jsx-expressions/dist/rules/index.js +++ /dev/null @@ -1,11 +0,0 @@ -// @ts-nocheck -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const strict_logical_expressions_1 = __importDefault(require("./strict-logical-expressions")); -exports.default = { - "strict-logical-expressions": strict_logical_expressions_1.default, -}; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/vendor/eslint-plugin-jsx-expressions/dist/rules/index.js.map b/vendor/eslint-plugin-jsx-expressions/dist/rules/index.js.map deleted file mode 100644 index d33c9cf..0000000 --- a/vendor/eslint-plugin-jsx-expressions/dist/rules/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/rules/index.ts"],"names":[],"mappings":";;;;;AAAA,8FAAoE;AAEpE,kBAAe;IACb,4BAA4B,EAAE,oCAAwB;CACvD,CAAC"} \ No newline at end of file diff --git a/vendor/eslint-plugin-jsx-expressions/dist/rules/strict-logical-expressions.js b/vendor/eslint-plugin-jsx-expressions/dist/rules/strict-logical-expressions.js deleted file mode 100644 index f6b3bc2..0000000 --- a/vendor/eslint-plugin-jsx-expressions/dist/rules/strict-logical-expressions.js +++ /dev/null @@ -1,127 +0,0 @@ -// @ts-nocheck -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const utils_1 = require("@typescript-eslint/utils"); -const tsutils = __importStar(require("ts-api-utils")); -const ts = __importStar(require("typescript")); -const createRule_1 = require("../util/createRule"); -const types_1 = require("../util/types"); -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ -exports.default = (0, createRule_1.createRule)({ - name: "strict-logical-expressions", - defaultOptions: [{ allowString: false, allowNumber: false }], - meta: { - docs: { - description: "Forbid non-boolean falsey values in inline expressions", - recommended: "strict", - }, - fixable: "code", - type: "problem", - schema: [ - { - type: "object", - properties: { - allowString: { type: "boolean" }, - allowNumber: { type: "boolean" }, - }, - additionalProperties: false, - }, - ], - messages: { - conditionErrorFalseyString: "Potentially falsey string in logical AND expression. Please use boolean.", - conditionErrorFalseyNumber: "Potentially falsey number in logical AND expression. Please use boolean.", - }, - }, - create(context, [options]) { - const parserServices = utils_1.ESLintUtils.getParserServices(context); - const typeChecker = parserServices.program.getTypeChecker(); - function checkIdentifier(node) { - const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); - const types = tsutils.unionTypeParts((0, types_1.getConstrainedTypeAtLocation)(typeChecker, tsNode)); - const hasPotentiallyFalseyString = types.some((type) => tsutils.isTypeFlagSet(type, ts.TypeFlags.StringLike) && - (!type.isStringLiteral() || type.value === "")); - if (!options.allowString && hasPotentiallyFalseyString) { - return "conditionErrorFalseyString"; - } - const hasPotentiallyFalseyNumber = types.some((type) => tsutils.isTypeFlagSet(type, ts.TypeFlags.NumberLike | ts.TypeFlags.BigIntLike) && - (!type.isNumberLiteral() || type.value === 0)); - if (!options.allowNumber && hasPotentiallyFalseyNumber) { - return "conditionErrorFalseyNumber"; - } - return; - } - function checkAndReportIdentifier(node, fixNode) { - const errorId = checkIdentifier(node); - if (errorId) { - context.report({ - node, - messageId: errorId, - fix: (fixer) => fixer.insertTextBefore(fixNode, "!!"), - }); - } - } - // Return the core identifier or expression - function determineNode(originalNode) { - let nodeToEvaluate = originalNode; - if (nodeToEvaluate.type === utils_1.TSESTree.AST_NODE_TYPES.ChainExpression) { - nodeToEvaluate = nodeToEvaluate.expression; - } - if (nodeToEvaluate.type === utils_1.TSESTree.AST_NODE_TYPES.MemberExpression && - nodeToEvaluate.property.type !== - utils_1.TSESTree.AST_NODE_TYPES.PrivateIdentifier) { - nodeToEvaluate = nodeToEvaluate.property; - } - return nodeToEvaluate; - } - function checkLogicalExpression(expressionNode, checkRightNode) { - const leftNode = determineNode(expressionNode.left); - if (leftNode.type === utils_1.TSESTree.AST_NODE_TYPES.LogicalExpression) { - checkLogicalExpression(leftNode, true); - } - else if (leftNode.type === utils_1.TSESTree.AST_NODE_TYPES.Identifier) { - checkAndReportIdentifier(leftNode, expressionNode.left); - } - if (checkRightNode) { - const rightNode = determineNode(expressionNode.right); - if (rightNode.type === utils_1.TSESTree.AST_NODE_TYPES.Identifier) { - checkAndReportIdentifier(rightNode, expressionNode.right); - } - } - } - function checkJSXExpression(node) { - if (node.expression.type === utils_1.TSESTree.AST_NODE_TYPES.LogicalExpression && - node.expression.operator === "&&") { - checkLogicalExpression(node.expression, false); - } - } - return { - JSXExpressionContainer: checkJSXExpression, - }; - }, -}); -//# sourceMappingURL=strict-logical-expressions.js.map diff --git a/vendor/eslint-plugin-jsx-expressions/dist/rules/strict-logical-expressions.js.map b/vendor/eslint-plugin-jsx-expressions/dist/rules/strict-logical-expressions.js.map deleted file mode 100644 index 32093ba..0000000 --- a/vendor/eslint-plugin-jsx-expressions/dist/rules/strict-logical-expressions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strict-logical-expressions.js","sourceRoot":"","sources":["../../lib/rules/strict-logical-expressions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAgE;AAChE,iDAAmC;AACnC,+CAAiC;AACjC,mDAAgD;AAChD,yCAA6D;AAW7D,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF,kBAAe,IAAA,uBAAU,EAAsB;IAC7C,IAAI,EAAE,4BAA4B;IAClC,cAAc,EAAE,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;IAC5D,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EAAE,wDAAwD;YACrE,WAAW,EAAE,QAAQ;SACtB;QACD,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,SAAS;QACf,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;oBAChC,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;iBACjC;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;QACD,QAAQ,EAAE;YACR,0BAA0B,EACxB,0EAA0E;YAC5E,0BAA0B,EACxB,0EAA0E;SAC7E;KACF;IAED,MAAM,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC;QACvB,MAAM,cAAc,GAAG,mBAAW,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC9D,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CA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AAI,CAAC,UAAU,CAAC,IAAI,KAAK,gBAAQ,CAAC,cAAc,CAAC,iBAAiB;gBAClE,IAAI,CAAC,UAAU,CAAC,QAAQ,KAAK,IAAI,EACjC;gBACA,sBAAsB,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;aAChD;QACH,CAAC;QAED,OAAO;YACL,sBAAsB,EAAE,kBAAkB;SAC3C,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/vendor/eslint-plugin-jsx-expressions/dist/util/createRule.js b/vendor/eslint-plugin-jsx-expressions/dist/util/createRule.js deleted file mode 100644 index ca6d3eb..0000000 --- a/vendor/eslint-plugin-jsx-expressions/dist/util/createRule.js +++ /dev/null @@ -1,10 +0,0 @@ -// @ts-nocheck -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createRule = void 0; -const utils_1 = require("@typescript-eslint/utils"); -// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder -// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -const version = require("../../package.json").version; -exports.createRule = utils_1.ESLintUtils.RuleCreator((name) => `https://github.com/hluisson/eslint-plugin-jsx-expressions/blob/v${version}/lib/rules/${name}.md`); -//# sourceMappingURL=createRule.js.map \ No newline at end of file diff --git a/vendor/eslint-plugin-jsx-expressions/dist/util/createRule.js.map b/vendor/eslint-plugin-jsx-expressions/dist/util/createRule.js.map deleted file mode 100644 index c5f20d8..0000000 --- a/vendor/eslint-plugin-jsx-expressions/dist/util/createRule.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"createRule.js","sourceRoot":"","sources":["../../lib/util/createRule.ts"],"names":[],"mappings":";;;AAAA,oDAAuD;AAEvD,sHAAsH;AACtH,+GAA+G;AAC/G,MAAM,OAAO,GAAW,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAEjD,QAAA,UAAU,GAAG,mBAAW,CAAC,WAAW,CAC/C,CAAC,IAAI,EAAE,EAAE,CACP,mEAAmE,OAAO,cAAc,IAAI,KAAK,CACpG,CAAC"} \ No newline at end of file diff --git a/vendor/eslint-plugin-jsx-expressions/dist/util/types.js b/vendor/eslint-plugin-jsx-expressions/dist/util/types.js deleted file mode 100644 index 460b163..0000000 --- a/vendor/eslint-plugin-jsx-expressions/dist/util/types.js +++ /dev/null @@ -1,14 +0,0 @@ -// @ts-nocheck -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getConstrainedTypeAtLocation = void 0; -/** - * Resolves the given node's type. Will resolve to the type's generic constraint, if it has one. - */ -function getConstrainedTypeAtLocation(checker, node) { - const nodeType = checker.getTypeAtLocation(node); - const constrained = checker.getBaseConstraintOfType(nodeType); - return constrained !== null && constrained !== void 0 ? constrained : nodeType; -} -exports.getConstrainedTypeAtLocation = getConstrainedTypeAtLocation; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/vendor/eslint-plugin-jsx-expressions/dist/util/types.js.map b/vendor/eslint-plugin-jsx-expressions/dist/util/types.js.map deleted file mode 100644 index 94dce06..0000000 --- a/vendor/eslint-plugin-jsx-expressions/dist/util/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../lib/util/types.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,SAAgB,4BAA4B,CAC1C,OAAuB,EACvB,IAAa;IAEb,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAE9D,OAAO,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,QAAQ,CAAC;AACjC,CAAC;AARD,oEAQC"} \ No newline at end of file diff --git a/vendor/eslint-plugin-jsx-expressions/package.json b/vendor/eslint-plugin-jsx-expressions/package.json deleted file mode 100644 index 5bbefff..0000000 --- a/vendor/eslint-plugin-jsx-expressions/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -}