From f0461a96efa42d7abc737019e433f09ae4225f7e Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Tue, 30 Aug 2022 18:13:02 +0930 Subject: [PATCH 01/15] chore: add regression testing against old TS and ESLint versions --- .eslintrc.js | 1 + .github/workflows/ci.yml | 99 +++++++++ packages/website-eslint/package.json | 2 +- tools/change-ts-version.ts | 21 ++ tools/generate-contributors.ts | 2 +- tools/tsconfig.json | 10 + yarn.lock | 315 +++------------------------ 7 files changed, 165 insertions(+), 285 deletions(-) create mode 100644 tools/change-ts-version.ts create mode 100644 tools/tsconfig.json diff --git a/.eslintrc.js b/.eslintrc.js index 8e62b6d06e39..6a95e6707dea 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -26,6 +26,7 @@ module.exports = { './tsconfig.eslint.json', './packages/*/tsconfig.json', './tests/integration/tsconfig.json', + './tools/tsconfig.json', /** * We are currently in the process of transitioning to nx's out of the box structure and * so need to manually specify converted packages' tsconfig.build.json and tsconfig.spec.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d47090d6344..916124367de2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,9 @@ on: - '**' env: + PRIMARY_ESLINT_VERSION: '^8.0.0' PRIMARY_NODE_VERSION: 18 + PRIMARY_TYPESCRIPT_VERSION: '~4.8.0' defaults: run: @@ -117,6 +119,7 @@ jobs: strategy: matrix: # just run on the oldest and latest supported versions and assume the intermediate versions are good + # unfortunately you can't reference environment variables in an array :( node-version: [14, 18] package: [ @@ -172,6 +175,102 @@ jobs: # Sadly 1 day is the minimum retention-days: 1 + unit_tests_ts_regression: + name: Run Unit Tests (TypeScript Version Regression Checks) + needs: [build] + runs-on: ubuntu-latest + strategy: + matrix: + package: + # note that we don't regression test all packages here on purpose because most don't depend on TS directly. + ['eslint-plugin', 'scope-manager', 'type-utils', 'typescript-estree'] + + ts-version: + # unfortunately you can't reference environment variables in an array :( + [ + # lowest possible version + '3.3.1', + # somewhere in the middle for sanity check + '~4.0.8', + # highest possible version + '~4.8.2', + ] + env: + # Added the - at the end to function as a separator to improve readability in the PR comment from the Nx cloud app + NX_CLOUD_ENV_NAME: 'Node ${{ matrix.node-version }} -' + COLLECT_COVERAGE: false + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 2 + - name: Install + uses: ./.github/actions/prepare-install + with: + node-version: ${{ env.PRIMARY_NODE_VERSION }} + - name: Build + uses: ./.github/actions/prepare-build + + - name: Install Specific TS Version + run: | + yarn ts-node ./tools/change-ts-version.ts ${{ matrix.ts-version }} + yarn --ignore-engines --ignore-scripts + + - name: Patch Packages + if: matrix.ts-version == env.PRIMARY_TYPESCRIPT_VERSION + run: | + yarn patch-package + + # we don't collect coverage for these tests on purpose + - name: Run unit tests for ${{ matrix.package }} + run: npx nx test @typescript-eslint/${{ matrix.package }} --coverage=false + env: + CI: true + + unit_tests_eslint_regression: + name: Run Unit Tests (ESLint Version Regression Checks) + needs: [build] + runs-on: ubuntu-latest + strategy: + matrix: + package: + # note that we don't regression test all packages here on purpose because most don't depend on ESLint directly. + ['eslint-plugin', 'utils'] + eslint-version: + # unfortunately you can't reference environment variables in an array :( + [ + # lowest possible version + '6.0.0', + # somewhere in the middle for sanity check + '~7.32.0', + # highest possible version + '^8.0.0', + ] + env: + # Added the - at the end to function as a separator to improve readability in the PR comment from the Nx cloud app + NX_CLOUD_ENV_NAME: 'Node ${{ matrix.node-version }} -' + COLLECT_COVERAGE: false + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 2 + - name: Install + uses: ./.github/actions/prepare-install + with: + node-version: ${{ env.PRIMARY_NODE_VERSION }} + - name: Build + uses: ./.github/actions/prepare-build + + - name: Install Specific ESLint Version + run: yarn add -DW --ignore-engines --ignore-scripts eslint@${{ matrix.eslint-version }} + + # we don't collect coverage for these tests on purpose + - name: Run unit tests for ${{ matrix.package }} + run: npx nx test @typescript-eslint/${{ matrix.package }} --coverage=false + env: + CI: true + website_tests: permissions: contents: read # to fetch code (actions/checkout) diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index 7d4d0a520f39..9254f97a473d 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -32,6 +32,6 @@ "eslint": "*", "rollup": "^2.75.4", "rollup-plugin-terser": "^7.0.2", - "semver": "^7.3.7" + "semver": "*" } } diff --git a/tools/change-ts-version.ts b/tools/change-ts-version.ts new file mode 100644 index 000000000000..feab7880214e --- /dev/null +++ b/tools/change-ts-version.ts @@ -0,0 +1,21 @@ +import fs from 'fs'; +import path from 'path'; +import semver from 'semver'; + +const packageJson = require('../package.json') as { + resolutions: Record; + devDependencies: Record; +}; + +const newVersion = semver.valid(semver.coerce(process.argv[2])); +if (newVersion == null) { + throw new Error('The first argument passed must be a valid semver'); +} + +packageJson.resolutions.typescript = newVersion; +packageJson.devDependencies.typescript = newVersion; + +fs.writeFileSync( + path.resolve(__dirname, '../package.json'), + JSON.stringify(packageJson, null, 2), +); diff --git a/tools/generate-contributors.ts b/tools/generate-contributors.ts index 103046721217..87b42a05dd42 100644 --- a/tools/generate-contributors.ts +++ b/tools/generate-contributors.ts @@ -21,7 +21,7 @@ interface Contributor { contributions: number; type: string; login?: string; - url?: string; + url: string; avatar_url?: string; html_url?: string; } diff --git a/tools/tsconfig.json b/tools/tsconfig.json new file mode 100644 index 000000000000..28a93cc86cbc --- /dev/null +++ b/tools/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "esModuleInterop": true, + "resolveJsonModule": true, + "rootDir": ".." + }, + "include": ["./*.ts"], + "references": [] +} diff --git a/yarn.lock b/yarn.lock index 1d92b449d6a4..7af85f0543c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -153,17 +153,7 @@ dependencies: "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8": - version "7.18.8" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.18.8.tgz#2483f565faca607b8535590e84e7de323f27764d" - integrity sha512-HSmX4WZPPK3FUxYp7g2T6EyO8j96HlZJlxmKPSh6KAcqwyDrfx7hKjXpAW/0FhFfTJsR0Yt4lAjLI2coMptIHQ== - -"@babel/compat-data@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.1.tgz#72d647b4ff6a4f82878d184613353af1dd0290f9" - integrity sha512-72a9ghR0gnESIa7jBN53U32FOVCEoztyIlKaNoU05zRhEecduGK9L9c3ww7Mp06JiR+0ls0GBPFJQwwtjn9ksg== - -"@babel/compat-data@^7.19.3": +"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.19.1", "@babel/compat-data@^7.19.3": version "7.19.3" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.3.tgz#707b939793f867f5a73b2666e6d9a3396eb03151" integrity sha512-prBHMK4JYYK+wDjJF1q99KK4JLL+egWS4nmNqdlMUgCExMZ+iZW0hGhyC3VEbsPjvaN0TBhW//VIFwBrk8sEiw== @@ -220,16 +210,7 @@ eslint-visitor-keys "^2.1.0" semver "^6.3.0" -"@babel/generator@^7.12.5", "@babel/generator@^7.18.7", "@babel/generator@^7.19.0", "@babel/generator@^7.7.2": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.0.tgz#785596c06425e59334df2ccee63ab166b738419a" - integrity sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg== - dependencies: - "@babel/types" "^7.19.0" - "@jridgewell/gen-mapping" "^0.3.2" - jsesc "^2.5.1" - -"@babel/generator@^7.19.3": +"@babel/generator@^7.12.5", "@babel/generator@^7.18.7", "@babel/generator@^7.19.0", "@babel/generator@^7.19.3", "@babel/generator@^7.7.2": version "7.19.3" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.3.tgz#d7f4d1300485b4547cb6f94b27d10d237b42bf59" integrity sha512-fqVZnmp1ncvZU757UzDheKZpfPgatqY59XtW2/j/18H7u76akb8xqvjw82f+i2UKd/ksYsSick/BCLQUUtJ/qQ== @@ -253,17 +234,7 @@ "@babel/helper-explode-assignable-expression" "^7.18.6" "@babel/types" "^7.18.9" -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.1.tgz#7f630911d83b408b76fe584831c98e5395d7a17c" - integrity sha512-LlLkkqhCMyz2lkQPvJNdIYU7O5YjWRgC2R4omjCTpZd8u8KMQzZvX4qce+/BluN1rcQiV7BoGUpmQ0LeHerbhg== - dependencies: - "@babel/compat-data" "^7.19.1" - "@babel/helper-validator-option" "^7.18.6" - browserslist "^4.21.3" - semver "^6.3.0" - -"@babel/helper-compilation-targets@^7.19.0", "@babel/helper-compilation-targets@^7.19.3": +"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.19.0", "@babel/helper-compilation-targets@^7.19.3": version "7.19.3" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.19.3.tgz#a10a04588125675d7c7ae299af86fa1b2ee038ca" integrity sha512-65ESqLGyGmLvgR0mst5AdW1FkNlj9rQsCKduzEoEPhBCDFGXvz2jW6bXFG6i0/MrV2s7hhXjjb2yAzcPuQlLwg== @@ -286,15 +257,7 @@ "@babel/helper-replace-supers" "^7.18.9" "@babel/helper-split-export-declaration" "^7.18.6" -"@babel/helper-create-regexp-features-plugin@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.18.6.tgz#3e35f4e04acbbf25f1b3534a657610a000543d3c" - integrity sha512-7LcpH1wnQLGrI+4v+nPp+zUvIkF9x0ddv1Hkdue10tg3gmRnLy97DXh4STiOf1qeIInyD69Qv5kKSZzKD8B/7A== - dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - regexpu-core "^5.1.0" - -"@babel/helper-create-regexp-features-plugin@^7.19.0": +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.19.0": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.19.0.tgz#7976aca61c0984202baca73d84e2337a5424a41b" integrity sha512-htnV+mHX32DF81amCDrwIDr8nrp1PTm+3wfBN9/v8QJOLEioOCOG7qNyq0nHeFiWbT3Eb7gsPwEmV64UCQ1jzw== @@ -302,19 +265,7 @@ "@babel/helper-annotate-as-pure" "^7.18.6" regexpu-core "^5.1.0" -"@babel/helper-define-polyfill-provider@^0.3.1", "@babel/helper-define-polyfill-provider@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.2.tgz#bd10d0aca18e8ce012755395b05a79f45eca5073" - integrity sha512-r9QJJ+uDWrd+94BSPcP6/de67ygLtvVy6cK4luE6MOuDsZIdoaPBnfSpbO/+LTifjPckbKXRuI9BB/Z2/y3iTg== - dependencies: - "@babel/helper-compilation-targets" "^7.17.7" - "@babel/helper-plugin-utils" "^7.16.7" - debug "^4.1.1" - lodash.debounce "^4.0.8" - resolve "^1.14.2" - semver "^6.1.2" - -"@babel/helper-define-polyfill-provider@^0.3.3": +"@babel/helper-define-polyfill-provider@^0.3.1", "@babel/helper-define-polyfill-provider@^0.3.2", "@babel/helper-define-polyfill-provider@^0.3.3": version "0.3.3" resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz#8612e55be5d51f0cd1f36b4a5a83924e89884b7a" integrity sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww== @@ -338,15 +289,7 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-function-name@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.18.9.tgz#940e6084a55dee867d33b4e487da2676365e86b0" - integrity sha512-fJgWlZt7nxGksJS9a0XdSaI4XvpExnNIgRP+rVefWh5U7BL8pPuir6SJUmFKRfjWQ51OtWSzwOxhaH/EBWWc0A== - dependencies: - "@babel/template" "^7.18.6" - "@babel/types" "^7.18.9" - -"@babel/helper-function-name@^7.19.0": +"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.19.0": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== @@ -401,12 +344,7 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.17.12", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz#4b8aea3b069d8cb8a72cdfe28ddf5ceca695ef2f" - integrity sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w== - -"@babel/helper-plugin-utils@^7.19.0": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.17.12", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz#4796bb14961521f0f8715990bee2fb6e51ce21bf" integrity sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw== @@ -496,12 +434,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@*", "@babel/parser@^7.1.0", "@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.18.0", "@babel/parser@^7.18.10", "@babel/parser@^7.18.8", "@babel/parser@^7.19.1": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.1.tgz#6f6d6c2e621aad19a92544cc217ed13f1aac5b4c" - integrity sha512-h7RCSorm1DdTVGJf3P2Mhj3kdnkmF/EiysUkzS2TdgAYqyjFdMQJbVuXOBej2SBJaXan/lIVtT6KkGbyyq753A== - -"@babel/parser@^7.19.3": +"@babel/parser@*", "@babel/parser@^7.1.0", "@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.18.0", "@babel/parser@^7.18.10", "@babel/parser@^7.18.8", "@babel/parser@^7.19.1", "@babel/parser@^7.19.3": version "7.19.3" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.3.tgz#8dd36d17c53ff347f9e55c328710321b49479a9a" integrity sha512-pJ9xOlNWHiy9+FuFP09DEAFbAn4JskgRsVcc169w2xRBC3FRGuQEwjeIMMND9L2zc0iEhO/tGv4Zq+km+hxNpQ== @@ -1251,23 +1184,7 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/traverse@^7.12.9", "@babel/traverse@^7.18.8", "@babel/traverse@^7.18.9", "@babel/traverse@^7.19.0", "@babel/traverse@^7.7.2": - version "7.19.1" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.1.tgz#0fafe100a8c2a603b4718b1d9bf2568d1d193347" - integrity sha512-0j/ZfZMxKukDaag2PtOPDbwuELqIar6lLskVPPJDjXMXjfLb1Obo/1yjxIGqqAJrmfaTIY3z2wFLAQ7qSkLsuA== - dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.19.0" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.19.1" - "@babel/types" "^7.19.0" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/traverse@^7.19.3": +"@babel/traverse@^7.12.9", "@babel/traverse@^7.18.8", "@babel/traverse@^7.18.9", "@babel/traverse@^7.19.0", "@babel/traverse@^7.19.3", "@babel/traverse@^7.7.2": version "7.19.3" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.3.tgz#3a3c5348d4988ba60884e8494b0592b2f15a04b4" integrity sha512-qh5yf6149zhq2sgIXmwjnsvmnNQC2iw70UFjp4olxucKrWd/dvlUsBI88VSLUsnMNF7/vnOiA+nk1+yLoCqROQ== @@ -2632,15 +2549,7 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/trace-mapping@^0.3.0", "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.7", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.14" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" - integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/trace-mapping@^0.3.15": +"@jridgewell/trace-mapping@^0.3.0", "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.7", "@jridgewell/trace-mapping@^0.3.9": version "0.3.15" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774" integrity sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g== @@ -3580,18 +3489,7 @@ node-gyp "^9.0.0" read-package-json-fast "^2.0.3" -"@npmcli/run-script@^4.1.0": - version "4.1.7" - resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-4.1.7.tgz#b1a2f57568eb738e45e9ea3123fb054b400a86f7" - integrity sha512-WXr/MyM4tpKA4BotB81NccGAv8B48lNH0gRoILucbcAhTQXLCoi6HflMV3KdXubIqvP9SuLsFn68Z7r4jl+ppw== - dependencies: - "@npmcli/node-gyp" "^2.0.0" - "@npmcli/promise-spawn" "^3.0.0" - node-gyp "^9.0.0" - read-package-json-fast "^2.0.3" - which "^2.0.2" - -"@npmcli/run-script@^4.1.3", "@npmcli/run-script@^4.1.7": +"@npmcli/run-script@^4.1.0", "@npmcli/run-script@^4.1.3", "@npmcli/run-script@^4.1.7": version "4.2.0" resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-4.2.0.tgz#2c25758f80831ba138afe25225d456e89acedac3" integrity sha512-e/QgLg7j2wSJp1/7JRl0GC8c7PMX+uYlA/1Tb+IDOLdSM4T7K1VQ9mm9IGU3WRtY5vEIObpqCLb3aCNCug18DA== @@ -3815,14 +3713,7 @@ "@octokit/plugin-request-log" "^1.0.4" "@octokit/plugin-rest-endpoint-methods" "^6.0.0" -"@octokit/types@^6.0.3", "@octokit/types@^6.16.1": - version "6.34.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.34.0.tgz#c6021333334d1ecfb5d370a8798162ddf1ae8218" - integrity sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw== - dependencies: - "@octokit/openapi-types" "^11.2.0" - -"@octokit/types@^6.39.0", "@octokit/types@^6.40.0": +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.39.0", "@octokit/types@^6.40.0": version "6.40.0" resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.40.0.tgz#f2e665196d419e19bb4265603cf904a820505d0e" integrity sha512-MFZOU5r8SwgJWDMhrLUSvyJPtVsqA6VnbVI3TNbsmw+Jnvrktzvq2fYES/6RiJA/5Ykdwq4mJmtlYUfW7CGjmw== @@ -4950,17 +4841,7 @@ ajv@^6.10.0, ajv@^6.12.2, ajv@^6.12.4, ajv@^6.12.5, ajv@~6.12.6: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.0, ajv@^8.8.0: - version "8.8.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.8.2.tgz#01b4fef2007a28bf75f0b7fc009f62679de4abbb" - integrity sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - -ajv@^8.6.0: +ajv@^8.0.0, ajv@^8.6.0, ajv@^8.8.0: version "8.11.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f" integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg== @@ -5340,16 +5221,7 @@ babel-plugin-jest-hoist@^29.0.2: "@types/babel__core" "^7.1.14" "@types/babel__traverse" "^7.0.6" -babel-plugin-polyfill-corejs2@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.2.tgz#e4c31d4c89b56f3cf85b92558954c66b54bd972d" - integrity sha512-LPnodUl3lS0/4wN3Rb+m+UK8s7lj2jcLRrjho4gLw+OJs+I4bvGXshINesY5xx/apM+biTnQ9reDI8yj+0M5+Q== - dependencies: - "@babel/compat-data" "^7.17.7" - "@babel/helper-define-polyfill-provider" "^0.3.2" - semver "^6.1.1" - -babel-plugin-polyfill-corejs2@^0.3.3: +babel-plugin-polyfill-corejs2@^0.3.1, babel-plugin-polyfill-corejs2@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122" integrity sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q== @@ -5575,28 +5447,7 @@ braces@^3.0.2, braces@~3.0.2: dependencies: fill-range "^7.0.1" -browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.16.6, browserslist@^4.18.1, browserslist@^4.20.3: - version "4.20.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.3.tgz#eb7572f49ec430e054f56d52ff0ebe9be915f8bf" - integrity sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg== - dependencies: - caniuse-lite "^1.0.30001332" - electron-to-chromium "^1.4.118" - escalade "^3.1.1" - node-releases "^2.0.3" - picocolors "^1.0.0" - -browserslist@^4.21.3: - version "4.21.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.3.tgz#5df277694eb3c48bc5c4b05af3e8b7e09c5a6d1a" - integrity sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ== - dependencies: - caniuse-lite "^1.0.30001370" - electron-to-chromium "^1.4.202" - node-releases "^2.0.6" - update-browserslist-db "^1.0.5" - -browserslist@^4.21.4: +browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.16.6, browserslist@^4.18.1, browserslist@^4.20.3, browserslist@^4.21.3, browserslist@^4.21.4: version "4.21.4" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== @@ -5636,12 +5487,7 @@ builtin-modules@^1.1.1: resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= -builtin-modules@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.2.0.tgz#45d5db99e7ee5e6bc4f362e008bf917ab5049887" - integrity sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA== - -builtin-modules@^3.1.0: +builtin-modules@^3.0.0, builtin-modules@^3.1.0: version "3.3.0" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== @@ -5775,17 +5621,7 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001335: - version "1.0.30001339" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001339.tgz#f9aece4ea8156071613b27791547ba0b33f176cf" - integrity sha512-Es8PiVqCe+uXdms0Gu5xP5PF2bxLR7OBp3wUzUnuO7OHzhOfCyg3hdiGWVPVxhiuniOzng+hTc1u3fEQ0TlkSQ== - -caniuse-lite@^1.0.30001370: - version "1.0.30001399" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001399.tgz#1bf994ca375d7f33f8d01ce03b7d5139e8587873" - integrity sha512-4vQ90tMKS+FkvuVWS5/QY1+d805ODxZiKFzsU8o/RsVJz49ZSRR8EjykLJbqhzdPgadbX6wB538wOzle3JniRA== - -caniuse-lite@^1.0.30001400: +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001335, caniuse-lite@^1.0.30001370, caniuse-lite@^1.0.30001400: version "1.0.30001414" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001414.tgz#5f1715e506e71860b4b07c50060ea6462217611e" integrity sha512-t55jfSaWjCdocnFdKQoO+d2ct9C59UZg4dY3OnUlSZ447r8pUtIKdp0hpAzrGFultmTC+Us+KpKi4GZl/LXlFg== @@ -6411,15 +6247,7 @@ copy-webpack-plugin@^11.0.0: schema-utils "^4.0.0" serialize-javascript "^6.0.0" -core-js-compat@^3.21.0: - version "3.22.5" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.22.5.tgz#7fffa1d20cb18405bd22756ca1353c6f1a0e8614" - integrity sha512-rEF75n3QtInrYICvJjrAgV03HwKiYvtKHdPtaba1KucG+cNZ4NJnH9isqt979e67KZlhpbCOTwnsvnIr+CVeOg== - dependencies: - browserslist "^4.20.3" - semver "7.0.0" - -core-js-compat@^3.25.1: +core-js-compat@^3.21.0, core-js-compat@^3.25.1: version "3.25.4" resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.25.4.tgz#730a255d4a47a937513abf1672bf278dc24dcebf" integrity sha512-gCEcIEEqCR6230WroNunK/653CWKhqyCKJ9b+uESqOt/WFJA8B4lTnnQFdpYY5vmBcwJAA90Bo5vXs+CVsf6iA== @@ -7185,31 +7013,14 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -ejs@^3.1.6: +ejs@^3.1.6, ejs@^3.1.7: version "3.1.8" resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.8.tgz#758d32910c78047585c7ef1f92f9ee041c1c190b" integrity sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ== dependencies: jake "^10.8.5" -ejs@^3.1.7: - version "3.1.7" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.7.tgz#c544d9c7f715783dd92f0bddcf73a59e6962d006" - integrity sha512-BIar7R6abbUxDA3bfXrO4DSgwo8I+fB5/1zgujl3HLLjwd6+9iOnrT+t3grn2qbk9vOgBubXOFwX2m9axoFaGw== - dependencies: - jake "^10.8.5" - -electron-to-chromium@^1.4.118: - version "1.4.137" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.137.tgz#186180a45617283f1c012284458510cd99d6787f" - integrity sha512-0Rcpald12O11BUogJagX3HsCN3FE83DSqWjgXoHo5a72KUKMSfI39XBgJpgNNxS9fuGzytaFjE06kZkiVFy2qA== - -electron-to-chromium@^1.4.202: - version "1.4.250" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.250.tgz#e4535fc00d17b9a719bc688352c4a185acc2a347" - integrity sha512-KDLKcPEKPK+Q3/LdKX6knDzqyh8B82EaHccTYuGJR2qp1ymyGAo5HMH2x2OwDgzOPHlINSLIIeVhlFdq6aJgNA== - -electron-to-chromium@^1.4.251: +electron-to-chromium@^1.4.118, electron-to-chromium@^1.4.202, electron-to-chromium@^1.4.251: version "1.4.270" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.270.tgz#2c6ea409b45cdb5c3e0cb2c08cf6c0ba7e0f2c26" integrity sha512-KNhIzgLiJmDDC444dj9vEOpZEgsV96ult9Iff98Vanumn+ShJHd5se8aX6KeVxdc0YQeqdrezBZv89rleDbvSg== @@ -10548,20 +10359,13 @@ lzstring.ts@^2.0.2: dependencies: tslib "^1.10.0" -magic-string@^0.25.0: +magic-string@^0.25.0, magic-string@^0.25.7: version "0.25.9" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== dependencies: sourcemap-codec "^1.4.8" -magic-string@^0.25.7: - version "0.25.7" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" - integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== - dependencies: - sourcemap-codec "^1.4.4" - make-dir@*, make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" @@ -11146,12 +10950,7 @@ node-machine-id@^1.1.12: resolved "https://registry.yarnpkg.com/node-machine-id/-/node-machine-id-1.1.12.tgz#37904eee1e59b320bb9c5d6c0a59f3b469cb6267" integrity sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ== -node-releases@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.4.tgz#f38252370c43854dc48aa431c766c6c398f40476" - integrity sha512-gbMzqQtTtDz/00jQzZ21PQzdI9PyLYqUSvD0p3naOhX4odFji0ZxYdnVwPTxmSwkmxhcFImpozceidSG+AgoPQ== - -node-releases@^2.0.6: +node-releases@^2.0.3, node-releases@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== @@ -11250,17 +11049,7 @@ npm-package-arg@^9.0.0, npm-package-arg@^9.0.1: semver "^7.3.5" validate-npm-package-name "^4.0.0" -npm-packlist@^5.0.0: - version "5.0.4" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-5.0.4.tgz#b8a0635964dbf72baeeb7e69ec32e822f1c26159" - integrity sha512-G4sCWzzHokHC5oxGD46Q9vCe+eN2tFb+3RfADD/eZbx4nKa7Y1eku1xvIWrw5R3F3hWX7IM2BgdqbQsyBUa3IA== - dependencies: - glob "^8.0.1" - ignore-walk "^5.0.1" - npm-bundled "^1.1.2" - npm-normalize-package-bin "^1.0.1" - -npm-packlist@^5.1.0, npm-packlist@^5.1.1: +npm-packlist@^5.0.0, npm-packlist@^5.1.0, npm-packlist@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-5.1.1.tgz#79bcaf22a26b6c30aa4dd66b976d69cc286800e0" integrity sha512-UfpSvQ5YKwctmodvPPkK6Fwk603aoVsf8AEbmVKAEECrfvL8SSe1A2YIwrJ6xmTHAITKPwwZsWo7WwEbNk0kxw== @@ -11280,20 +11069,7 @@ npm-pick-manifest@^7.0.0: npm-package-arg "^9.0.0" semver "^7.3.5" -npm-registry-fetch@^13.0.0, npm-registry-fetch@^13.0.1: - version "13.1.1" - resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-13.1.1.tgz#26dc4b26d0a545886e807748032ba2aefaaae96b" - integrity sha512-5p8rwe6wQPLJ8dMqeTnA57Dp9Ox6GH9H60xkyJup07FmVlu3Mk7pf/kIIpl9gaN5bM8NM+UUx3emUWvDNTt39w== - dependencies: - make-fetch-happen "^10.0.6" - minipass "^3.1.6" - minipass-fetch "^2.0.3" - minipass-json-stream "^1.0.1" - minizlib "^2.1.2" - npm-package-arg "^9.0.1" - proc-log "^2.0.0" - -npm-registry-fetch@^13.3.0: +npm-registry-fetch@^13.0.0, npm-registry-fetch@^13.0.1, npm-registry-fetch@^13.3.0: version "13.3.0" resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-13.3.0.tgz#0ce10fa4a699a1e70685ecf41bbfb4150d74231b" integrity sha512-10LJQ/1+VhKrZjIuY9I/+gQTvumqqlgnsCufoXETHAPFTS3+M+Z5CFhZRDHGavmJ6rOye3UvNga88vl8n1r6gg== @@ -11710,34 +11486,7 @@ package-json@^6.3.0: registry-url "^5.0.0" semver "^6.2.0" -pacote@^13.0.3: - version "13.4.1" - resolved "https://registry.yarnpkg.com/pacote/-/pacote-13.4.1.tgz#b6610bf8903abc075bfffa02a2cedafe81a97293" - integrity sha512-FqlSWlD8n+ejCE17GF/lf0yasztMGFl4UFzYQk5njaK/qPPWfVDWnfQwqmqeXObWLSmIBew+O+CFD24vxkVDjg== - dependencies: - "@npmcli/git" "^3.0.0" - "@npmcli/installed-package-contents" "^1.0.7" - "@npmcli/promise-spawn" "^3.0.0" - "@npmcli/run-script" "^3.0.1" - cacache "^16.0.0" - chownr "^2.0.0" - fs-minipass "^2.1.0" - infer-owner "^1.0.4" - minipass "^3.1.6" - mkdirp "^1.0.4" - npm-package-arg "^9.0.0" - npm-packlist "^5.0.0" - npm-pick-manifest "^7.0.0" - npm-registry-fetch "^13.0.1" - proc-log "^2.0.0" - promise-retry "^2.0.1" - read-package-json "^5.0.0" - read-package-json-fast "^2.0.3" - rimraf "^3.0.2" - ssri "^9.0.0" - tar "^6.1.11" - -pacote@^13.6.1: +pacote@^13.0.3, pacote@^13.6.1: version "13.6.1" resolved "https://registry.yarnpkg.com/pacote/-/pacote-13.6.1.tgz#ac6cbd9032b4c16e5c1e0c60138dfe44e4cc589d" integrity sha512-L+2BI1ougAPsFjXRyBhcKmfT016NscRFLv6Pz5EiNf1CCFJFU0pSKKQwsZTyAQB+sTuUL4TyFyp6J1Ork3dOqw== @@ -13350,6 +13099,13 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" +semver@*, semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@~7.3.0: + version "7.3.7" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" + integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== + dependencies: + lru-cache "^6.0.0" + "semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -13372,13 +13128,6 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@~7.3.0: - version "7.3.7" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" - integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== - dependencies: - lru-cache "^6.0.0" - send@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" From a009b83e7d591d1c97dca33fc538ce8c6d78e900 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 18 Feb 2023 23:36:29 -0500 Subject: [PATCH 02/15] Update test selector in ci.yml run --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8983d064fdd..5e54b63350d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -225,7 +225,7 @@ jobs: # we don't collect coverage for these tests on purpose - name: Run unit tests for ${{ matrix.package }} - run: npx nx test @typescript-eslint/${{ matrix.package }} --coverage=false + run: npx nx test ${{ matrix.package }} --coverage=false env: CI: true From c27c67d584157bbffd340cb1ea540e458a87b2ce Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 18 Feb 2023 23:42:06 -0500 Subject: [PATCH 03/15] Update another test selector in ci.yml run --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e54b63350d6..41d6666121c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -269,7 +269,7 @@ jobs: # we don't collect coverage for these tests on purpose - name: Run unit tests for ${{ matrix.package }} - run: npx nx test @typescript-eslint/${{ matrix.package }} --coverage=false + run: npx nx test ${{ matrix.package }} --coverage=false env: CI: true From 4019a178408e711e34941bf34e298e1ac81131bb Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 19 Feb 2023 00:24:02 -0500 Subject: [PATCH 04/15] Added version filtering to ast-spec and scope-manager fixtures --- packages/ast-spec/package.json | 2 + packages/ast-spec/tests/fixtures.test.ts | 54 ++++-- packages/ast-spec/typings/global.d.ts | 13 ++ packages/scope-manager/package.json | 2 + .../tests/eslint-scope/references.test.ts | 155 +++++++++--------- packages/scope-manager/tests/fixtures.test.ts | 31 +++- .../abstract-accessor-property.config.json | 3 + ...essor-property-type-annotation.config.json | 3 + .../declaration/accessor-property.config.json | 3 + .../fixtures/decorators/accessor.config.json | 3 + 10 files changed, 183 insertions(+), 86 deletions(-) create mode 100644 packages/scope-manager/tests/fixtures/class/declaration/abstract-accessor-property.config.json create mode 100644 packages/scope-manager/tests/fixtures/class/declaration/accessor-property-type-annotation.config.json create mode 100644 packages/scope-manager/tests/fixtures/class/declaration/accessor-property.config.json create mode 100644 packages/scope-manager/tests/fixtures/decorators/accessor.config.json diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 20958b3936cc..9e303320cb37 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -48,12 +48,14 @@ "@babel/parser": "*", "@microsoft/api-extractor": "^7.23.2", "@types/babel__core": "*", + "eslint": "*", "glob": "*", "jest-diff": "*", "jest-snapshot": "*", "jest-specific-snapshot": "*", "make-dir": "*", "pretty-format": "*", + "semver": "*", "typescript": "*" } } diff --git a/packages/ast-spec/tests/fixtures.test.ts b/packages/ast-spec/tests/fixtures.test.ts index df70fe613eb6..ed7fcc03a77d 100644 --- a/packages/ast-spec/tests/fixtures.test.ts +++ b/packages/ast-spec/tests/fixtures.test.ts @@ -1,7 +1,10 @@ +import { ESLint } from 'eslint'; import fs from 'fs'; import glob from 'glob'; import makeDir from 'make-dir'; import path from 'path'; +import * as semver from 'semver'; +import * as ts from 'typescript'; import { parseBabel } from './util/parsers/babel'; import type { @@ -44,8 +47,37 @@ const ERROR_FIXTURES: readonly string[] = glob.sync( `${SRC_DIR}/**/fixtures/_error_/*/fixture.{ts,tsx}`, ); -const FIXTURES: readonly Fixture[] = [...VALID_FIXTURES, ...ERROR_FIXTURES].map( - absolute => { +function loadConfig(configPath: string): ASTFixtureConfig { + try { + return require(configPath).default; + } catch { + return {}; + } +} + +function versionsSemverExcluded( + versions: ASTFixtureVersionsConfig | undefined, +): boolean { + if (!versions) { + return false; + } + + if (versions.eslint && !semver.satisfies(ESLint.version, versions.eslint)) { + return true; + } + + if ( + versions.typescript && + !semver.satisfies(ts.version, versions.typescript) + ) { + return true; + } + + return false; +} + +const FIXTURES: readonly Fixture[] = [...VALID_FIXTURES, ...ERROR_FIXTURES] + .map(absolute => { const relativeToSrc = path.relative(SRC_DIR, absolute); const { dir, ext } = path.parse(relativeToSrc); const segments = dir.split(path.sep).filter(s => s !== 'fixtures'); @@ -53,15 +85,15 @@ const FIXTURES: readonly Fixture[] = [...VALID_FIXTURES, ...ERROR_FIXTURES].map( const fixtureDir = path.join(SRC_DIR, dir); const configPath = path.join(fixtureDir, 'config' /* .ts */); const snapshotPath = path.join(fixtureDir, 'snapshots'); + const config = loadConfig(configPath); + + if (versionsSemverExcluded(config.versions)) { + return undefined; + } + return { absolute, - config: ((): ASTFixtureConfig => { - try { - return require(configPath).default; - } catch { - return {}; - } - })(), + config, ext, isError: absolute.includes('/_error_/'), isJSX: ext.endsWith('x'), @@ -99,8 +131,8 @@ const FIXTURES: readonly Fixture[] = [...VALID_FIXTURES, ...ERROR_FIXTURES].map( }, snapshotPath, }; - }, -); + }) + .filter((f): f is NonNullable => !!f); function hasErrorCode(e: unknown): e is { code: unknown } { return typeof e === 'object' && e != null && 'code' in e; diff --git a/packages/ast-spec/typings/global.d.ts b/packages/ast-spec/typings/global.d.ts index 4464c06fbcf7..ef475a6032c6 100644 --- a/packages/ast-spec/typings/global.d.ts +++ b/packages/ast-spec/typings/global.d.ts @@ -11,4 +11,17 @@ interface ASTFixtureConfig { * The value should be a description of why there isn't support - for example a github issue URL. */ readonly expectBabelToNotSupport?: string; + + /** + * Dependency version semver ranges to filter to in regression testing. + */ + readonly versions?: ASTFixtureVersionsConfig; +} + +/** + * Dependency version semver ranges to filter to in regression testing. + */ +interface ASTFixtureVersionsConfig { + readonly eslint?: string; + readonly typescript?: string; } diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 9ab6b584821d..6cb7a01d2156 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -44,12 +44,14 @@ "devDependencies": { "@types/glob": "*", "@typescript-eslint/typescript-estree": "5.52.0", + "eslint": "*", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", "prettier": "*", "pretty-format": "*", "rimraf": "*", + "semver": "*", "typescript": "*" }, "funding": { diff --git a/packages/scope-manager/tests/eslint-scope/references.test.ts b/packages/scope-manager/tests/eslint-scope/references.test.ts index 15ed88c9a1ef..ba6415ab484a 100644 --- a/packages/scope-manager/tests/eslint-scope/references.test.ts +++ b/packages/scope-manager/tests/eslint-scope/references.test.ts @@ -1,3 +1,6 @@ +import * as semver from 'semver'; +import * as ts from 'typescript'; + import { getRealVariables, parseAndAnalyze } from '../util'; describe('References:', () => { @@ -541,10 +544,11 @@ describe('References:', () => { ); }); - describe('When emitDecoratorMetadata is true', () => { - it('check type referenced by decorator metadata', () => { - const { scopeManager } = parseAndAnalyze( - ` + if (semver.satisfies(ts.version, '>=4')) { + describe('When emitDecoratorMetadata is true', () => { + it('check type referenced by decorator metadata', () => { + const { scopeManager } = parseAndAnalyze( + ` @deco class A { property: Type1; @@ -585,75 +589,78 @@ describe('References:', () => { foo(): TypeC; } `, - { - emitDecoratorMetadata: true, - }, - ); - - const classAScope = scopeManager.globalScope!.childScopes[0]; - const propertyTypeRef = classAScope.references[2]; - expect(propertyTypeRef.identifier.name).toBe('a'); - expect(propertyTypeRef.isTypeReference).toBe(true); - expect(propertyTypeRef.isValueReference).toBe(true); - - const setterParamTypeRef = classAScope.childScopes[0].references[0]; - expect(setterParamTypeRef.identifier.name).toBe('SetterType'); - expect(setterParamTypeRef.isTypeReference).toBe(true); - expect(setterParamTypeRef.isValueReference).toBe(false); - - const constructorParamTypeRef = classAScope.childScopes[1].references[0]; - expect(constructorParamTypeRef.identifier.name).toBe('b'); - expect(constructorParamTypeRef.isTypeReference).toBe(true); - expect(constructorParamTypeRef.isValueReference).toBe(true); - - const methodParamTypeRef = classAScope.childScopes[2].references[0]; - expect(methodParamTypeRef.identifier.name).toBe('Type2'); - expect(methodParamTypeRef.isTypeReference).toBe(true); - expect(methodParamTypeRef.isValueReference).toBe(true); - const methodParamTypeRef0 = classAScope.childScopes[2].references[2]; - expect(methodParamTypeRef0.identifier.name).toBe('Type0'); - expect(methodParamTypeRef0.isTypeReference).toBe(true); - expect(methodParamTypeRef0.isValueReference).toBe(true); - - const methodParamTypeRef1 = classAScope.childScopes[3].references[0]; - expect(methodParamTypeRef1.identifier.name).toBe('Type3'); - expect(methodParamTypeRef1.isTypeReference).toBe(true); - expect(methodParamTypeRef1.isValueReference).toBe(true); - - const methodReturnTypeRef = classAScope.childScopes[4].references[0]; - expect(methodReturnTypeRef.identifier.name).toBe('Type4'); - expect(methodReturnTypeRef.isTypeReference).toBe(true); - expect(methodReturnTypeRef.isValueReference).toBe(true); - - const setterParamTypeRef1 = classAScope.childScopes[5].references[0]; - expect(setterParamTypeRef1.identifier.name).toBe('Type5'); - expect(setterParamTypeRef1.isTypeReference).toBe(true); - expect(setterParamTypeRef1.isValueReference).toBe(true); - - const setterParamTypeRef2 = classAScope.childScopes[6].references[0]; - expect(setterParamTypeRef2.identifier.name).toBe('Type6'); - expect(setterParamTypeRef2.isTypeReference).toBe(true); - expect(setterParamTypeRef2.isValueReference).toBe(true); - - const classBScope = scopeManager.globalScope!.childScopes[1]; - - const constructorParamTypeRef1 = classBScope.childScopes[0].references[0]; - expect(constructorParamTypeRef1.identifier.name).toBe('c'); - expect(constructorParamTypeRef1.isTypeReference).toBe(true); - expect(constructorParamTypeRef1.isValueReference).toBe(true); - - const setterParamTypeRef3 = classBScope.childScopes[1].references[0]; - // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum - expect(setterParamTypeRef3.identifier.name).toBe('Type'); - expect(setterParamTypeRef3.isTypeReference).toBe(true); - expect(setterParamTypeRef3.isValueReference).toBe(false); - - const classCScope = scopeManager.globalScope!.childScopes[2]; - - const methodReturnTypeRef1 = classCScope.childScopes[0].references[0]; - expect(methodReturnTypeRef1.identifier.name).toBe('TypeC'); - expect(methodReturnTypeRef1.isTypeReference).toBe(true); - expect(methodReturnTypeRef1.isValueReference).toBe(false); + { + emitDecoratorMetadata: true, + }, + ); + + const classAScope = scopeManager.globalScope!.childScopes[0]; + const propertyTypeRef = classAScope.references[2]; + expect(propertyTypeRef.identifier.name).toBe('a'); + expect(propertyTypeRef.isTypeReference).toBe(true); + expect(propertyTypeRef.isValueReference).toBe(true); + + const setterParamTypeRef = classAScope.childScopes[0].references[0]; + expect(setterParamTypeRef.identifier.name).toBe('SetterType'); + expect(setterParamTypeRef.isTypeReference).toBe(true); + expect(setterParamTypeRef.isValueReference).toBe(false); + + const constructorParamTypeRef = + classAScope.childScopes[1].references[0]; + expect(constructorParamTypeRef.identifier.name).toBe('b'); + expect(constructorParamTypeRef.isTypeReference).toBe(true); + expect(constructorParamTypeRef.isValueReference).toBe(true); + + const methodParamTypeRef = classAScope.childScopes[2].references[0]; + expect(methodParamTypeRef.identifier.name).toBe('Type2'); + expect(methodParamTypeRef.isTypeReference).toBe(true); + expect(methodParamTypeRef.isValueReference).toBe(true); + const methodParamTypeRef0 = classAScope.childScopes[2].references[2]; + expect(methodParamTypeRef0.identifier.name).toBe('Type0'); + expect(methodParamTypeRef0.isTypeReference).toBe(true); + expect(methodParamTypeRef0.isValueReference).toBe(true); + + const methodParamTypeRef1 = classAScope.childScopes[3].references[0]; + expect(methodParamTypeRef1.identifier.name).toBe('Type3'); + expect(methodParamTypeRef1.isTypeReference).toBe(true); + expect(methodParamTypeRef1.isValueReference).toBe(true); + + const methodReturnTypeRef = classAScope.childScopes[4].references[0]; + expect(methodReturnTypeRef.identifier.name).toBe('Type4'); + expect(methodReturnTypeRef.isTypeReference).toBe(true); + expect(methodReturnTypeRef.isValueReference).toBe(true); + + const setterParamTypeRef1 = classAScope.childScopes[5].references[0]; + expect(setterParamTypeRef1.identifier.name).toBe('Type5'); + expect(setterParamTypeRef1.isTypeReference).toBe(true); + expect(setterParamTypeRef1.isValueReference).toBe(true); + + const setterParamTypeRef2 = classAScope.childScopes[6].references[0]; + expect(setterParamTypeRef2.identifier.name).toBe('Type6'); + expect(setterParamTypeRef2.isTypeReference).toBe(true); + expect(setterParamTypeRef2.isValueReference).toBe(true); + + const classBScope = scopeManager.globalScope!.childScopes[1]; + + const constructorParamTypeRef1 = + classBScope.childScopes[0].references[0]; + expect(constructorParamTypeRef1.identifier.name).toBe('c'); + expect(constructorParamTypeRef1.isTypeReference).toBe(true); + expect(constructorParamTypeRef1.isValueReference).toBe(true); + + const setterParamTypeRef3 = classBScope.childScopes[1].references[0]; + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + expect(setterParamTypeRef3.identifier.name).toBe('Type'); + expect(setterParamTypeRef3.isTypeReference).toBe(true); + expect(setterParamTypeRef3.isValueReference).toBe(false); + + const classCScope = scopeManager.globalScope!.childScopes[2]; + + const methodReturnTypeRef1 = classCScope.childScopes[0].references[0]; + expect(methodReturnTypeRef1.identifier.name).toBe('TypeC'); + expect(methodReturnTypeRef1.isTypeReference).toBe(true); + expect(methodReturnTypeRef1.isValueReference).toBe(false); + }); }); - }); + } }); diff --git a/packages/scope-manager/tests/fixtures.test.ts b/packages/scope-manager/tests/fixtures.test.ts index fa86c1544c7b..9a963e872d3e 100644 --- a/packages/scope-manager/tests/fixtures.test.ts +++ b/packages/scope-manager/tests/fixtures.test.ts @@ -1,7 +1,10 @@ +import { ESLint } from 'eslint'; import fs from 'fs'; import glob from 'glob'; import makeDir from 'make-dir'; import path from 'path'; +import * as semver from 'semver'; +import * as ts from 'typescript'; import type { AnalyzeOptions } from './util'; import { parseAndAnalyze } from './util'; @@ -25,8 +28,10 @@ const fixtures = glob const { name, dir, ext } = path.parse(relative); const segments = dir.split(path.sep); const snapshotPath = path.join(FIXTURES_DIR, dir); + const configPath = path.join(snapshotPath, `${name}.config.json`); return { absolute, + configPath: fs.existsSync(configPath) ? configPath : undefined, name, ext, segments, @@ -51,6 +56,27 @@ const ALLOWED_OPTIONS: Map = new Map< ['emitDecoratorMetadata', ['boolean']], ]); +interface FixtureConfig { + eslint?: string; + typescript?: string; +} + +function shouldSkipFixture(configPath: string): boolean { + const config = JSON.parse( + fs.readFileSync(configPath, 'utf8').toString(), + ) as FixtureConfig; + + if (config.eslint && !semver.satisfies(ESLint.version, config.eslint)) { + return true; + } + + if (config.typescript && !semver.satisfies(ts.version, config.typescript)) { + return true; + } + + return false; +} + function nestDescribe( fixture: typeof fixtures[number], segments = fixture.segments, @@ -164,7 +190,10 @@ function nestDescribe( } }; - if ([...fixture.segments, fixture.name].join(path.sep) === ONLY) { + if (fixture.configPath && shouldSkipFixture(fixture.configPath)) { + // eslint-disable-next-line jest/no-disabled-tests + it.skip(fixture.name, test); + } else if ([...fixture.segments, fixture.name].join(path.sep) === ONLY) { // eslint-disable-next-line jest/no-focused-tests it.only(fixture.name, test); } else { diff --git a/packages/scope-manager/tests/fixtures/class/declaration/abstract-accessor-property.config.json b/packages/scope-manager/tests/fixtures/class/declaration/abstract-accessor-property.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/abstract-accessor-property.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/class/declaration/accessor-property-type-annotation.config.json b/packages/scope-manager/tests/fixtures/class/declaration/accessor-property-type-annotation.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/accessor-property-type-annotation.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/class/declaration/accessor-property.config.json b/packages/scope-manager/tests/fixtures/class/declaration/accessor-property.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/accessor-property.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/decorators/accessor.config.json b/packages/scope-manager/tests/fixtures/decorators/accessor.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/decorators/accessor.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} From 41ec3de551603973b3c5fadd0fa9dd3ea0aad9c4 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 19 Feb 2023 01:06:30 -0500 Subject: [PATCH 05/15] One more fixture config in scope-manager --- .../tests/fixtures/type-assertion/satisfies.config.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 packages/scope-manager/tests/fixtures/type-assertion/satisfies.config.json diff --git a/packages/scope-manager/tests/fixtures/type-assertion/satisfies.config.json b/packages/scope-manager/tests/fixtures/type-assertion/satisfies.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-assertion/satisfies.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} From dbfc0f0e0ac52ccf11ffa2acd61998ac3c166bcb Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 19 Feb 2023 01:08:19 -0500 Subject: [PATCH 06/15] Skip RuleTester tests under 8 --- .../utils/tests/eslint-utils/rule-tester/RuleTester.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts b/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts index 57ac48b38c18..e4687f47bb2b 100644 --- a/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts +++ b/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts @@ -1,5 +1,7 @@ import * as parser from '@typescript-eslint/parser'; +import { ESLint } from 'eslint'; import eslintPackageJson from 'eslint/package.json'; +import semver from 'semver'; import * as dependencyConstraintsModule from '../../../src/eslint-utils/rule-tester/dependencyConstraints'; import { RuleTester } from '../../../src/eslint-utils/rule-tester/RuleTester'; @@ -99,7 +101,9 @@ const NOOP_RULE: RuleModule<'error', []> = { }, }; -describe('RuleTester', () => { +(semver.satisfies((ESLint as { version: string }).version, '>=8') + ? describe + : describe.skip)('RuleTester', () => { it('automatically sets the filename for tests', () => { const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', From 0c1bac139338dfce2910a1a2606fc33ba7848d3c Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 19 Feb 2023 20:07:35 -0500 Subject: [PATCH 07/15] A few more --- .../tests/fixtures/call-expression/call-expression.config.json | 3 +++ .../fixtures/class/declaration/private-identifier.config.json | 3 +++ .../tests/fixtures/class/declaration/static-block.config.json | 3 +++ .../fixtures/class/declaration/static-external-ref.config.json | 3 +++ .../class/declaration/static-with-constructor.config.json | 3 +++ .../fixtures/class/emit-metadata/accessor-deco.config.json | 3 +++ .../fixtures/class/expression/private-identifier.config.json | 3 +++ 7 files changed, 21 insertions(+) create mode 100644 packages/scope-manager/tests/fixtures/call-expression/call-expression.config.json create mode 100644 packages/scope-manager/tests/fixtures/class/declaration/private-identifier.config.json create mode 100644 packages/scope-manager/tests/fixtures/class/declaration/static-block.config.json create mode 100644 packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.config.json create mode 100644 packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.config.json create mode 100644 packages/scope-manager/tests/fixtures/class/emit-metadata/accessor-deco.config.json create mode 100644 packages/scope-manager/tests/fixtures/class/expression/private-identifier.config.json diff --git a/packages/scope-manager/tests/fixtures/call-expression/call-expression.config.json b/packages/scope-manager/tests/fixtures/call-expression/call-expression.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/call-expression/call-expression.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/class/declaration/private-identifier.config.json b/packages/scope-manager/tests/fixtures/class/declaration/private-identifier.config.json new file mode 100644 index 000000000000..4e3aee9f144f --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/private-identifier.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.3" +} diff --git a/packages/scope-manager/tests/fixtures/class/declaration/static-block.config.json b/packages/scope-manager/tests/fixtures/class/declaration/static-block.config.json new file mode 100644 index 000000000000..3bc2566a3010 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/static-block.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.4" +} diff --git a/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.config.json b/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.config.json new file mode 100644 index 000000000000..3bc2566a3010 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.4" +} diff --git a/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.config.json b/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.config.json new file mode 100644 index 000000000000..3bc2566a3010 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.4" +} diff --git a/packages/scope-manager/tests/fixtures/class/emit-metadata/accessor-deco.config.json b/packages/scope-manager/tests/fixtures/class/emit-metadata/accessor-deco.config.json new file mode 100644 index 000000000000..3bc2566a3010 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/emit-metadata/accessor-deco.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.4" +} diff --git a/packages/scope-manager/tests/fixtures/class/expression/private-identifier.config.json b/packages/scope-manager/tests/fixtures/class/expression/private-identifier.config.json new file mode 100644 index 000000000000..4e3aee9f144f --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/expression/private-identifier.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.3" +} From f3bdd5a63a4a0e54f1e1663043e57ff8e063b774 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 20 Feb 2023 11:43:53 -0500 Subject: [PATCH 08/15] Raised minimum to 4.2 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41d6666121c6..3f88d6cc9edc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -191,9 +191,9 @@ jobs: # unfortunately you can't reference environment variables in an array :( [ # lowest possible version - '3.3.1', + '4.2.4', # somewhere in the middle for sanity check - '~4.0.8', + '~4.5.5', # highest possible version '~4.8.2', ] From 1503c91347182d7cf083212b9e2cbd8cdc36ba0d Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 20 Feb 2023 12:04:50 -0500 Subject: [PATCH 09/15] 19 more scope-manager snapshots --- .../fixtures/class/emit-metadata/accessor-deco.config.json | 2 +- .../tests/fixtures/class/emit-metadata/method-deco.config.json | 3 +++ .../class/emit-metadata/method-return-generic.config.json | 3 +++ .../fixtures/class/emit-metadata/nested-class-both.config.json | 3 +++ .../class/emit-metadata/nested-class-inner.config.json | 3 +++ .../class/emit-metadata/nested-class-outer.config.json | 3 +++ .../fixtures/class/emit-metadata/parameters-deco.config.json | 3 +++ .../fixtures/class/emit-metadata/property-deco.config.json | 3 +++ .../decorators/class-deco-with-object-param.config.json | 3 +++ .../tests/fixtures/decorators/class-property.config.json | 3 +++ .../scope-manager/tests/fixtures/decorators/class.config.json | 3 +++ .../scope-manager/tests/fixtures/decorators/method.config.json | 3 +++ .../tests/fixtures/decorators/parameter-property.config.json | 3 +++ .../tests/fixtures/decorators/parameter.config.json | 3 +++ .../tests/fixtures/decorators/typeof-this.config.json | 3 +++ .../instantiation-expressions/type-arguments1.config.json | 3 +++ .../instantiation-expressions/type-arguments2.config.json | 3 +++ .../type-declaration/infer-type-constraint.config.json | 3 +++ .../type-declaration/type-query-with-parameters.config.json | 3 +++ 19 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 packages/scope-manager/tests/fixtures/class/emit-metadata/method-deco.config.json create mode 100644 packages/scope-manager/tests/fixtures/class/emit-metadata/method-return-generic.config.json create mode 100644 packages/scope-manager/tests/fixtures/class/emit-metadata/nested-class-both.config.json create mode 100644 packages/scope-manager/tests/fixtures/class/emit-metadata/nested-class-inner.config.json create mode 100644 packages/scope-manager/tests/fixtures/class/emit-metadata/nested-class-outer.config.json create mode 100644 packages/scope-manager/tests/fixtures/class/emit-metadata/parameters-deco.config.json create mode 100644 packages/scope-manager/tests/fixtures/class/emit-metadata/property-deco.config.json create mode 100644 packages/scope-manager/tests/fixtures/decorators/class-deco-with-object-param.config.json create mode 100644 packages/scope-manager/tests/fixtures/decorators/class-property.config.json create mode 100644 packages/scope-manager/tests/fixtures/decorators/class.config.json create mode 100644 packages/scope-manager/tests/fixtures/decorators/method.config.json create mode 100644 packages/scope-manager/tests/fixtures/decorators/parameter-property.config.json create mode 100644 packages/scope-manager/tests/fixtures/decorators/parameter.config.json create mode 100644 packages/scope-manager/tests/fixtures/decorators/typeof-this.config.json create mode 100644 packages/scope-manager/tests/fixtures/instantiation-expressions/type-arguments1.config.json create mode 100644 packages/scope-manager/tests/fixtures/instantiation-expressions/type-arguments2.config.json create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/infer-type-constraint.config.json create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/type-query-with-parameters.config.json diff --git a/packages/scope-manager/tests/fixtures/class/emit-metadata/accessor-deco.config.json b/packages/scope-manager/tests/fixtures/class/emit-metadata/accessor-deco.config.json index 3bc2566a3010..e475530972bd 100644 --- a/packages/scope-manager/tests/fixtures/class/emit-metadata/accessor-deco.config.json +++ b/packages/scope-manager/tests/fixtures/class/emit-metadata/accessor-deco.config.json @@ -1,3 +1,3 @@ { - "typescript": ">=4.4" + "typescript": ">=4.9" } diff --git a/packages/scope-manager/tests/fixtures/class/emit-metadata/method-deco.config.json b/packages/scope-manager/tests/fixtures/class/emit-metadata/method-deco.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/emit-metadata/method-deco.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/class/emit-metadata/method-return-generic.config.json b/packages/scope-manager/tests/fixtures/class/emit-metadata/method-return-generic.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/emit-metadata/method-return-generic.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/class/emit-metadata/nested-class-both.config.json b/packages/scope-manager/tests/fixtures/class/emit-metadata/nested-class-both.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/emit-metadata/nested-class-both.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/class/emit-metadata/nested-class-inner.config.json b/packages/scope-manager/tests/fixtures/class/emit-metadata/nested-class-inner.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/emit-metadata/nested-class-inner.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/class/emit-metadata/nested-class-outer.config.json b/packages/scope-manager/tests/fixtures/class/emit-metadata/nested-class-outer.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/emit-metadata/nested-class-outer.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/class/emit-metadata/parameters-deco.config.json b/packages/scope-manager/tests/fixtures/class/emit-metadata/parameters-deco.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/emit-metadata/parameters-deco.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/class/emit-metadata/property-deco.config.json b/packages/scope-manager/tests/fixtures/class/emit-metadata/property-deco.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/emit-metadata/property-deco.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/decorators/class-deco-with-object-param.config.json b/packages/scope-manager/tests/fixtures/decorators/class-deco-with-object-param.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/decorators/class-deco-with-object-param.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/decorators/class-property.config.json b/packages/scope-manager/tests/fixtures/decorators/class-property.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/decorators/class-property.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/decorators/class.config.json b/packages/scope-manager/tests/fixtures/decorators/class.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/decorators/class.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/decorators/method.config.json b/packages/scope-manager/tests/fixtures/decorators/method.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/decorators/method.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/decorators/parameter-property.config.json b/packages/scope-manager/tests/fixtures/decorators/parameter-property.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/decorators/parameter-property.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/decorators/parameter.config.json b/packages/scope-manager/tests/fixtures/decorators/parameter.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/decorators/parameter.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/decorators/typeof-this.config.json b/packages/scope-manager/tests/fixtures/decorators/typeof-this.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/decorators/typeof-this.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/instantiation-expressions/type-arguments1.config.json b/packages/scope-manager/tests/fixtures/instantiation-expressions/type-arguments1.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/instantiation-expressions/type-arguments1.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/instantiation-expressions/type-arguments2.config.json b/packages/scope-manager/tests/fixtures/instantiation-expressions/type-arguments2.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/instantiation-expressions/type-arguments2.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/type-declaration/infer-type-constraint.config.json b/packages/scope-manager/tests/fixtures/type-declaration/infer-type-constraint.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/infer-type-constraint.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type-query-with-parameters.config.json b/packages/scope-manager/tests/fixtures/type-declaration/type-query-with-parameters.config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/type-query-with-parameters.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} From 9b4b3ddf1215d0057ac61d74ef86d94293b33d12 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 20 Feb 2023 12:07:06 -0500 Subject: [PATCH 10/15] Only test RuleTester in >=8 --- .../rule-tester/RuleTester.test.ts | 710 +++++++++--------- 1 file changed, 357 insertions(+), 353 deletions(-) diff --git a/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts b/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts index e4687f47bb2b..bc08cc8ee185 100644 --- a/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts +++ b/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts @@ -101,53 +101,52 @@ const NOOP_RULE: RuleModule<'error', []> = { }, }; -(semver.satisfies((ESLint as { version: string }).version, '>=8') - ? describe - : describe.skip)('RuleTester', () => { - it('automatically sets the filename for tests', () => { - const ruleTester = new RuleTester({ - parser: '@typescript-eslint/parser', - parserOptions: { - project: 'tsconfig.json', - tsconfigRootDir: '/some/path/that/totally/exists/', - }, - }); - - ruleTester.run('my-rule', NOOP_RULE, { - invalid: [ - { - code: 'invalid tests should work as well', - errors: [], - }, - ], - valid: [ - 'string based valid test', - { - code: 'object based valid test', - }, - { - code: "explicit filename shouldn't be overwritten", - filename: '/set/in/the/test.ts', +describe('RuleTester', () => { + if (semver.satisfies((ESLint as { version: string }).version, '>=8')) { + it('automatically sets the filename for tests', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + parserOptions: { + project: 'tsconfig.json', + tsconfigRootDir: '/some/path/that/totally/exists/', }, - { - code: 'jsx should have the correct filename', - parserOptions: { - ecmaFeatures: { - jsx: true, + }); + + ruleTester.run('my-rule', NOOP_RULE, { + invalid: [ + { + code: 'invalid tests should work as well', + errors: [], + }, + ], + valid: [ + 'string based valid test', + { + code: 'object based valid test', + }, + { + code: "explicit filename shouldn't be overwritten", + filename: '/set/in/the/test.ts', + }, + { + code: 'jsx should have the correct filename', + parserOptions: { + ecmaFeatures: { + jsx: true, + }, }, }, - }, - { - code: 'type-aware parser options should override the constructor config', - parserOptions: { - project: 'tsconfig.test-specific.json', - tsconfigRootDir: '/set/in/the/test/', + { + code: 'type-aware parser options should override the constructor config', + parserOptions: { + project: 'tsconfig.test-specific.json', + tsconfigRootDir: '/set/in/the/test/', + }, }, - }, - ], - }); + ], + }); - expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` + expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` { "invalid": [ { @@ -189,74 +188,55 @@ const NOOP_RULE: RuleModule<'error', []> = { ], } `); - }); - - it('schedules the parser caches to be cleared afterAll', () => { - // it should schedule the afterAll - expect(mockedAfterAll).toHaveBeenCalledTimes(0); - const _ruleTester = new RuleTester({ - parser: '@typescript-eslint/parser', - parserOptions: { - project: 'tsconfig.json', - tsconfigRootDir: '/some/path/that/totally/exists/', - }, - }); - expect(mockedAfterAll).toHaveBeenCalledTimes(1); - - // the provided callback should clear the caches - const callback = mockedAfterAll.mock.calls[0][0]; - expect(typeof callback).toBe('function'); - expect(mockedParserClearCaches).not.toHaveBeenCalled(); - callback(); - expect(mockedParserClearCaches).toHaveBeenCalledTimes(1); - }); - - it('throws an error if you attempt to set the parser to ts-eslint at the test level', () => { - const ruleTester = new RuleTester({ - parser: '@typescript-eslint/parser', - parserOptions: { - project: 'tsconfig.json', - tsconfigRootDir: '/some/path/that/totally/exists/', - }, }); - expect(() => - ruleTester.run('my-rule', NOOP_RULE, { - valid: [ - { - code: 'object based valid test', - parser: '@typescript-eslint/parser', - }, - ], - - invalid: [], - }), - ).toThrowErrorMatchingInlineSnapshot( - `"Do not set the parser at the test level unless you want to use a parser other than @typescript-eslint/parser"`, - ); - }); + it('schedules the parser caches to be cleared afterAll', () => { + // it should schedule the afterAll + expect(mockedAfterAll).toHaveBeenCalledTimes(0); + const _ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + parserOptions: { + project: 'tsconfig.json', + tsconfigRootDir: '/some/path/that/totally/exists/', + }, + }); + expect(mockedAfterAll).toHaveBeenCalledTimes(1); + + // the provided callback should clear the caches + const callback = mockedAfterAll.mock.calls[0][0]; + expect(typeof callback).toBe('function'); + expect(mockedParserClearCaches).not.toHaveBeenCalled(); + callback(); + expect(mockedParserClearCaches).toHaveBeenCalledTimes(1); + }); - describe('checks dependencies as specified', () => { - it('does not check dependencies if there are no dependency constraints', () => { + it('throws an error if you attempt to set the parser to ts-eslint at the test level', () => { const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', + parserOptions: { + project: 'tsconfig.json', + tsconfigRootDir: '/some/path/that/totally/exists/', + }, }); - ruleTester.run('my-rule', NOOP_RULE, { - valid: [ - 'const x = 1;', - { code: 'const x = 2;' }, - // empty object is ignored - { code: 'const x = 3;', dependencyConstraints: {} }, - ], - invalid: [], - }); + expect(() => + ruleTester.run('my-rule', NOOP_RULE, { + valid: [ + { + code: 'object based valid test', + parser: '@typescript-eslint/parser', + }, + ], - expect(satisfiesAllDependencyConstraintsMock).not.toHaveBeenCalled(); + invalid: [], + }), + ).toThrowErrorMatchingInlineSnapshot( + `"Do not set the parser at the test level unless you want to use a parser other than @typescript-eslint/parser"`, + ); }); - describe('does not check dependencies if is an "only" manually set', () => { - it('in the valid section', () => { + describe('checks dependencies as specified', () => { + it('does not check dependencies if there are no dependency constraints', () => { const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', }); @@ -265,17 +245,8 @@ const NOOP_RULE: RuleModule<'error', []> = { valid: [ 'const x = 1;', { code: 'const x = 2;' }, - { - code: 'const x = 3;', - // eslint-disable-next-line eslint-plugin/no-only-tests -- intentional only for test purposes - only: true, - }, - { - code: 'const x = 4;', - dependencyConstraints: { - 'totally-real-dependency': '999', - }, - }, + // empty object is ignored + { code: 'const x = 3;', dependencyConstraints: {} }, ], invalid: [], }); @@ -283,88 +254,116 @@ const NOOP_RULE: RuleModule<'error', []> = { expect(satisfiesAllDependencyConstraintsMock).not.toHaveBeenCalled(); }); - it('in the invalid section', () => { + describe('does not check dependencies if is an "only" manually set', () => { + it('in the valid section', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + }); + + ruleTester.run('my-rule', NOOP_RULE, { + valid: [ + 'const x = 1;', + { code: 'const x = 2;' }, + { + code: 'const x = 3;', + // eslint-disable-next-line eslint-plugin/no-only-tests -- intentional only for test purposes + only: true, + }, + { + code: 'const x = 4;', + dependencyConstraints: { + 'totally-real-dependency': '999', + }, + }, + ], + invalid: [], + }); + + expect(satisfiesAllDependencyConstraintsMock).not.toHaveBeenCalled(); + }); + + it('in the invalid section', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + }); + + ruleTester.run('my-rule', NOOP_RULE, { + valid: [ + 'const x = 1;', + { code: 'const x = 2;' }, + { + code: 'const x = 4;', + dependencyConstraints: { + 'totally-real-dependency': '999', + }, + }, + ], + invalid: [ + { + code: 'const x = 3;', + errors: [], + // eslint-disable-next-line eslint-plugin/no-only-tests -- intentional only for test purposes + only: true, + }, + ], + }); + + expect(satisfiesAllDependencyConstraintsMock).not.toHaveBeenCalled(); + }); + }); + + it('correctly handles string-based at-least', () => { const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', }); ruleTester.run('my-rule', NOOP_RULE, { - valid: [ - 'const x = 1;', - { code: 'const x = 2;' }, + invalid: [ { - code: 'const x = 4;', + code: 'failing - major', + errors: [], dependencyConstraints: { 'totally-real-dependency': '999', }, }, - ], - invalid: [ { - code: 'const x = 3;', + code: 'failing - major.minor', errors: [], - // eslint-disable-next-line eslint-plugin/no-only-tests -- intentional only for test purposes - only: true, - }, - ], - }); - - expect(satisfiesAllDependencyConstraintsMock).not.toHaveBeenCalled(); - }); - }); - - it('correctly handles string-based at-least', () => { - const ruleTester = new RuleTester({ - parser: '@typescript-eslint/parser', - }); - - ruleTester.run('my-rule', NOOP_RULE, { - invalid: [ - { - code: 'failing - major', - errors: [], - dependencyConstraints: { - 'totally-real-dependency': '999', - }, - }, - { - code: 'failing - major.minor', - errors: [], - dependencyConstraints: { - 'totally-real-dependency': '999.0', + dependencyConstraints: { + 'totally-real-dependency': '999.0', + }, }, - }, - { - code: 'failing - major.minor.patch', - errors: [], - dependencyConstraints: { - 'totally-real-dependency': '999.0.0', + { + code: 'failing - major.minor.patch', + errors: [], + dependencyConstraints: { + 'totally-real-dependency': '999.0.0', + }, }, - }, - ], - valid: [ - { - code: 'passing - major', - dependencyConstraints: { - 'totally-real-dependency': '10', + ], + valid: [ + { + code: 'passing - major', + dependencyConstraints: { + 'totally-real-dependency': '10', + }, }, - }, - { - code: 'passing - major.minor', - dependencyConstraints: { - 'totally-real-dependency': '10.0', + { + code: 'passing - major.minor', + dependencyConstraints: { + 'totally-real-dependency': '10.0', + }, }, - }, - { - code: 'passing - major.minor.patch', - dependencyConstraints: { - 'totally-real-dependency': '10.0.0', + { + code: 'passing - major.minor.patch', + dependencyConstraints: { + 'totally-real-dependency': '10.0.0', + }, }, - }, - ], - }); + ], + }); - expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` + expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` { "invalid": [ { @@ -399,68 +398,68 @@ const NOOP_RULE: RuleModule<'error', []> = { ], } `); - }); - - it('correctly handles object-based semver', () => { - const ruleTester = new RuleTester({ - parser: '@typescript-eslint/parser', }); - ruleTester.run('my-rule', NOOP_RULE, { - invalid: [ - { - code: 'failing - major', - errors: [], - dependencyConstraints: { - 'totally-real-dependency': { - range: '^999', + it('correctly handles object-based semver', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + }); + + ruleTester.run('my-rule', NOOP_RULE, { + invalid: [ + { + code: 'failing - major', + errors: [], + dependencyConstraints: { + 'totally-real-dependency': { + range: '^999', + }, }, }, - }, - { - code: 'failing - major.minor', - errors: [], - dependencyConstraints: { - 'totally-real-dependency': { - range: '>=999.0', + { + code: 'failing - major.minor', + errors: [], + dependencyConstraints: { + 'totally-real-dependency': { + range: '>=999.0', + }, }, }, - }, - { - code: 'failing with options', - errors: [], - dependencyConstraints: { - 'totally-real-dependency-prerelease': { - range: '^10', - options: { - includePrerelease: false, + { + code: 'failing with options', + errors: [], + dependencyConstraints: { + 'totally-real-dependency-prerelease': { + range: '^10', + options: { + includePrerelease: false, + }, }, }, }, - }, - ], - valid: [ - { - code: 'passing - major', - dependencyConstraints: { - 'totally-real-dependency': { - range: '^10', + ], + valid: [ + { + code: 'passing - major', + dependencyConstraints: { + 'totally-real-dependency': { + range: '^10', + }, }, }, - }, - { - code: 'passing - major.minor', - dependencyConstraints: { - 'totally-real-dependency': { - range: '<999', + { + code: 'passing - major.minor', + dependencyConstraints: { + 'totally-real-dependency': { + range: '<999', + }, }, }, - }, - ], - }); + ], + }); - expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` + expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` { "invalid": [ { @@ -491,51 +490,51 @@ const NOOP_RULE: RuleModule<'error', []> = { ], } `); - }); - - it('tests without versions should always be run', () => { - const ruleTester = new RuleTester({ - parser: '@typescript-eslint/parser', }); - ruleTester.run('my-rule', NOOP_RULE, { - invalid: [ - { - code: 'no constraints is always run', - errors: [], - }, - { - code: 'empty object is always run', - errors: [], - dependencyConstraints: {}, - }, - { - code: 'failing constraint', - errors: [], - dependencyConstraints: { - 'totally-real-dependency': '99999', + it('tests without versions should always be run', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + }); + + ruleTester.run('my-rule', NOOP_RULE, { + invalid: [ + { + code: 'no constraints is always run', + errors: [], }, - }, - ], - valid: [ - 'string based is always run', - { - code: 'no constraints is always run', - }, - { - code: 'empty object is always run', - dependencyConstraints: {}, - }, - { - code: 'passing constraint', - dependencyConstraints: { - 'totally-real-dependency': '10', + { + code: 'empty object is always run', + errors: [], + dependencyConstraints: {}, }, - }, - ], - }); + { + code: 'failing constraint', + errors: [], + dependencyConstraints: { + 'totally-real-dependency': '99999', + }, + }, + ], + valid: [ + 'string based is always run', + { + code: 'no constraints is always run', + }, + { + code: 'empty object is always run', + dependencyConstraints: {}, + }, + { + code: 'passing constraint', + dependencyConstraints: { + 'totally-real-dependency': '10', + }, + }, + ], + }); - expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` + expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` { "invalid": [ { @@ -574,52 +573,52 @@ const NOOP_RULE: RuleModule<'error', []> = { ], } `); - }); + }); - it('uses filter instead of "only" for old ESLint versions', () => { - // need it twice because ESLint internally fetches this value once :( - eslintVersionSpy.mockReturnValueOnce('1.0.0'); - eslintVersionSpy.mockReturnValueOnce('1.0.0'); + it('uses filter instead of "only" for old ESLint versions', () => { + // need it twice because ESLint internally fetches this value once :( + eslintVersionSpy.mockReturnValueOnce('1.0.0'); + eslintVersionSpy.mockReturnValueOnce('1.0.0'); - const ruleTester = new RuleTester({ - parser: '@typescript-eslint/parser', - }); + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + }); - ruleTester.run('my-rule', NOOP_RULE, { - invalid: [ - { - code: 'failing', - errors: [], - dependencyConstraints: { - 'totally-real-dependency': '999', + ruleTester.run('my-rule', NOOP_RULE, { + invalid: [ + { + code: 'failing', + errors: [], + dependencyConstraints: { + 'totally-real-dependency': '999', + }, }, - }, - { - code: 'passing', - errors: [], - dependencyConstraints: { - 'totally-real-dependency': '10', + { + code: 'passing', + errors: [], + dependencyConstraints: { + 'totally-real-dependency': '10', + }, }, - }, - ], - valid: [ - 'always passing string test', - { - code: 'failing', - dependencyConstraints: { - 'totally-real-dependency': '999', + ], + valid: [ + 'always passing string test', + { + code: 'failing', + dependencyConstraints: { + 'totally-real-dependency': '999', + }, }, - }, - { - code: 'passing', - dependencyConstraints: { - 'totally-real-dependency': '10', + { + code: 'passing', + dependencyConstraints: { + 'totally-real-dependency': '10', + }, }, - }, - ], - }); + ], + }); - expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` + expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` { "invalid": [ { @@ -649,35 +648,35 @@ const NOOP_RULE: RuleModule<'error', []> = { ], } `); - }); - - describe('constructor constraints', () => { - it('skips all tests if a constructor constraint is not satisifed', () => { - const ruleTester = new RuleTester({ - parser: '@typescript-eslint/parser', - dependencyConstraints: { - 'totally-real-dependency': '999', - }, - }); + }); - ruleTester.run('my-rule', NOOP_RULE, { - invalid: [ - { - code: 'failing - major', - errors: [], - }, - ], - valid: [ - { - code: 'passing - major', + describe('constructor constraints', () => { + it('skips all tests if a constructor constraint is not satisifed', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + dependencyConstraints: { + 'totally-real-dependency': '999', }, - ], - }); + }); + + ruleTester.run('my-rule', NOOP_RULE, { + invalid: [ + { + code: 'failing - major', + errors: [], + }, + ], + valid: [ + { + code: 'passing - major', + }, + ], + }); - // trigger the describe block - expect(mockedDescribe.mock.calls.length).toBeGreaterThanOrEqual(1); - mockedDescribe.mock.lastCall?.[1](); - expect(mockedDescribe.mock.calls).toMatchInlineSnapshot(` + // trigger the describe block + expect(mockedDescribe.mock.calls.length).toBeGreaterThanOrEqual(1); + mockedDescribe.mock.lastCall?.[1](); + expect(mockedDescribe.mock.calls).toMatchInlineSnapshot(` [ [ "my-rule", @@ -685,40 +684,40 @@ const NOOP_RULE: RuleModule<'error', []> = { ], ] `); - expect(mockedIt.mock.lastCall).toMatchInlineSnapshot(` + expect(mockedIt.mock.lastCall).toMatchInlineSnapshot(` [ "All tests skipped due to unsatisfied constructor dependency constraints", [Function], ] `); - }); - - it('does not skip all tests if a constructor constraint is satisifed', () => { - const ruleTester = new RuleTester({ - parser: '@typescript-eslint/parser', - dependencyConstraints: { - 'totally-real-dependency': '10', - }, }); - ruleTester.run('my-rule', NOOP_RULE, { - invalid: [ - { - code: 'valid', - errors: [], - }, - ], - valid: [ - { - code: 'valid', + it('does not skip all tests if a constructor constraint is satisifed', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + dependencyConstraints: { + 'totally-real-dependency': '10', }, - ], - }); + }); - // trigger the describe block - expect(mockedDescribe.mock.calls.length).toBeGreaterThanOrEqual(1); - mockedDescribe.mock.lastCall?.[1](); - expect(mockedDescribe.mock.calls).toMatchInlineSnapshot(` + ruleTester.run('my-rule', NOOP_RULE, { + invalid: [ + { + code: 'valid', + errors: [], + }, + ], + valid: [ + { + code: 'valid', + }, + ], + }); + + // trigger the describe block + expect(mockedDescribe.mock.calls.length).toBeGreaterThanOrEqual(1); + mockedDescribe.mock.lastCall?.[1](); + expect(mockedDescribe.mock.calls).toMatchInlineSnapshot(` [ [ "my-rule", @@ -734,8 +733,13 @@ const NOOP_RULE: RuleModule<'error', []> = { ], ] `); - // expect(mockedIt.mock.lastCall).toMatchInlineSnapshot(`undefined`); + // expect(mockedIt.mock.lastCall).toMatchInlineSnapshot(`undefined`); + }); }); }); - }); + } else { + it('exists', () => { + expect(RuleTester).toBeTruthy(); + }); + } }); From f6de3ff3c5b0427d50856641fc8d5d95e3ef5bc9 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 20 Feb 2023 13:18:01 -0500 Subject: [PATCH 11/15] fail-fast: false, and a small version fix --- .github/workflows/ci.yml | 5 +++++ packages/scope-manager/tests/eslint-scope/references.test.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed7efcbe1bcb..933ae60f15d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,7 @@ jobs: needs: [install] runs-on: ubuntu-latest strategy: + fail-fast: false matrix: lint-task: ['check-spelling', 'check-format', 'lint-markdown'] steps: @@ -82,6 +83,7 @@ jobs: needs: [build] runs-on: ubuntu-latest strategy: + fail-fast: false matrix: lint-task: ['lint', 'typecheck'] steps: @@ -121,6 +123,7 @@ jobs: needs: [build] runs-on: ubuntu-latest strategy: + fail-fast: false matrix: # just run on the oldest and latest supported versions and assume the intermediate versions are good # unfortunately you can't reference environment variables in an array :( @@ -184,6 +187,7 @@ jobs: needs: [build] runs-on: ubuntu-latest strategy: + fail-fast: false matrix: package: # note that we don't regression test all packages here on purpose because most don't depend on TS directly. @@ -236,6 +240,7 @@ jobs: needs: [build] runs-on: ubuntu-latest strategy: + fail-fast: false matrix: package: # note that we don't regression test all packages here on purpose because most don't depend on ESLint directly. diff --git a/packages/scope-manager/tests/eslint-scope/references.test.ts b/packages/scope-manager/tests/eslint-scope/references.test.ts index ba6415ab484a..05593ffe25b1 100644 --- a/packages/scope-manager/tests/eslint-scope/references.test.ts +++ b/packages/scope-manager/tests/eslint-scope/references.test.ts @@ -544,7 +544,7 @@ describe('References:', () => { ); }); - if (semver.satisfies(ts.version, '>=4')) { + if (semver.satisfies(ts.version, '>=4.9')) { describe('When emitDecoratorMetadata is true', () => { it('check type referenced by decorator metadata', () => { const { scopeManager } = parseAndAnalyze( From c7bf8cccf5c023425f35d351deecee40492699f5 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 20 Feb 2023 14:44:20 -0500 Subject: [PATCH 12/15] Added some dependencyConstraints --- .../tests/rules/consistent-type-imports.test.ts | 4 ++-- packages/eslint-plugin/tests/rules/member-ordering.test.ts | 3 +++ .../tests/rules/padding-line-between-statements.test.ts | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts index 2d41b0c3f981..47cf13cc4d49 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts @@ -7,9 +7,9 @@ const ruleTester = new RuleTester({ ecmaVersion: 2020, sourceType: 'module', }, - // type-only imports were first added in TS3.8 + // type-only imports were first added in TS3.8; TS4.5 added inline types dependencyConstraints: { - typescript: '3.8', + typescript: '4.5', }, }); diff --git a/packages/eslint-plugin/tests/rules/member-ordering.test.ts b/packages/eslint-plugin/tests/rules/member-ordering.test.ts index 3305bebfa8cd..902c7aa0f614 100644 --- a/packages/eslint-plugin/tests/rules/member-ordering.test.ts +++ b/packages/eslint-plugin/tests/rules/member-ordering.test.ts @@ -5,6 +5,9 @@ import { RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', + dependencyConstraints: { + typescript: '4.9', + }, }); const grouped: RunTests = { diff --git a/packages/eslint-plugin/tests/rules/padding-line-between-statements.test.ts b/packages/eslint-plugin/tests/rules/padding-line-between-statements.test.ts index 93b01ce6f333..f42d4a31139a 100644 --- a/packages/eslint-plugin/tests/rules/padding-line-between-statements.test.ts +++ b/packages/eslint-plugin/tests/rules/padding-line-between-statements.test.ts @@ -2801,6 +2801,9 @@ var a = 1 }, { code: 'export function foo(arg1: string): number;\nexport function foo(arg2: number) {\n return arg2;\n}', + dependencyConstraints: { + typescript: '4.5', + }, options: [ { blankLine: 'always', prev: '*', next: 'block-like' }, { blankLine: 'never', prev: '*', next: 'export' }, @@ -2808,6 +2811,9 @@ var a = 1 }, { code: 'function foo(arg1: string): number;\nfunction foo(arg2: number) {\n return arg2;\n}', + dependencyConstraints: { + typescript: '4.5', + }, options: [ { blankLine: 'always', prev: '*', next: 'block-like' }, { blankLine: 'never', prev: '*', next: 'function' }, From 45a8830b74ec8d5586a1e8c7b69f69eb65762d5c Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 20 Feb 2023 14:59:53 -0500 Subject: [PATCH 13/15] Corrected ESLint.version check --- .github/workflows/ci.yml | 2 +- .../utils/tests/eslint-utils/rule-tester/RuleTester.test.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 933ae60f15d7..ef5d9f5ad3ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -251,7 +251,7 @@ jobs: # lowest possible version '6.0.0', # somewhere in the middle for sanity check - '~7.32.0', + '7.32.0', # highest possible version '^8.0.0', ] diff --git a/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts b/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts index bc08cc8ee185..5c8e672d9e21 100644 --- a/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts +++ b/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts @@ -102,7 +102,10 @@ const NOOP_RULE: RuleModule<'error', []> = { }; describe('RuleTester', () => { - if (semver.satisfies((ESLint as { version: string }).version, '>=8')) { + if ( + 'version' in (ESLint as {}) && + semver.satisfies((ESLint as { version: string }).version, '>=8') + ) { it('automatically sets the filename for tests', () => { const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', From c792fb9aea5b4e5cca984361aa96f2c0b19ca2e4 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 20 Feb 2023 15:02:18 -0500 Subject: [PATCH 14/15] type-inline config.jsons --- .../tests/fixtures/export/type-inline.config.json | 3 +++ .../tests/fixtures/import/type-inline-value.config.json | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 packages/scope-manager/tests/fixtures/export/type-inline.config.json create mode 100644 packages/scope-manager/tests/fixtures/import/type-inline-value.config.json diff --git a/packages/scope-manager/tests/fixtures/export/type-inline.config.json b/packages/scope-manager/tests/fixtures/export/type-inline.config.json new file mode 100644 index 000000000000..4e3daea2fc6d --- /dev/null +++ b/packages/scope-manager/tests/fixtures/export/type-inline.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.5" +} diff --git a/packages/scope-manager/tests/fixtures/import/type-inline-value.config.json b/packages/scope-manager/tests/fixtures/import/type-inline-value.config.json new file mode 100644 index 000000000000..4e3daea2fc6d --- /dev/null +++ b/packages/scope-manager/tests/fixtures/import/type-inline-value.config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.5" +} From 72527e5b3040a24b8e432f79e319f54f46e8cda2 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 20 Feb 2023 16:27:57 -0500 Subject: [PATCH 15/15] Added a bunch of fixture configs --- .../fixtures/assertion/config.json | 3 +++ .../fixtures/_error_/assertion/config.json | 3 +++ .../fixtures/assertion/config.json | 3 +++ .../fixtures/_error_/missing-id/config.json | 3 +++ .../_error_/non-identifier-name/config.json | 3 +++ .../_error_/module-invalid-id/config.json | 3 +++ .../_error_/namespace-invalid-id/config.json | 3 +++ .../_error_/non-identifier-name/config.json | 3 +++ .../config.json | 3 +++ .../fixtures/key-computed-complex/config.json | 3 +++ .../fixtures/key-computed-number/config.json | 3 +++ .../fixtures/key-computed-string/config.json | 3 +++ .../fixtures/key-private/config.json | 3 +++ .../fixtures/key-string/config.json | 3 +++ .../modifier-abstract-with-value/config.json | 3 +++ .../fixtures/modifier-abstract/config.json | 3 +++ .../fixtures/modifier-declare/config.json | 3 +++ .../fixtures/modifier-override/config.json | 3 +++ .../fixtures/modifier-private/config.json | 3 +++ .../fixtures/modifier-protected/config.json | 3 +++ .../fixtures/modifier-public/config.json | 3 +++ .../fixtures/modifier-readonly/config.json | 3 +++ .../fixtures/modifier-static/config.json | 3 +++ .../no-annotation-no-value/config.json | 3 +++ .../no-annotation-with-value/config.json | 3 +++ .../with-annotation-no-value/config.json | 3 +++ .../with-annotation-with-value/config.json | 3 +++ .../fixtures/array-array/config.json | 3 +++ .../arrow-func-no-parentheses/config.json | 3 +++ .../arrow-func-with-parentheses/config.json | 3 +++ .../fixtures/chained-satisfies/config.json | 3 +++ .../conditional-no-parentheses/config.json | 3 +++ .../conditional-with-parentheses/config.json | 3 +++ .../fixtures/identifier-keyword/config.json | 3 +++ .../identifier-object-type/config.json | 3 +++ .../identifier-tuple-type/config.json | 3 +++ .../logical-no-parentheses/config.json | 3 +++ .../logical-with-parentheses/config.json | 3 +++ .../config.json | 3 +++ .../config.json | 3 +++ .../config.json | 3 +++ .../export-with-import-assertions/config.json | 3 +++ .../config.json | 3 +++ .../fixtures/class-static-blocks/config.json | 3 +++ .../config.json | 3 +++ .../config.json | 3 +++ .../class-with-override-method/config.json | 3 +++ .../class-with-override-property/config.json | 3 +++ .../config.json | 3 +++ .../import-with-import-assertions/config.json | 3 +++ .../fixtures/private-fields-in-in/config.json | 3 +++ .../type-only-export-specifiers/config.json | 3 +++ .../type-only-import-specifiers/config.json | 3 +++ .../instantiation-expression/config.json | 3 +++ .../config.json | 3 +++ .../interface-with-accessors/config.json | 3 +++ .../config.json | 3 +++ .../optional-variance-in-and-out/config.json | 3 +++ .../optional-variance-in-out/config.json | 3 +++ .../fixtures/optional-variance-in/config.json | 3 +++ .../optional-variance-out/config.json | 3 +++ .../typeof-with-type-parameters/config.json | 3 +++ .../tests/lib/convert.test.ts | 4 +++ .../lib/semantic-diagnostics-enabled.test.ts | 27 ++++++++++++++++--- 64 files changed, 214 insertions(+), 3 deletions(-) create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/config.json create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/config.json create mode 100644 packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/config.json create mode 100644 packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/config.json create mode 100644 packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/config.json create mode 100644 packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/config.json create mode 100644 packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/config.json create mode 100644 packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/config.json create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/config.json create mode 100644 packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/config.json create mode 100644 packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/config.json create mode 100644 packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/config.json create mode 100644 packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/config.json create mode 100644 packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/config.json create mode 100644 packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/config.json create mode 100644 packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/config.json create mode 100644 packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/config.json create mode 100644 packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/config.json create mode 100644 packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/config.json create mode 100644 packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/config.json create mode 100644 packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/config.json create mode 100644 packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/config.json create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/config.json diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/config.json b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/config.json b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/config.json b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/config.json b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/config.json b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/config.json b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/config.json b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/config.json b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/config.json b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/config.json b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/config.json b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/config.json b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/config.json b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/config.json b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/config.json b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/config.json b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/config.json b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/config.json b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/config.json b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/config.json b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/config.json b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/config.json b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/config.json b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/config.json b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/config.json b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/config.json b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/config.json b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/config.json b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/config.json b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/config.json b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/config.json b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/config.json b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/config.json b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/config.json b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/config.json b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/config.json b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/config.json b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/config.json b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/config.json b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/config.json b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/config.json b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/config.json b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/config.json b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/config.json b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/config.json new file mode 100644 index 000000000000..e475530972bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/config.json @@ -0,0 +1,3 @@ +{ + "typescript": ">=4.9" +} diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index fb3ac3f63139..55b44dad2eee 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; +import * as semver from 'semver'; import * as ts from 'typescript'; import type { TSNode } from '../../src'; @@ -76,6 +77,9 @@ describe('convert', () => { }); it('deeplyCopy should convert array of nodes', () => { + if (!semver.satisfies(ts.version, '>=4.7')) { + return; + } const ast = convertCode('new foo()'); const instance = new Converter(ast, { diff --git a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts index b87abc896cbe..5f675ba7fafa 100644 --- a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts +++ b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts @@ -1,6 +1,8 @@ -import { readFileSync } from 'fs'; +import * as fs from 'fs'; import glob from 'glob'; import path from 'path'; +import * as semver from 'semver'; +import * as ts from 'typescript'; import * as parser from '../../src'; import { formatSnapshotName, isJSXFileType } from '../../tools/test-utils'; @@ -12,15 +14,34 @@ import { serializer } from '../../tools/tserror-serializer'; */ const FIXTURES_DIR = path.join(__dirname, '../../../ast-spec/src'); -const testFiles = glob.sync('**/fixture.ts', { +const FILE_NAME_START = 'fixture.ts'; + +const testFiles = glob.sync(`**/${FILE_NAME_START}`, { cwd: FIXTURES_DIR, }); expect.addSnapshotSerializer(serializer); +interface FixtureVersionConfig { + readonly typescript: string; +} + describe('Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled', () => { testFiles.forEach(filename => { - const code = readFileSync(path.join(FIXTURES_DIR, filename), 'utf8'); + const configPath = path.join( + FIXTURES_DIR, + filename.replace(FILE_NAME_START, 'config.json'), + ); + if (fs.existsSync(configPath)) { + const config = JSON.parse( + fs.readFileSync(configPath).toString(), + ) as FixtureVersionConfig; + if (!semver.satisfies(ts.version, config.typescript)) { + return; + } + } + + const code = fs.readFileSync(path.join(FIXTURES_DIR, filename), 'utf8'); const fileExtension = path.extname(filename); const config: parser.TSESTreeOptions = { loc: true,