Compare commits

...

63 Commits

Author SHA1 Message Date
Andrew Eisenberg
c55c1eedf6 Avoid using pull_request_target
Move to using `pull_request` and a permissions block.
2021-10-21 10:50:01 -07:00
Andrew Eisenberg
bee5aac8d7 Merge pull request #775 from github/dependabot/npm_and_yarn/typescript-eslint/parser-5.0.0
Bump @typescript-eslint/parser from 4.29.2 to 5.0.0
2021-10-21 10:10:03 -07:00
Andrew Eisenberg
04a87f068f Merge branch 'main' into dependabot/npm_and_yarn/typescript-eslint/parser-5.0.0 2021-10-21 09:51:48 -07:00
Edoardo Pirovano
ecffc3ce6b Merge pull request #782 from github/mergeback/v1.0.19-to-main-1990ded3
Mergeback v1.0.19 refs/heads/v1 into main
2021-10-18 23:38:06 +01:00
github-actions[bot]
fc15a137e0 Update checked-in dependencies 2021-10-18 22:20:39 +00:00
github-actions[bot]
fd20d82b8d 1.0.20 2021-10-18 22:14:24 +00:00
github-actions[bot]
c49fe2506c Update changelog and version after v1.0.19 2021-10-18 22:14:22 +00:00
Edoardo Pirovano
1990ded3d2 Merge pull request #780 from github/update-v1.0.19-a56f7259
Merge main into v1
2021-10-18 23:13:28 +01:00
github-actions[bot]
f5e572fb4b 1.0.19 2021-10-18 09:02:08 +00:00
Arthur Baars
a56f7259c1 Merge pull request #773 from github/codeql-2.6.3-a-release-prep
Update default codeql bundle to 2.6.3-a
2021-10-15 12:04:57 +02:00
Arthur Baars
5f37061461 Update default codeql bundle to 2.6.3-a 2021-10-15 11:43:16 +02:00
Arthur Baars
286a237e20 Merge pull request #778 from github/aeisenberg/fix-python-tests
Fix failing python tests
2021-10-15 11:42:50 +02:00
Andrew Eisenberg
43ea2ce0c9 Remove explicit 2.26.0 version in python tests
Also, rename test scripts to indicate the version they are using.
2021-10-14 13:40:15 -07:00
Andrew Eisenberg
3df217266d Fix failing python tests
The requests module 1.2.3 is no longer compatible with python >=3.10.0.
So, instead use 2.26.0, the most recent version that is compatible with
our supported python versions at the time of this commit.
2021-10-14 12:37:58 -07:00
github-actions[bot]
e2f39a6d71 Update checked-in dependencies 2021-10-14 17:05:18 +00:00
dependabot[bot]
6ca99f72e9 Bump @typescript-eslint/parser from 4.29.2 to 5.0.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.29.2 to 5.0.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.0.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-14 17:00:52 +00:00
Edoardo Pirovano
1ebb0a0a35 Merge pull request #768 from github/mergeback/v1.0.18-to-main-fd3190bb
Mergeback v1.0.18 refs/heads/v1 into main
2021-10-08 15:23:34 +01:00
github-actions[bot]
f2159737dd Update checked-in dependencies 2021-10-08 13:50:27 +00:00
github-actions[bot]
5153cc4c8d 1.0.19 2021-10-08 13:43:00 +00:00
github-actions[bot]
faa3cfa2e9 Update changelog and version after v1.0.18 2021-10-08 13:42:58 +00:00
Edoardo Pirovano
fd3190bba5 Merge pull request #767 from github/update-v1.0.18-0bbf22e3
Merge main into v1
2021-10-08 14:41:56 +01:00
github-actions[bot]
4a45fbee96 1.0.18 2021-10-08 12:07:14 +00:00
Alexander Eyers-Taylor
0bbf22e3b7 Merge pull request #766 from edoardopirovano/disable-new-tracing
Temporarily disable new style of tracing
2021-10-08 13:06:04 +01:00
Edoardo Pirovano
d362b66e03 Temporarily disable new style of tracing 2021-10-08 12:45:52 +01:00
Edoardo Pirovano
9e7b37f8e4 Merge pull request #765 from github/mergeback/v1.0.17-to-main-03e7dda1
Mergeback v1.0.17 refs/heads/v1 into main
2021-10-08 10:14:30 +01:00
github-actions[bot]
944ae88ffe Update checked-in dependencies 2021-10-07 18:56:14 +00:00
github-actions[bot]
ace3701b4a 1.0.18 2021-10-07 18:49:13 +00:00
github-actions[bot]
dbb326152c Update changelog and version after v1.0.17 2021-10-07 18:49:11 +00:00
Alexander Eyers-Taylor
03e7dda1b9 Merge pull request #764 from github/update-v1.0.17-3bfe8ab7
Merge main into v1
2021-10-07 19:48:02 +01:00
github-actions[bot]
ee9e32621e 1.0.17 2021-10-07 18:32:06 +00:00
Alexander Eyers-Taylor
3bfe8ab742 Merge pull request #763 from github/alexet/fix-changelog-version
Fix changelog
2021-10-07 19:29:06 +01:00
Alexander Eyers-Taylor
515f16b728 Merge branch 'main' into alexet/fix-changelog-version 2021-10-07 18:37:24 +01:00
alexet
8b12e8c5e1 Fix changelog
The release is added automatically by the action.
2021-10-07 18:35:10 +01:00
Alexander Eyers-Taylor
10f284c032 Merge pull request #761 from github/codeql-2.6.3-release-prep
Update default codeql bundle to 2.6.3
2021-10-06 18:48:49 +01:00
alexet
19d3f6c536 Update default codeql bundle to 2.6.3 2021-10-06 15:55:21 +01:00
Edoardo Pirovano
7d56b0cd44 Merge pull request #759 from github/mergeback/v1.0.16-to-main-1ddd8a56
Mergeback v1.0.16 refs/heads/v1 into main
2021-10-05 10:26:15 +01:00
github-actions[bot]
69ddeed7d5 Update checked-in dependencies 2021-10-05 08:38:02 +00:00
github-actions[bot]
2c73ad667d 1.0.17 2021-10-05 08:29:45 +00:00
github-actions[bot]
b5a522dfb8 Update changelog and version after v1.0.16 2021-10-05 08:29:43 +00:00
Edoardo Pirovano
1ddd8a5632 Merge pull request #758 from github/update-v1.0.16-ef3290ce
Merge main into v1
2021-10-05 09:28:24 +01:00
Edoardo Pirovano
d96049eeaf Update CHANGELOG date 2021-10-05 09:15:30 +01:00
github-actions[bot]
168327a4aa 1.0.16 2021-10-04 09:02:11 +00:00
Edoardo Pirovano
ef3290ce11 Merge pull request #753 from github/edoardo/use-cli-loc
Use CLI's own baseline LOC counting
2021-09-29 23:59:10 +01:00
Edoardo Pirovano
f04acbbdc3 Use CLI's own baseline LOC counting 2021-09-29 11:17:41 +01:00
Edoardo Pirovano
cd1b9df1e3 Merge pull request #751 from edoardopirovano/deprecare-rmdir
Remove calls to `fs.rmdirSync`
2021-09-23 12:04:05 +01:00
Edoardo Pirovano
292203e8b6 Remove calls to fs.rmdirSync 2021-09-23 09:38:52 +01:00
Edoardo Pirovano
f151a3cfe6 Merge pull request #744 from edoardopirovano/use-db-cluster
Make use of multi-language and indirect tracing
2021-09-23 09:08:04 +01:00
Edoardo Pirovano
ee57c2ed58 Merge branch 'main' into use-db-cluster 2021-09-23 08:54:22 +01:00
Edoardo Pirovano
d521b0e630 Merge pull request #750 from github/update-supported-enterprise-server-versions
Update supported GitHub Enterprise Server versions.
2021-09-23 08:44:33 +01:00
GitHub
5aac657d98 Update supported GitHub Enterprise Server versions. 2021-09-23 00:06:59 +00:00
Edoardo Pirovano
ed36ec077c Merge pull request #749 from github/mergeback/v1.0.15-to-main-1b37538d
Mergeback v1.0.15 refs/heads/v1 into main
2021-09-22 18:41:24 +01:00
github-actions[bot]
bb0850a826 Update checked-in dependencies 2021-09-22 16:57:36 +00:00
github-actions[bot]
f16cf435c3 1.0.16 2021-09-22 16:44:21 +00:00
github-actions[bot]
167d7583fe Update changelog and version after v1.0.15 2021-09-22 16:44:19 +00:00
Edoardo Pirovano
1b37538d9c Merge pull request #748 from github/update-v1.0.15-e40e8879
Merge main into v1
2021-09-22 17:24:19 +01:00
github-actions[bot]
334262d6cf 1.0.15 2021-09-22 15:51:19 +00:00
Edoardo Pirovano
1f4460b9fb Make use of multi-language and indirect tracing 2021-09-22 16:12:23 +01:00
Edoardo Pirovano
e40e887968 Merge pull request #747 from github/update-supported-enterprise-server-versions
Update supported GitHub Enterprise Server versions.
2021-09-22 08:55:45 +01:00
GitHub
6e631b99c4 Update supported GitHub Enterprise Server versions. 2021-09-22 00:05:45 +00:00
Edoardo Pirovano
5a80cb1408 Merge pull request #746 from github/edoardo/2.6.2-release
Bump default CodeQL version to 2.6.2 bundle
2021-09-21 17:59:41 +01:00
Edoardo Pirovano
014d3ea60a Don't use shared compilation 2021-09-21 17:28:22 +01:00
Edoardo Pirovano
8caa0808ee Upload tracer logs 2021-09-21 14:46:08 +01:00
Edoardo Pirovano
fd4659dfd4 Bump default CodeQL version to 2.6.2 bundle 2021-09-21 13:41:10 +01:00
824 changed files with 24301 additions and 694 deletions

View File

@@ -58,3 +58,5 @@ jobs:
- uses: ./../action/analyze - uses: ./../action/analyze
env: env:
TEST_MODE: true TEST_MODE: true
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -61,3 +61,4 @@ jobs:
fi fi
env: env:
CODEQL_EXTRACTOR_GO_BUILD_TRACING: 'true' CODEQL_EXTRACTOR_GO_BUILD_TRACING: 'true'
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -59,3 +59,4 @@ jobs:
TEST_MODE: true TEST_MODE: true
env: env:
CODEQL_EXTRACTOR_GO_BUILD_TRACING: 'true' CODEQL_EXTRACTOR_GO_BUILD_TRACING: 'true'
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -57,3 +57,5 @@ jobs:
echo "Did not find a JavaScript database" echo "Did not find a JavaScript database"
exit 1 exit 1
fi fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -84,3 +84,5 @@ jobs:
echo "Did not create a database for Python, or created it in the wrong location." echo "Did not create a database for Python, or created it in the wrong location."
exit 1 exit 1
fi fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -63,3 +63,5 @@ jobs:
echo "Did not match expected rules '$EXPECTED_RULES'." echo "Did not match expected rules '$EXPECTED_RULES'."
exit 1 exit 1
fi fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -62,3 +62,5 @@ jobs:
echo "Did not match expected rules '$EXPECTED_RULES'." echo "Did not match expected rules '$EXPECTED_RULES'."
exit 1 exit 1
fi fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -63,3 +63,5 @@ jobs:
echo "Did not match expected rules '$EXPECTED_RULES'." echo "Did not match expected rules '$EXPECTED_RULES'."
exit 1 exit 1
fi fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -56,3 +56,5 @@ jobs:
- uses: ./../action/analyze - uses: ./../action/analyze
env: env:
TEST_MODE: true TEST_MODE: true
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -63,3 +63,5 @@ jobs:
sarif_file: rubocop.sarif sarif_file: rubocop.sarif
env: env:
TEST_MODE: true TEST_MODE: true
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -76,3 +76,5 @@ jobs:
echo "Did not match expected rules '$EXPECTED_RULES'." echo "Did not match expected rules '$EXPECTED_RULES'."
exit 1 exit 1
fi fi
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -50,3 +50,5 @@ jobs:
- uses: ./../action/analyze - uses: ./../action/analyze
env: env:
TEST_MODE: true TEST_MODE: true
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

1
.github/workflows/__test-proxy.yml generated vendored
View File

@@ -44,6 +44,7 @@ jobs:
TEST_MODE: true TEST_MODE: true
env: env:
https_proxy: http://squid-proxy:3128 https_proxy: http://squid-proxy:3128
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
container: container:
image: ubuntu:18.04 image: ubuntu:18.04
options: --dns 127.0.0.1 options: --dns 127.0.0.1

1
.github/workflows/__test-ruby.yml generated vendored
View File

@@ -53,3 +53,4 @@ jobs:
fi fi
env: env:
CODEQL_ENABLE_EXPERIMENTAL_FEATURES: 'true' CODEQL_ENABLE_EXPERIMENTAL_FEATURES: 'true'
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true

View File

@@ -171,7 +171,7 @@ jobs:
- name: Build code - name: Build code
run: | run: |
. ./codeql-runner/codeql-env.sh . ./codeql-runner/codeql-env.sh
$CODEQL_RUNNER dotnet build $CODEQL_RUNNER dotnet build /p:UseSharedCompilation=false
- name: Run analyze - name: Run analyze
run: | run: |
@@ -207,11 +207,16 @@ jobs:
- name: Build code - name: Build code
shell: powershell shell: powershell
# Note we want to make sure that the .win32env file is read correctly, so we unset the CODEQL_EXTRACTOR_CSHARP_ROOT from the .sh file.
run: | run: |
cat ./codeql-runner/codeql-env.sh | Invoke-Expression cat ./codeql-runner/codeql-env.sh | Invoke-Expression
$Env:CODEQL_EXTRACTOR_CSHARP_ROOT = "" $Env:CODEQL_EXTRACTOR_CSHARP_ROOT = "" # Unset an environment variable to make sure the tracer resists this
& $Env:CODEQL_RUNNER dotnet build & $Env:CODEQL_RUNNER dotnet build /p:UseSharedCompilation=false
- name: Upload tracer logs
uses: actions/upload-artifact@v2
with:
name: tracer-logs
path: ./codeql-runner/compound-build-tracer.log
- name: Run analyze - name: Run analyze
run: | run: |
@@ -249,7 +254,7 @@ jobs:
shell: bash shell: bash
run: | run: |
. ./codeql-runner/codeql-env.sh . ./codeql-runner/codeql-env.sh
$CODEQL_RUNNER dotnet build $CODEQL_RUNNER dotnet build /p:UseSharedCompilation=false
- name: Run analyze - name: Run analyze
run: | run: |

View File

@@ -58,7 +58,7 @@ jobs:
- name: Verify packages installed - name: Verify packages installed
run: | run: |
$GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh ${PYTHON_VERSION} $GITHUB_WORKSPACE/python-setup/tests/check_requests_2_26_0.sh ${PYTHON_VERSION}
# This one shouldn't fail, but also won't install packages # This one shouldn't fail, but also won't install packages
test-setup-python-scripts-non-standard-location: test-setup-python-scripts-non-standard-location:
@@ -123,6 +123,10 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Initialize CodeQL - name: Initialize CodeQL
uses: ./init uses: ./init
with: with:
@@ -149,5 +153,5 @@ jobs:
- name: Verify packages installed - name: Verify packages installed
run: | run: |
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\tests\\check_requests_123.ps1" $cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\tests\\check_requests_2_26_0.ps1"
powershell -File $cmd $Env:PYTHON_VERSION powershell -File $cmd $Env:PYTHON_VERSION

View File

@@ -1,8 +1,12 @@
name: Update dependencies name: Update dependencies
on: on:
pull_request_target: pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled] types: [opened, synchronize, reopened, ready_for_review, labeled]
permissions:
issues: write
contents: write
jobs: jobs:
update: update:
name: Update dependencies name: Update dependencies

View File

@@ -4,6 +4,26 @@
No user facing changes. No user facing changes.
## 1.0.19 - 18 Oct 2021
No user facing changes.
## 1.0.18 - 08 Oct 2021
- Fixed a bug where some builds were no longer being traced correctly. [#766](https://github.com/github/codeql-action/pull/766)
## 1.0.17 - 07 Oct 2021
- Update default CodeQL bundle version to 2.6.3. [#761](https://github.com/github/codeql-action/pull/761)
## 1.0.16 - 05 Oct 2021
No user facing changes.
## 1.0.15 - 22 Sep 2021
- Update default CodeQL bundle version to 2.6.2. [#746](https://github.com/github/codeql-action/pull/746)
## 1.0.14 - 09 Sep 2021 ## 1.0.14 - 09 Sep 2021
- Update default CodeQL bundle version to 2.6.1. [#733](https://github.com/github/codeql-action/pull/733) - Update default CodeQL bundle version to 2.6.1. [#733](https://github.com/github/codeql-action/pull/733)

2
lib/analyze-action.js generated
View File

@@ -24,6 +24,7 @@ const path = __importStar(require("path"));
const core = __importStar(require("@actions/core")); const core = __importStar(require("@actions/core"));
const actionsUtil = __importStar(require("./actions-util")); const actionsUtil = __importStar(require("./actions-util"));
const analyze_1 = require("./analyze"); const analyze_1 = require("./analyze");
const codeql_1 = require("./codeql");
const config_utils_1 = require("./config-utils"); const config_utils_1 = require("./config-utils");
const database_upload_1 = require("./database-upload"); const database_upload_1 = require("./database-upload");
const logging_1 = require("./logging"); const logging_1 = require("./logging");
@@ -58,6 +59,7 @@ async function run() {
if (config === undefined) { if (config === undefined) {
throw new Error("Config file could not be found at expected location. Has the 'init' action been called?"); throw new Error("Config file could not be found at expected location. Has the 'init' action been called?");
} }
await util.enrichEnvironment(util.Mode.actions, await (0, codeql_1.getCodeQL)(config.codeQLCmd));
const apiDetails = { const apiDetails = {
auth: actionsUtil.getRequiredInput("token"), auth: actionsUtil.getRequiredInput("token"),
url: util.getRequiredEnvParam("GITHUB_SERVER_URL"), url: util.getRequiredEnvParam("GITHUB_SERVER_URL"),

View File

@@ -1 +1 @@
{"version":3,"file":"analyze-action.js","sourceRoot":"","sources":["../src/analyze-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,oDAAsC;AAEtC,4DAA8C;AAC9C,uCAMmB;AACnB,iDAAmD;AACnD,uDAAoD;AACpD,uCAA6C;AAC7C,6CAAkD;AAClD,yDAA2C;AAE3C,6CAA+B;AAE/B,8CAA8C;AAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAUvC,KAAK,UAAU,gBAAgB,CAC7B,SAAe,EACf,KAAuC,EACvC,KAAa;IAEb,MAAM,MAAM,GACV,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,wBAAwB,MAAK,SAAS,IAAI,KAAK,KAAK,SAAS;QAClE,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,SAAS,CAAC;IAChB,MAAM,gBAAgB,GAAG,MAAM,WAAW,CAAC,sBAAsB,CAC/D,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,EACd,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,CACb,CAAC;IACF,MAAM,YAAY,GAAuB;QACvC,GAAG,gBAAgB;QACnB,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;KACjB,CAAC;IACF,MAAM,WAAW,CAAC,gBAAgB,CA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AAQ,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC;KACpE;SAAM,IAAI,QAAQ,EAAE;QACnB,MAAM,gBAAgB,CAAC,SAAS,EAAE,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;KACpD;SAAM;QACL,MAAM,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;KAC9C;AACH,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,0BAA0B,KAAK,EAAE,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}

35
lib/analyze.js generated
View File

@@ -108,12 +108,19 @@ async function finalizeDatabaseCreation(config, threadsFlag, memoryFlag, logger)
// Runs queries and creates sarif files in the given folder // Runs queries and creates sarif files in the given folder
async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag, automationDetailsId, config, logger) { async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag, automationDetailsId, config, logger) {
const statusReport = {}; const statusReport = {};
// count the number of lines in the background let locPromise = Promise.resolve({});
const locPromise = (0, count_loc_1.countLoc)(path.resolve(), const cliCanCountBaseline = await cliCanCountLoC();
// config.paths specifies external directories. the current const debugMode = process.env["INTERNAL_CODEQL_ACTION_DEBUG_LOC"] ||
// directory is included in the analysis by default. Replicate process.env["ACTIONS_RUNNER_DEBUG"] ||
// that here. process.env["ACTIONS_STEP_DEBUG"];
config.paths, config.pathsIgnore, config.languages, logger); if (!cliCanCountBaseline || debugMode) {
// count the number of lines in the background
locPromise = (0, count_loc_1.countLoc)(path.resolve(),
// config.paths specifies external directories. the current
// directory is included in the analysis by default. Replicate
// that here.
config.paths, config.pathsIgnore, config.languages, logger);
}
for (const language of config.languages) { for (const language of config.languages) {
const queries = config.queries[language]; const queries = config.queries[language];
const packsWithVersion = config.packs[language] || []; const packsWithVersion = config.packs[language] || [];
@@ -166,12 +173,16 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
const startTimeInterpretResults = new Date().getTime(); const startTimeInterpretResults = new Date().getTime();
const sarifFile = path.join(sarifFolder, `${language}.sarif`); const sarifFile = path.join(sarifFolder, `${language}.sarif`);
const analysisSummary = await runInterpretResults(language, querySuitePaths, sarifFile); const analysisSummary = await runInterpretResults(language, querySuitePaths, sarifFile);
await injectLinesOfCode(sarifFile, language, locPromise); if (!cliCanCountBaseline)
await injectLinesOfCode(sarifFile, language, locPromise);
statusReport[`interpret_results_${language}_duration_ms`] = statusReport[`interpret_results_${language}_duration_ms`] =
new Date().getTime() - startTimeInterpretResults; new Date().getTime() - startTimeInterpretResults;
logger.endGroup(); logger.endGroup();
logger.info(analysisSummary); logger.info(analysisSummary);
printLinesOfCodeSummary(logger, language, await locPromise); if (!cliCanCountBaseline || debugMode)
printLinesOfCodeSummary(logger, language, await locPromise);
if (cliCanCountBaseline)
logger.info(await runPrintLinesOfCode(language));
} }
catch (e) { catch (e) {
logger.info(String(e)); logger.info(String(e));
@@ -188,6 +199,14 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
const codeql = await (0, codeql_1.getCodeQL)(config.codeQLCmd); const codeql = await (0, codeql_1.getCodeQL)(config.codeQLCmd);
return await codeql.databaseInterpretResults(databasePath, queries, sarifFile, addSnippetsFlag, threadsFlag, automationDetailsId); return await codeql.databaseInterpretResults(databasePath, queries, sarifFile, addSnippetsFlag, threadsFlag, automationDetailsId);
} }
async function cliCanCountLoC() {
return await util.codeQlVersionAbove(await (0, codeql_1.getCodeQL)(config.codeQLCmd), codeql_1.CODEQL_VERSION_COUNTS_LINES);
}
async function runPrintLinesOfCode(language) {
const databasePath = util.getCodeQLDatabasePath(config, language);
const codeql = await (0, codeql_1.getCodeQL)(config.codeQLCmd);
return await codeql.databasePrintBaseline(databasePath);
}
async function runQueryGroup(language, type, querySuiteContents, searchPath) { async function runQueryGroup(language, type, querySuiteContents, searchPath) {
const databasePath = util.getCodeQLDatabasePath(config, language); const databasePath = util.getCodeQLDatabasePath(config, language);
// Pass the queries to codeql using a file instead of using the command // Pass the queries to codeql using a file instead of using the command

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{ "maximumVersion": "3.2", "minimumVersion": "2.22" } { "maximumVersion": "3.3", "minimumVersion": "3.0" }

52
lib/codeql.js generated
View File

@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.getExtraOptions = exports.getCachedCodeQL = exports.setCodeQL = exports.getCodeQL = exports.convertToSemVer = exports.getCodeQLURLVersion = exports.setupCodeQL = exports.getCodeQLActionRepository = exports.CommandInvocationError = void 0; exports.getExtraOptions = exports.getCachedCodeQL = exports.setCodeQL = exports.getCodeQL = exports.convertToSemVer = exports.getCodeQLURLVersion = exports.setupCodeQL = exports.getCodeQLActionRepository = exports.CODEQL_VERSION_NEW_TRACING = exports.CODEQL_VERSION_COUNTS_LINES = exports.CommandInvocationError = void 0;
const fs = __importStar(require("fs")); const fs = __importStar(require("fs"));
const path = __importStar(require("path")); const path = __importStar(require("path"));
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner")); const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
@@ -33,6 +33,7 @@ const actions_util_1 = require("./actions-util");
const api = __importStar(require("./api-client")); const api = __importStar(require("./api-client"));
const defaults = __importStar(require("./defaults.json")); // Referenced from codeql-action-sync-tool! const defaults = __importStar(require("./defaults.json")); // Referenced from codeql-action-sync-tool!
const error_matcher_1 = require("./error-matcher"); const error_matcher_1 = require("./error-matcher");
const languages_1 = require("./languages");
const toolcache = __importStar(require("./toolcache")); const toolcache = __importStar(require("./toolcache"));
const toolrunner_error_catcher_1 = require("./toolrunner-error-catcher"); const toolrunner_error_catcher_1 = require("./toolrunner-error-catcher");
const util = __importStar(require("./util")); const util = __importStar(require("./util"));
@@ -70,6 +71,23 @@ const CODEQL_VERSION_DIAGNOSTICS = "2.5.6";
const CODEQL_VERSION_METRICS = "2.5.5"; const CODEQL_VERSION_METRICS = "2.5.5";
const CODEQL_VERSION_GROUP_RULES = "2.5.5"; const CODEQL_VERSION_GROUP_RULES = "2.5.5";
const CODEQL_VERSION_SARIF_GROUP = "2.5.3"; const CODEQL_VERSION_SARIF_GROUP = "2.5.3";
exports.CODEQL_VERSION_COUNTS_LINES = "2.6.2";
/**
* Version above which we use the CLI's indirect build tracing and
* multi-language tracing features.
*
* There are currently three blockers on the CLI's side to enabling this:
* (1) The logs directory should be created for a DB cluster, as some
* autobuilders expect it to be present.
* (2) The SEMMLE_PRELOAD_libtrace{32,64}? env variables need to be set.
* (3) The .environment and .win32env files need to be created next to
* the DB spec.
*
* Once _all_ of these are fixed, we can enable this by setting the
* version flag below to the earliest version of the CLI that resolved
* the above issues.
*/
exports.CODEQL_VERSION_NEW_TRACING = "99.99.99";
function getCodeQLBundleName() { function getCodeQLBundleName() {
let platform; let platform;
if (process.platform === "win32") { if (process.platform === "win32") {
@@ -310,6 +328,7 @@ function setCodeQL(partialCodeql) {
printVersion: resolveFunction(partialCodeql, "printVersion"), printVersion: resolveFunction(partialCodeql, "printVersion"),
getTracerEnv: resolveFunction(partialCodeql, "getTracerEnv"), getTracerEnv: resolveFunction(partialCodeql, "getTracerEnv"),
databaseInit: resolveFunction(partialCodeql, "databaseInit"), databaseInit: resolveFunction(partialCodeql, "databaseInit"),
databaseInitCluster: resolveFunction(partialCodeql, "databaseInitCluster"),
runAutobuild: resolveFunction(partialCodeql, "runAutobuild"), runAutobuild: resolveFunction(partialCodeql, "runAutobuild"),
extractScannedLanguage: resolveFunction(partialCodeql, "extractScannedLanguage"), extractScannedLanguage: resolveFunction(partialCodeql, "extractScannedLanguage"),
finalizeDatabase: resolveFunction(partialCodeql, "finalizeDatabase"), finalizeDatabase: resolveFunction(partialCodeql, "finalizeDatabase"),
@@ -320,6 +339,7 @@ function setCodeQL(partialCodeql) {
databaseBundle: resolveFunction(partialCodeql, "databaseBundle"), databaseBundle: resolveFunction(partialCodeql, "databaseBundle"),
databaseRunQueries: resolveFunction(partialCodeql, "databaseRunQueries"), databaseRunQueries: resolveFunction(partialCodeql, "databaseRunQueries"),
databaseInterpretResults: resolveFunction(partialCodeql, "databaseInterpretResults"), databaseInterpretResults: resolveFunction(partialCodeql, "databaseInterpretResults"),
databasePrintBaseline: resolveFunction(partialCodeql, "databasePrintBaseline"),
}; };
return cachedCodeQL; return cachedCodeQL;
} }
@@ -402,6 +422,27 @@ async function getCodeQLForCmd(cmd, checkVersion) {
...getExtraOptionsFromEnv(["database", "init"]), ...getExtraOptionsFromEnv(["database", "init"]),
]); ]);
}, },
async databaseInitCluster(databasePath, languages, sourceRoot, processName, processLevel) {
const extraArgs = languages.map((language) => `--language=${language}`);
if (languages.filter(languages_1.isTracedLanguage).length > 0) {
extraArgs.push("--begin-tracing");
if (processName !== undefined) {
extraArgs.push(`--trace-process-name=${processName}`);
}
else {
extraArgs.push(`--trace-process-level=${processLevel || 3}`);
}
}
await runTool(cmd, [
"database",
"init",
"--db-cluster",
databasePath,
`--source-root=${sourceRoot}`,
...extraArgs,
...getExtraOptionsFromEnv(["database", "init"]),
]);
},
async runAutobuild(language) { async runAutobuild(language) {
const cmdName = process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh"; const cmdName = process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh";
const autobuildCmd = path.join(path.dirname(cmd), language, "tools", cmdName); const autobuildCmd = path.join(path.dirname(cmd), language, "tools", cmdName);
@@ -535,6 +576,15 @@ async function getCodeQLForCmd(cmd, checkVersion) {
// capture stdout, which contains analysis summaries // capture stdout, which contains analysis summaries
return await runTool(cmd, codeqlArgs); return await runTool(cmd, codeqlArgs);
}, },
async databasePrintBaseline(databasePath) {
const codeqlArgs = [
"database",
"print-baseline",
...getExtraOptionsFromEnv(["database", "print-baseline"]),
databasePath,
];
return await runTool(cmd, codeqlArgs);
},
/** /**
* Download specified packs into the package cache. If the specified * Download specified packs into the package cache. If the specified
* package and version already exists (e.g., from a previous analysis run), * package and version already exists (e.g., from a previous analysis run),

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,3 @@
{ {
"bundleVersion": "codeql-bundle-20210909" "bundleVersion": "codeql-bundle-20211013"
} }

7
lib/init-action.js generated
View File

@@ -22,6 +22,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(require("path")); const path = __importStar(require("path"));
const core = __importStar(require("@actions/core")); const core = __importStar(require("@actions/core"));
const actions_util_1 = require("./actions-util"); const actions_util_1 = require("./actions-util");
const codeql_1 = require("./codeql");
const init_1 = require("./init"); const init_1 = require("./init");
const languages_1 = require("./languages"); const languages_1 = require("./languages");
const logging_1 = require("./logging"); const logging_1 = require("./logging");
@@ -85,6 +86,7 @@ async function run() {
const initCodeQLResult = await (0, init_1.initCodeQL)((0, actions_util_1.getOptionalInput)("tools"), apiDetails, (0, actions_util_1.getTemporaryDirectory)(), (0, actions_util_1.getToolCacheDirectory)(), gitHubVersion.type, logger); const initCodeQLResult = await (0, init_1.initCodeQL)((0, actions_util_1.getOptionalInput)("tools"), apiDetails, (0, actions_util_1.getTemporaryDirectory)(), (0, actions_util_1.getToolCacheDirectory)(), gitHubVersion.type, logger);
codeql = initCodeQLResult.codeql; codeql = initCodeQLResult.codeql;
toolsVersion = initCodeQLResult.toolsVersion; toolsVersion = initCodeQLResult.toolsVersion;
await (0, util_1.enrichEnvironment)(util_1.Mode.actions, codeql);
config = await (0, init_1.initConfig)((0, actions_util_1.getOptionalInput)("languages"), (0, actions_util_1.getOptionalInput)("queries"), (0, actions_util_1.getOptionalInput)("packs"), (0, actions_util_1.getOptionalInput)("config-file"), (0, actions_util_1.getOptionalInput)("db-location"), (0, repository_1.parseRepositoryNwo)((0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY")), (0, actions_util_1.getTemporaryDirectory)(), (0, util_1.getRequiredEnvParam)("RUNNER_TOOL_CACHE"), codeql, (0, util_1.getRequiredEnvParam)("GITHUB_WORKSPACE"), gitHubVersion, apiDetails, logger); config = await (0, init_1.initConfig)((0, actions_util_1.getOptionalInput)("languages"), (0, actions_util_1.getOptionalInput)("queries"), (0, actions_util_1.getOptionalInput)("packs"), (0, actions_util_1.getOptionalInput)("config-file"), (0, actions_util_1.getOptionalInput)("db-location"), (0, repository_1.parseRepositoryNwo)((0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY")), (0, actions_util_1.getTemporaryDirectory)(), (0, util_1.getRequiredEnvParam)("RUNNER_TOOL_CACHE"), codeql, (0, util_1.getRequiredEnvParam)("GITHUB_WORKSPACE"), gitHubVersion, apiDetails, logger);
if (config.languages.includes(languages_1.Language.python) && if (config.languages.includes(languages_1.Language.python) &&
(0, actions_util_1.getRequiredInput)("setup-python-dependencies") === "true") { (0, actions_util_1.getRequiredInput)("setup-python-dependencies") === "true") {
@@ -115,12 +117,13 @@ async function run() {
const codeqlRam = process.env["CODEQL_RAM"] || "6500"; const codeqlRam = process.env["CODEQL_RAM"] || "6500";
core.exportVariable("CODEQL_RAM", codeqlRam); core.exportVariable("CODEQL_RAM", codeqlRam);
const sourceRoot = path.resolve((0, util_1.getRequiredEnvParam)("GITHUB_WORKSPACE"), (0, actions_util_1.getOptionalInput)("source-root") || ""); const sourceRoot = path.resolve((0, util_1.getRequiredEnvParam)("GITHUB_WORKSPACE"), (0, actions_util_1.getOptionalInput)("source-root") || "");
const tracerConfig = await (0, init_1.runInit)(codeql, config, sourceRoot); const tracerConfig = await (0, init_1.runInit)(codeql, config, sourceRoot, "Runner.Worker.exe", undefined);
if (tracerConfig !== undefined) { if (tracerConfig !== undefined) {
for (const [key, value] of Object.entries(tracerConfig.env)) { for (const [key, value] of Object.entries(tracerConfig.env)) {
core.exportVariable(key, value); core.exportVariable(key, value);
} }
if (process.platform === "win32") { if (process.platform === "win32" &&
!(await (0, util_1.codeQlVersionAbove)(codeql, codeql_1.CODEQL_VERSION_NEW_TRACING))) {
await (0, init_1.injectWindowsTracer)("Runner.Worker.exe", undefined, config, codeql, tracerConfig); await (0, init_1.injectWindowsTracer)("Runner.Worker.exe", undefined, config, codeql, tracerConfig);
} }
} }

File diff suppressed because one or more lines are too long

16
lib/init.js generated
View File

@@ -29,6 +29,7 @@ const codeql_1 = require("./codeql");
const configUtils = __importStar(require("./config-utils")); const configUtils = __importStar(require("./config-utils"));
const tracer_config_1 = require("./tracer-config"); const tracer_config_1 = require("./tracer-config");
const util = __importStar(require("./util")); const util = __importStar(require("./util"));
const util_1 = require("./util");
async function initCodeQL(codeqlURL, apiDetails, tempDir, toolCacheDir, variant, logger) { async function initCodeQL(codeqlURL, apiDetails, tempDir, toolCacheDir, variant, logger) {
logger.startGroup("Setup CodeQL tools"); logger.startGroup("Setup CodeQL tools");
const { codeql, toolsVersion } = await (0, codeql_1.setupCodeQL)(codeqlURL, apiDetails, tempDir, toolCacheDir, variant, logger, true); const { codeql, toolsVersion } = await (0, codeql_1.setupCodeQL)(codeqlURL, apiDetails, tempDir, toolCacheDir, variant, logger, true);
@@ -45,12 +46,17 @@ async function initConfig(languagesInput, queriesInput, packsInput, configFile,
return config; return config;
} }
exports.initConfig = initConfig; exports.initConfig = initConfig;
async function runInit(codeql, config, sourceRoot) { async function runInit(codeql, config, sourceRoot, processName, processLevel) {
fs.mkdirSync(config.dbLocation, { recursive: true }); fs.mkdirSync(config.dbLocation, { recursive: true });
// TODO: replace this code once CodeQL supports multi-language tracing if (await (0, util_1.codeQlVersionAbove)(codeql, codeql_1.CODEQL_VERSION_NEW_TRACING)) {
for (const language of config.languages) { // Init a database cluster
// Init language database await codeql.databaseInitCluster(config.dbLocation, config.languages, sourceRoot, processName, processLevel);
await codeql.databaseInit(util.getCodeQLDatabasePath(config, language), language, sourceRoot); }
else {
for (const language of config.languages) {
// Init language database
await codeql.databaseInit(util.getCodeQLDatabasePath(config, language), language, sourceRoot);
}
} }
return await (0, tracer_config_1.getCombinedTracerConfig)(config, codeql); return await (0, tracer_config_1.getCombinedTracerConfig)(config, codeql);
} }

View File

@@ -1 +1 @@
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,yEAA2D;AAC3D,kEAAoD;AAEpD,gEAAkD;AAElD,qCAA+C;AAC/C,4DAA8C;AAG9C,mDAAwE;AACxE,6CAA+B;AAExB,KAAK,UAAU,UAAU,CAC9B,SAA6B,EAC7B,UAA4B,EAC5B,OAAe,EACf,YAAoB,EACpB,OAA2B,EAC3B,MAAc;IAEd,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAA,oBAAW,EAChD,SAAS,EACT,UAAU,EACV,OAAO,EACP,YAAY,EACZ,OAAO,EACP,MAAM,EACN,IAAI,CACL,CAAC;IACF,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;IAC5B,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AAClC,CAAC;AArBD,gCAqBC;AAEM,KAAK,UAAU,UAAU,CAC9B,cAAkC,EAClC,YAAgC,EAChC,UAA8B,EAC9B,UAA8B,EAC9B,UAA8B,EAC9B,UAAyB,EACzB,OAAe,EACf,YAAoB,EACpB,MAAc,EACd,aAAqB,EACrB,aAAiC,EACjC,UAAoC,EACpC,MAAc;IAEd,MAAM,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,UAAU,CACzC,cAAc,EACd,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,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C,OAAO,EAAE,CAAC;aAC/B,CAAC,CAAC,IAAI,EAAE,CAAC;SACX;KACF;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,QAAQ,EAAE,CAAC;QAClB,MAAM,CAAC,OAAO,CACZ,gFAAgF,CAAC,IAAI;YACnF,qGAAqG;YACrG,oGAAoG;YACpG,iDAAiD,CACpD,CAAC;QACF,OAAO;KACR;IACD,MAAM,CAAC,QAAQ,EAAE,CAAC;AACpB,CAAC;AAtCD,8CAsCC"}

10
lib/runner.js generated
View File

@@ -124,7 +124,7 @@ program
const checkoutPath = cmd.checkoutPath || process.cwd(); const checkoutPath = cmd.checkoutPath || process.cwd();
// Wipe the temp dir // Wipe the temp dir
logger.info(`Cleaning temp directory ${tempDir}`); logger.info(`Cleaning temp directory ${tempDir}`);
fs.rmdirSync(tempDir, { recursive: true }); fs.rmSync(tempDir, { recursive: true, force: true });
fs.mkdirSync(tempDir, { recursive: true }); fs.mkdirSync(tempDir, { recursive: true });
const auth = await (0, util_1.getGitHubAuth)(logger, cmd.githubAuth, cmd.githubAuthStdin); const auth = await (0, util_1.getGitHubAuth)(logger, cmd.githubAuth, cmd.githubAuthStdin);
const apiDetails = { const apiDetails = {
@@ -141,14 +141,16 @@ program
else { else {
codeql = (await (0, init_1.initCodeQL)(undefined, apiDetails, tempDir, toolsDir, gitHubVersion.type, logger)).codeql; codeql = (await (0, init_1.initCodeQL)(undefined, apiDetails, tempDir, toolsDir, gitHubVersion.type, logger)).codeql;
} }
await (0, util_1.enrichEnvironment)(util_1.Mode.runner, codeql);
const workspacePath = checkoutPath; const workspacePath = checkoutPath;
const config = await (0, init_1.initConfig)(cmd.languages, cmd.queries, cmd.packs, cmd.configFile, undefined, (0, repository_1.parseRepositoryNwo)(cmd.repository), tempDir, toolsDir, codeql, workspacePath, gitHubVersion, apiDetails, logger); const config = await (0, init_1.initConfig)(cmd.languages, cmd.queries, cmd.packs, cmd.configFile, undefined, (0, repository_1.parseRepositoryNwo)(cmd.repository), tempDir, toolsDir, codeql, workspacePath, gitHubVersion, apiDetails, logger);
const sourceRoot = checkoutPath; const sourceRoot = checkoutPath;
const tracerConfig = await (0, init_1.runInit)(codeql, config, sourceRoot); const tracerConfig = await (0, init_1.runInit)(codeql, config, sourceRoot, parseTraceProcessName(), parseTraceProcessLevel());
if (tracerConfig === undefined) { if (tracerConfig === undefined) {
return; return;
} }
if (process.platform === "win32") { if (process.platform === "win32" &&
!(await (0, util_1.codeQlVersionAbove)(codeql, codeql_1.CODEQL_VERSION_NEW_TRACING))) {
await (0, init_1.injectWindowsTracer)(parseTraceProcessName(), parseTraceProcessLevel(), config, codeql, tracerConfig); await (0, init_1.injectWindowsTracer)(parseTraceProcessName(), parseTraceProcessLevel(), config, codeql, tracerConfig);
} }
// Always output a json file of the env that can be consumed programmatically // Always output a json file of the env that can be consumed programmatically
@@ -203,6 +205,7 @@ program
throw new Error("Config file could not be found at expected location. " + throw new Error("Config file could not be found at expected location. " +
"Was the 'init' command run with the same '--temp-dir' argument as this command."); "Was the 'init' command run with the same '--temp-dir' argument as this command.");
} }
await (0, util_1.enrichEnvironment)(util_1.Mode.runner, await (0, codeql_1.getCodeQL)(config.codeQLCmd));
importTracerEnvironment(config); importTracerEnvironment(config);
let language = undefined; let language = undefined;
if (cmd.language !== undefined) { if (cmd.language !== undefined) {
@@ -252,6 +255,7 @@ program
throw new Error("Config file could not be found at expected location. " + throw new Error("Config file could not be found at expected location. " +
"Was the 'init' command run with the same '--temp-dir' argument as this command."); "Was the 'init' command run with the same '--temp-dir' argument as this command.");
} }
await (0, util_1.enrichEnvironment)(util_1.Mode.runner, await (0, codeql_1.getCodeQL)(config.codeQLCmd));
const auth = await (0, util_1.getGitHubAuth)(logger, cmd.githubAuth, cmd.githubAuthStdin); const auth = await (0, util_1.getGitHubAuth)(logger, cmd.githubAuth, cmd.githubAuthStdin);
const apiDetails = { const apiDetails = {
auth, auth,

File diff suppressed because one or more lines are too long

4
lib/toolcache.js generated
View File

@@ -236,8 +236,8 @@ function createToolPath(tool, version, arch, toolCacheDir, logger) {
const folderPath = path.join(toolCacheDir, tool, semver.clean(version) || version, arch || ""); const folderPath = path.join(toolCacheDir, tool, semver.clean(version) || version, arch || "");
logger.debug(`destination ${folderPath}`); logger.debug(`destination ${folderPath}`);
const markerPath = `${folderPath}.complete`; const markerPath = `${folderPath}.complete`;
fs.rmdirSync(folderPath, { recursive: true }); fs.rmSync(folderPath, { recursive: true, force: true });
fs.rmdirSync(markerPath, { recursive: true }); fs.rmSync(markerPath, { recursive: true, force: true });
fs.mkdirSync(folderPath, { recursive: true }); fs.mkdirSync(folderPath, { recursive: true });
return folderPath; return folderPath;
} }

File diff suppressed because one or more lines are too long

28
lib/tracer-config.js generated
View File

@@ -19,11 +19,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.getCombinedTracerConfig = exports.concatTracerConfigs = exports.getTracerConfigForLanguage = void 0; exports.getCombinedTracerConfig = exports.concatTracerConfigs = exports.getTracerConfigForLanguage = exports.getTracerConfigForCluster = void 0;
const fs = __importStar(require("fs")); const fs = __importStar(require("fs"));
const path = __importStar(require("path")); const path = __importStar(require("path"));
const codeql_1 = require("./codeql");
const languages_1 = require("./languages"); const languages_1 = require("./languages");
const util = __importStar(require("./util")); const util = __importStar(require("./util"));
const util_1 = require("./util");
const CRITICAL_TRACER_VARS = new Set([ const CRITICAL_TRACER_VARS = new Set([
"SEMMLE_PRELOAD_libtrace", "SEMMLE_PRELOAD_libtrace",
"SEMMLE_RUNNER", "SEMMLE_RUNNER",
@@ -31,6 +33,14 @@ const CRITICAL_TRACER_VARS = new Set([
"SEMMLE_DEPTRACE_SOCKET", "SEMMLE_DEPTRACE_SOCKET",
"SEMMLE_JAVA_TOOL_OPTIONS", "SEMMLE_JAVA_TOOL_OPTIONS",
]); ]);
async function getTracerConfigForCluster(config) {
const tracingEnvVariables = JSON.parse(fs.readFileSync(path.resolve(config.dbLocation, "temp/tracingEnvironment/start-tracing.json"), "utf8"));
return {
spec: tracingEnvVariables["ODASA_TRACER_CONFIGURATION"],
env: tracingEnvVariables,
};
}
exports.getTracerConfigForCluster = getTracerConfigForCluster;
async function getTracerConfigForLanguage(codeql, config, language) { async function getTracerConfigForLanguage(codeql, config, language) {
const env = await codeql.getTracerEnv(util.getCodeQLDatabasePath(config, language)); const env = await codeql.getTracerEnv(util.getCodeQLDatabasePath(config, language));
const spec = env["ODASA_TRACER_CONFIGURATION"]; const spec = env["ODASA_TRACER_CONFIGURATION"];
@@ -161,12 +171,18 @@ async function getCombinedTracerConfig(config, codeql) {
if (tracedLanguages.length === 0) { if (tracedLanguages.length === 0) {
return undefined; return undefined;
} }
// Get all the tracer configs and combine them together let mainTracerConfig;
const tracedLanguageConfigs = {}; if (await (0, util_1.codeQlVersionAbove)(codeql, codeql_1.CODEQL_VERSION_NEW_TRACING)) {
for (const language of tracedLanguages) { mainTracerConfig = await getTracerConfigForCluster(config);
tracedLanguageConfigs[language] = await getTracerConfigForLanguage(codeql, config, language); }
else {
// Get all the tracer configs and combine them together
const tracedLanguageConfigs = {};
for (const language of tracedLanguages) {
tracedLanguageConfigs[language] = await getTracerConfigForLanguage(codeql, config, language);
}
mainTracerConfig = concatTracerConfigs(tracedLanguageConfigs, config);
} }
const mainTracerConfig = concatTracerConfigs(tracedLanguageConfigs, config);
// Add a couple more variables // Add a couple more variables
mainTracerConfig.env["ODASA_TRACER_CONFIGURATION"] = mainTracerConfig.spec; mainTracerConfig.env["ODASA_TRACER_CONFIGURATION"] = mainTracerConfig.spec;
const codeQLDir = path.dirname(codeql.getPath()); const codeQLDir = path.dirname(codeql.getPath());

File diff suppressed because one or more lines are too long

50
lib/util.js generated
View File

@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.codeQlVersionAbove = exports.isHTTPError = exports.HTTPError = exports.getRequiredEnvParam = exports.isActions = exports.getMode = exports.initializeEnvironment = exports.Mode = exports.assertNever = exports.getGitHubAuth = exports.apiVersionInRange = exports.DisallowedAPIVersionReason = exports.checkGitHubVersionInRange = exports.getGitHubVersion = exports.GitHubVariant = exports.parseGitHubUrl = exports.getCodeQLDatabasePath = exports.getThreadsFlag = exports.getAddSnippetsFlag = exports.getMemoryFlag = exports.withTmpDir = exports.getToolNames = exports.getExtraOptionsEnvParam = exports.GITHUB_DOTCOM_URL = void 0; exports.codeQlVersionAbove = exports.isHTTPError = exports.HTTPError = exports.getRequiredEnvParam = exports.isActions = exports.getMode = exports.enrichEnvironment = exports.initializeEnvironment = exports.Mode = exports.assertNever = exports.getGitHubAuth = exports.apiVersionInRange = exports.DisallowedAPIVersionReason = exports.checkGitHubVersionInRange = exports.getGitHubVersion = exports.GitHubVariant = exports.parseGitHubUrl = exports.getCodeQLDatabasePath = exports.getThreadsFlag = exports.getAddSnippetsFlag = exports.getMemoryFlag = exports.withTmpDir = exports.getToolNames = exports.getExtraOptionsEnvParam = exports.GITHUB_DOTCOM_URL = void 0;
const fs = __importStar(require("fs")); const fs = __importStar(require("fs"));
const os = __importStar(require("os")); const os = __importStar(require("os"));
const path = __importStar(require("path")); const path = __importStar(require("path"));
@@ -27,6 +27,7 @@ const core = __importStar(require("@actions/core"));
const semver = __importStar(require("semver")); const semver = __importStar(require("semver"));
const api_client_1 = require("./api-client"); const api_client_1 = require("./api-client");
const apiCompatibility = __importStar(require("./api-compatibility.json")); const apiCompatibility = __importStar(require("./api-compatibility.json"));
const codeql_1 = require("./codeql");
/** /**
* The URL for github.com. * The URL for github.com.
*/ */
@@ -76,7 +77,7 @@ async function withTmpDir(body) {
const symlinkSubdir = path.join(tmpDir, "symlink"); const symlinkSubdir = path.join(tmpDir, "symlink");
fs.symlinkSync(realSubdir, symlinkSubdir, "dir"); fs.symlinkSync(realSubdir, symlinkSubdir, "dir");
const result = await body(symlinkSubdir); const result = await body(symlinkSubdir);
fs.rmdirSync(tmpDir, { recursive: true }); fs.rmSync(tmpDir, { recursive: true, force: true });
return result; return result;
} }
exports.withTmpDir = withTmpDir; exports.withTmpDir = withTmpDir;
@@ -379,23 +380,40 @@ var EnvVar;
*/ */
EnvVar["FEATURE_SANDWICH"] = "CODEQL_ACTION_FEATURE_SANDWICH"; EnvVar["FEATURE_SANDWICH"] = "CODEQL_ACTION_FEATURE_SANDWICH";
})(EnvVar || (EnvVar = {})); })(EnvVar || (EnvVar = {}));
const exportVar = (mode, name, value) => {
if (mode === Mode.actions) {
core.exportVariable(name, value);
}
else {
process.env[name] = value;
}
};
/**
* Set some initial environment variables that we can set even without
* knowing what version of CodeQL we're running.
*/
function initializeEnvironment(mode, version) { function initializeEnvironment(mode, version) {
const exportVar = (name, value) => { exportVar(mode, EnvVar.RUN_MODE, mode);
if (mode === Mode.actions) { exportVar(mode, EnvVar.VERSION, version);
core.exportVariable(name, value); exportVar(mode, EnvVar.FEATURE_SARIF_COMBINE, "true");
} exportVar(mode, EnvVar.FEATURE_WILL_UPLOAD, "true");
else {
process.env[name] = value;
}
};
exportVar(EnvVar.RUN_MODE, mode);
exportVar(EnvVar.VERSION, version);
exportVar(EnvVar.FEATURE_SARIF_COMBINE, "true");
exportVar(EnvVar.FEATURE_WILL_UPLOAD, "true");
exportVar(EnvVar.FEATURE_MULTI_LANGUAGE, "true");
exportVar(EnvVar.FEATURE_SANDWICH, "true");
} }
exports.initializeEnvironment = initializeEnvironment; exports.initializeEnvironment = initializeEnvironment;
/**
* Enrich the environment variables with further flags that we cannot
* know the value of until we know what version of CodeQL we're running.
*/
async function enrichEnvironment(mode, codeql) {
if (await codeQlVersionAbove(codeql, codeql_1.CODEQL_VERSION_NEW_TRACING)) {
exportVar(mode, EnvVar.FEATURE_MULTI_LANGUAGE, "false");
exportVar(mode, EnvVar.FEATURE_SANDWICH, "false");
}
else {
exportVar(mode, EnvVar.FEATURE_MULTI_LANGUAGE, "true");
exportVar(mode, EnvVar.FEATURE_SANDWICH, "true");
}
}
exports.enrichEnvironment = enrichEnvironment;
function getMode() { function getMode() {
// Make sure we fail fast if the env var is missing. This should // Make sure we fail fast if the env var is missing. This should
// only happen if there is a bug in our code and we neglected // only happen if there is a bug in our code and we neglected

File diff suppressed because one or more lines are too long

172
node_modules/.package-lock.json generated vendored
View File

@@ -1,6 +1,6 @@
{ {
"name": "codeql", "name": "codeql",
"version": "1.0.15", "version": "1.0.20",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
@@ -676,25 +676,25 @@
} }
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "4.29.2", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.0.0.tgz",
"integrity": "sha512-WQ6BPf+lNuwteUuyk1jD/aHKqMQ9jrdCn7Gxt9vvBnzbpj7aWEf+aZsJ1zvTjx5zFxGCt000lsbD9tQPEL8u6g==", "integrity": "sha512-B6D5rmmQ14I1fdzs71eL3DAuvnPHTY/t7rQABrL9BLnx/H51Un8ox1xqYAchs0/V2trcoyxB1lMJLlrwrJCDgw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "4.29.2", "@typescript-eslint/scope-manager": "5.0.0",
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "5.0.0",
"@typescript-eslint/typescript-estree": "4.29.2", "@typescript-eslint/typescript-estree": "5.0.0",
"debug": "^4.3.1" "debug": "^4.3.1"
}, },
"engines": { "engines": {
"node": "^10.12.0 || >=12.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
"typescript": { "typescript": {
@@ -703,16 +703,16 @@
} }
}, },
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": {
"version": "4.29.2", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.0.0.tgz",
"integrity": "sha512-mfHmvlQxmfkU8D55CkZO2sQOueTxLqGvzV+mG6S/6fIunDiD2ouwsAoiYCZYDDK73QCibYjIZmGhpvKwAB5BOA==", "integrity": "sha512-5RFjdA/ain/MDUHYXdF173btOKncIrLuBmA9s6FJhzDrRAyVSA+70BHg0/MW6TE+UiKVyRtX91XpVS0gVNwVDQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "5.0.0",
"@typescript-eslint/visitor-keys": "4.29.2" "@typescript-eslint/visitor-keys": "5.0.0"
}, },
"engines": { "engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@@ -720,12 +720,12 @@
} }
}, },
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": {
"version": "4.29.2", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.0.0.tgz",
"integrity": "sha512-K6ApnEXId+WTGxqnda8z4LhNMa/pZmbTFkDxEBLQAbhLZL50DjeY0VIDCml/0Y3FlcbqXZrABqrcKxq+n0LwzQ==", "integrity": "sha512-dU/pKBUpehdEqYuvkojmlv0FtHuZnLXFBn16zsDmlFF3LXkOpkAQ2vrKc3BidIIve9EMH2zfTlxqw9XM0fFN5w==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@@ -733,13 +733,13 @@
} }
}, },
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
"version": "4.29.2", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.0.0.tgz",
"integrity": "sha512-TJ0/hEnYxapYn9SGn3dCnETO0r+MjaxtlWZ2xU+EvytF0g4CqTpZL48SqSNn2hXsPolnewF30pdzR9a5Lj3DNg==", "integrity": "sha512-V/6w+PPQMhinWKSn+fCiX5jwvd1vRBm7AX7SJQXEGQtwtBvjMPjaU3YTQ1ik2UF1u96X7tsB96HMnulG3eLi9Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "5.0.0",
"@typescript-eslint/visitor-keys": "4.29.2", "@typescript-eslint/visitor-keys": "5.0.0",
"debug": "^4.3.1", "debug": "^4.3.1",
"globby": "^11.0.3", "globby": "^11.0.3",
"is-glob": "^4.0.1", "is-glob": "^4.0.1",
@@ -747,7 +747,7 @@
"tsutils": "^3.21.0" "tsutils": "^3.21.0"
}, },
"engines": { "engines": {
"node": "^10.12.0 || >=12.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
@@ -760,22 +760,31 @@
} }
}, },
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": {
"version": "4.29.2", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.29.2.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.0.0.tgz",
"integrity": "sha512-bDgJLQ86oWHJoZ1ai4TZdgXzJxsea3Ee9u9wsTAvjChdj2WLcVsgWYAPeY7RQMn16tKrlQaBnpKv7KBfs4EQag==", "integrity": "sha512-yRyd2++o/IrJdyHuYMxyFyBhU762MRHQ/bAGQeTnN3pGikfh+nEmM61XTqaDH1XDp53afZ+waXrk0ZvenoZ6xw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "5.0.0",
"eslint-visitor-keys": "^2.0.0" "eslint-visitor-keys": "^3.0.0"
}, },
"engines": { "engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}, },
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
} }
}, },
"node_modules/@typescript-eslint/parser/node_modules/eslint-visitor-keys": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.0.0.tgz",
"integrity": "sha512-mJOZa35trBTb3IyRmo8xmKBZlxf+N7OnUl4+ZhJHs/r+0770Wh/LEACE2pqMGMe27G/4y8P2bYGk4J70IC5k1Q==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
},
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "4.28.5", "version": "4.28.5",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.28.5.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.28.5.tgz",
@@ -2295,6 +2304,107 @@
"eslint": "^7.23.0" "eslint": "^7.23.0"
} }
}, },
"node_modules/eslint-plugin-github/node_modules/@typescript-eslint/parser": {
"version": "4.33.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz",
"integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==",
"dev": true,
"dependencies": {
"@typescript-eslint/scope-manager": "4.33.0",
"@typescript-eslint/types": "4.33.0",
"@typescript-eslint/typescript-estree": "4.33.0",
"debug": "^4.3.1"
},
"engines": {
"node": "^10.12.0 || >=12.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"eslint": "^5.0.0 || ^6.0.0 || ^7.0.0"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
},
"node_modules/eslint-plugin-github/node_modules/@typescript-eslint/scope-manager": {
"version": "4.33.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz",
"integrity": "sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "4.33.0",
"@typescript-eslint/visitor-keys": "4.33.0"
},
"engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/eslint-plugin-github/node_modules/@typescript-eslint/types": {
"version": "4.33.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz",
"integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==",
"dev": true,
"engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/eslint-plugin-github/node_modules/@typescript-eslint/typescript-estree": {
"version": "4.33.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz",
"integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "4.33.0",
"@typescript-eslint/visitor-keys": "4.33.0",
"debug": "^4.3.1",
"globby": "^11.0.3",
"is-glob": "^4.0.1",
"semver": "^7.3.5",
"tsutils": "^3.21.0"
},
"engines": {
"node": "^10.12.0 || >=12.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
},
"node_modules/eslint-plugin-github/node_modules/@typescript-eslint/visitor-keys": {
"version": "4.33.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz",
"integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "4.33.0",
"eslint-visitor-keys": "^2.0.0"
},
"engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/eslint-plugin-i18n-text": { "node_modules/eslint-plugin-i18n-text": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-i18n-text/-/eslint-plugin-i18n-text-1.0.1.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-i18n-text/-/eslint-plugin-i18n-text-1.0.1.tgz",

View File

@@ -3,6 +3,79 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11)
### Features
* support ESLint v8 ([#3737](https://github.com/typescript-eslint/typescript-eslint/issues/3737)) ([4ca62ae](https://github.com/typescript-eslint/typescript-eslint/commit/4ca62aee6681d706e762a8db727541ca204364f2))
# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04)
**Note:** Version bump only for package @typescript-eslint/parser
# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27)
### Features
* Support `'latest'` as `ecmaVersion` ([#3873](https://github.com/typescript-eslint/typescript-eslint/issues/3873)) ([25a42c0](https://github.com/typescript-eslint/typescript-eslint/commit/25a42c0bbe92d1ecbc2e8ff9ef3a3ef413f728b0))
## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20)
**Note:** Version bump only for package @typescript-eslint/parser
## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13)
**Note:** Version bump only for package @typescript-eslint/parser
# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06)
**Note:** Version bump only for package @typescript-eslint/parser
# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30)
### Features
* **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6))
## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23)
**Note:** Version bump only for package @typescript-eslint/parser
## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) ## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16)
**Note:** Version bump only for package @typescript-eslint/parser **Note:** Version bump only for package @typescript-eslint/parser

View File

@@ -53,7 +53,7 @@ interface ParserOptions {
jsx?: boolean; jsx?: boolean;
globalReturn?: boolean; globalReturn?: boolean;
}; };
ecmaVersion?: number; ecmaVersion?: number | 'latest';
jsxPragma?: string | null; jsxPragma?: string | null;
jsxFragmentName?: string | null; jsxFragmentName?: string | null;
@@ -97,12 +97,13 @@ This options allows you to tell the parser if you want to allow global `return`
Default `2018`. Default `2018`.
Accepts any valid ECMAScript version number: Accepts any valid ECMAScript version number or `'latest'`:
- A version: es3, es5, es6, es7, es8, es9, es10, es11, ..., or - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, ..., or
- A year: es2015, es2016, es2017, es2018, es2019, es2020, ... - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, ..., or
- `'latest'`
The value **must** be a number - so do not include the `es` prefix. When it's a version or a year, the value **must** be a number - so do not include the `es` prefix.
Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default

View File

@@ -8,7 +8,7 @@ const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
const scope_manager_1 = require("@typescript-eslint/scope-manager"); const scope_manager_1 = require("@typescript-eslint/scope-manager");
const debug_1 = __importDefault(require("debug")); const debug_1 = __importDefault(require("debug"));
const typescript_1 = require("typescript"); const typescript_1 = require("typescript");
const log = debug_1.default('typescript-eslint:parser:parser'); const log = (0, debug_1.default)('typescript-eslint:parser:parser');
function validateBoolean(value, fallback = false) { function validateBoolean(value, fallback = false) {
if (typeof value !== 'boolean') { if (typeof value !== 'boolean') {
return fallback; return fallback;
@@ -73,7 +73,7 @@ function parseForESLint(code, options) {
jsx: validateBoolean(options.ecmaFeatures.jsx), jsx: validateBoolean(options.ecmaFeatures.jsx),
}); });
const analyzeOptions = { const analyzeOptions = {
ecmaVersion: options.ecmaVersion, ecmaVersion: options.ecmaVersion === 'latest' ? 1e8 : options.ecmaVersion,
globalReturn: options.ecmaFeatures.globalReturn, globalReturn: options.ecmaFeatures.globalReturn,
jsxPragma: options.jsxPragma, jsxPragma: options.jsxPragma,
jsxFragmentName: options.jsxFragmentName, jsxFragmentName: options.jsxFragmentName,
@@ -94,7 +94,7 @@ function parseForESLint(code, options) {
if (!warnOnUnsupportedTypeScriptVersion) { if (!warnOnUnsupportedTypeScriptVersion) {
parserOptions.loggerFn = false; parserOptions.loggerFn = false;
} }
const { ast, services } = typescript_estree_1.parseAndGenerateServices(code, parserOptions); const { ast, services } = (0, typescript_estree_1.parseAndGenerateServices)(code, parserOptions);
ast.sourceType = options.sourceType; ast.sourceType = options.sourceType;
if (services.hasFullTypeInformation) { if (services.hasFullTypeInformation) {
// automatically apply the options configured for the program // automatically apply the options configured for the program
@@ -126,7 +126,7 @@ function parseForESLint(code, options) {
compilerOptions.emitDecoratorMetadata; compilerOptions.emitDecoratorMetadata;
} }
} }
const scopeManager = scope_manager_1.analyze(ast, analyzeOptions); const scopeManager = (0, scope_manager_1.analyze)(ast, analyzeOptions);
return { ast, services, scopeManager, visitorKeys: typescript_estree_1.visitorKeys }; return { ast, services, scopeManager, visitorKeys: typescript_estree_1.visitorKeys };
} }
exports.parseForESLint = parseForESLint; exports.parseForESLint = parseForESLint;

View File

@@ -1 +1 @@
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":";;;;;;AACA,4EAK8C;AAC9C,oEAI0C;AAC1C,kDAA0B;AAC1B,2CAA2D;AAE3D,MAAM,GAAG,GAAG,eAAK,CAAC,iCAAiC,CAAC,CAAC;AAarD,SAA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;gBAClC,eAAe,CAAC,qBAAqB,CAAC;SACzC;KACF;IAED,MAAM,YAAY,GAAG,IAAA,uBAAO,EAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAElD,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAX,+BAAW,EAAE,CAAC;AACtD,CAAC;AAEe,wCAAc"}

View File

@@ -3,6 +3,82 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11)
### Features
* align class property representation with ESTree ([#3806](https://github.com/typescript-eslint/typescript-eslint/issues/3806)) ([22fa5c0](https://github.com/typescript-eslint/typescript-eslint/commit/22fa5c0c4705ed2898f00b7cacc5dd642d859275)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#3077](https://github.com/typescript-eslint/typescript-eslint/issues/3077)
* support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933)
* **eslint-plugin:** removed value from abstract property nodes ([#3765](https://github.com/typescript-eslint/typescript-eslint/issues/3765)) ([5823524](https://github.com/typescript-eslint/typescript-eslint/commit/58235241714596b641a1e8b39c569e561e0039b4)), closes [#3748](https://github.com/typescript-eslint/typescript-eslint/issues/3748)
# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04)
**Note:** Version bump only for package @typescript-eslint/scope-manager
# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27)
### Features
* **eslint-plugin-internal:** [prefer-ast-types-enum] add `DefinitionType` enum ([#3916](https://github.com/typescript-eslint/typescript-eslint/issues/3916)) ([13b7de5](https://github.com/typescript-eslint/typescript-eslint/commit/13b7de508e0f8eac492879ff9ab99acd8d3e977e))
* Support `'latest'` as `ecmaVersion` ([#3873](https://github.com/typescript-eslint/typescript-eslint/issues/3873)) ([25a42c0](https://github.com/typescript-eslint/typescript-eslint/commit/25a42c0bbe92d1ecbc2e8ff9ef3a3ef413f728b0))
## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20)
**Note:** Version bump only for package @typescript-eslint/scope-manager
## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13)
**Note:** Version bump only for package @typescript-eslint/scope-manager
# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06)
**Note:** Version bump only for package @typescript-eslint/scope-manager
# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30)
### Features
* **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6))
## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23)
**Note:** Version bump only for package @typescript-eslint/scope-manager
## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) ## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16)
**Note:** Version bump only for package @typescript-eslint/scope-manager **Note:** Version bump only for package @typescript-eslint/scope-manager

View File

@@ -39,8 +39,9 @@ interface AnalyzeOptions {
/** /**
* Which ECMAScript version is considered. * Which ECMAScript version is considered.
* Defaults to `2018`. * Defaults to `2018`.
* `'latest'` is converted to 1e8 at parser.
*/ */
ecmaVersion?: EcmaVersion; ecmaVersion?: EcmaVersion | 1e8;
/** /**
* Whether the whole script is executed under node.js environment. * Whether the whole script is executed under node.js environment.

View File

@@ -1,5 +1,6 @@
import { TSESTree } from '@typescript-eslint/types'; import { TSESTree } from '@typescript-eslint/types';
import { BlockScope, CatchScope, ClassScope, ConditionalTypeScope, ForScope, FunctionExpressionNameScope, FunctionScope, FunctionTypeScope, GlobalScope, MappedTypeScope, ModuleScope, Scope, SwitchScope, TSEnumScope, TSModuleScope, TypeScope, WithScope } from './scope'; import { BlockScope, CatchScope, ClassScope, ConditionalTypeScope, ForScope, FunctionExpressionNameScope, FunctionScope, FunctionTypeScope, GlobalScope, MappedTypeScope, ModuleScope, Scope, SwitchScope, TSEnumScope, TSModuleScope, TypeScope, WithScope } from './scope';
import { ClassFieldInitializerScope } from './scope/ClassFieldInitializerScope';
import { Variable } from './variable'; import { Variable } from './variable';
interface ScopeManagerOptions { interface ScopeManagerOptions {
globalReturn?: boolean; globalReturn?: boolean;
@@ -50,6 +51,7 @@ declare class ScopeManager {
nestBlockScope(node: BlockScope['block']): BlockScope; nestBlockScope(node: BlockScope['block']): BlockScope;
nestCatchScope(node: CatchScope['block']): CatchScope; nestCatchScope(node: CatchScope['block']): CatchScope;
nestClassScope(node: ClassScope['block']): ClassScope; nestClassScope(node: ClassScope['block']): ClassScope;
nestClassFieldInitializerScope(node: ClassFieldInitializerScope['block']): ClassFieldInitializerScope;
nestConditionalTypeScope(node: ConditionalTypeScope['block']): ConditionalTypeScope; nestConditionalTypeScope(node: ConditionalTypeScope['block']): ConditionalTypeScope;
nestForScope(node: ForScope['block']): ForScope; nestForScope(node: ForScope['block']): ForScope;
nestFunctionExpressionNameScope(node: FunctionExpressionNameScope['block']): FunctionExpressionNameScope; nestFunctionExpressionNameScope(node: FunctionExpressionNameScope['block']): FunctionExpressionNameScope;

View File

@@ -1 +1 @@
{"version":3,"file":"ScopeManager.d.ts","sourceRoot":"","sources":["../src/Sc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KxD,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,WAAW;IAKxD,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,WAAW;IAKxD,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,aAAa;IAK9D,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS;IAKlD,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS;CAI1D;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}

View File

@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.ScopeManager = void 0; exports.ScopeManager = void 0;
const assert_1 = require("./assert"); const assert_1 = require("./assert");
const scope_1 = require("./scope"); const scope_1 = require("./scope");
const ClassFieldInitializerScope_1 = require("./scope/ClassFieldInitializerScope");
class ScopeManager { class ScopeManager {
constructor(options) { constructor(options) {
_ScopeManager_options.set(this, void 0); _ScopeManager_options.set(this, void 0);
@@ -104,73 +105,77 @@ class ScopeManager {
} }
nestScope(scope) { nestScope(scope) {
if (scope instanceof scope_1.GlobalScope) { if (scope instanceof scope_1.GlobalScope) {
assert_1.assert(this.currentScope === null); (0, assert_1.assert)(this.currentScope === null);
this.globalScope = scope; this.globalScope = scope;
} }
this.currentScope = scope; this.currentScope = scope;
return scope; return scope;
} }
nestBlockScope(node) { nestBlockScope(node) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.BlockScope(this, this.currentScope, node)); return this.nestScope(new scope_1.BlockScope(this, this.currentScope, node));
} }
nestCatchScope(node) { nestCatchScope(node) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.CatchScope(this, this.currentScope, node)); return this.nestScope(new scope_1.CatchScope(this, this.currentScope, node));
} }
nestClassScope(node) { nestClassScope(node) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.ClassScope(this, this.currentScope, node)); return this.nestScope(new scope_1.ClassScope(this, this.currentScope, node));
} }
nestClassFieldInitializerScope(node) {
(0, assert_1.assert)(this.currentScope);
return this.nestScope(new ClassFieldInitializerScope_1.ClassFieldInitializerScope(this, this.currentScope, node));
}
nestConditionalTypeScope(node) { nestConditionalTypeScope(node) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.ConditionalTypeScope(this, this.currentScope, node)); return this.nestScope(new scope_1.ConditionalTypeScope(this, this.currentScope, node));
} }
nestForScope(node) { nestForScope(node) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.ForScope(this, this.currentScope, node)); return this.nestScope(new scope_1.ForScope(this, this.currentScope, node));
} }
nestFunctionExpressionNameScope(node) { nestFunctionExpressionNameScope(node) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.FunctionExpressionNameScope(this, this.currentScope, node)); return this.nestScope(new scope_1.FunctionExpressionNameScope(this, this.currentScope, node));
} }
nestFunctionScope(node, isMethodDefinition) { nestFunctionScope(node, isMethodDefinition) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.FunctionScope(this, this.currentScope, node, isMethodDefinition)); return this.nestScope(new scope_1.FunctionScope(this, this.currentScope, node, isMethodDefinition));
} }
nestFunctionTypeScope(node) { nestFunctionTypeScope(node) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.FunctionTypeScope(this, this.currentScope, node)); return this.nestScope(new scope_1.FunctionTypeScope(this, this.currentScope, node));
} }
nestGlobalScope(node) { nestGlobalScope(node) {
return this.nestScope(new scope_1.GlobalScope(this, node)); return this.nestScope(new scope_1.GlobalScope(this, node));
} }
nestMappedTypeScope(node) { nestMappedTypeScope(node) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.MappedTypeScope(this, this.currentScope, node)); return this.nestScope(new scope_1.MappedTypeScope(this, this.currentScope, node));
} }
nestModuleScope(node) { nestModuleScope(node) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.ModuleScope(this, this.currentScope, node)); return this.nestScope(new scope_1.ModuleScope(this, this.currentScope, node));
} }
nestSwitchScope(node) { nestSwitchScope(node) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.SwitchScope(this, this.currentScope, node)); return this.nestScope(new scope_1.SwitchScope(this, this.currentScope, node));
} }
nestTSEnumScope(node) { nestTSEnumScope(node) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.TSEnumScope(this, this.currentScope, node)); return this.nestScope(new scope_1.TSEnumScope(this, this.currentScope, node));
} }
nestTSModuleScope(node) { nestTSModuleScope(node) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.TSModuleScope(this, this.currentScope, node)); return this.nestScope(new scope_1.TSModuleScope(this, this.currentScope, node));
} }
nestTypeScope(node) { nestTypeScope(node) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.TypeScope(this, this.currentScope, node)); return this.nestScope(new scope_1.TypeScope(this, this.currentScope, node));
} }
nestWithScope(node) { nestWithScope(node) {
assert_1.assert(this.currentScope); (0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.WithScope(this, this.currentScope, node)); return this.nestScope(new scope_1.WithScope(this, this.currentScope, node));
} }
} }

File diff suppressed because one or more lines are too long

View File

@@ -9,8 +9,9 @@ interface AnalyzeOptions {
/** /**
* Which ECMAScript version is considered. * Which ECMAScript version is considered.
* Defaults to `2018`. * Defaults to `2018`.
* `'latest'` is converted to 1e8 at parser.
*/ */
ecmaVersion?: EcmaVersion; ecmaVersion?: EcmaVersion | 1e8;
/** /**
* Whether the whole script is executed under node.js environment. * Whether the whole script is executed under node.js environment.
* When enabled, the scope manager adds a function scope immediately following the global scope. * When enabled, the scope manager adds a function scope immediately following the global scope.

View File

@@ -1 +1 @@
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../src/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAEtE,OAAO,EAAc,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C,UAAU,cAAc;IACtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IAEzD;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC;IAEZ;;OAEG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAEjC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAyBD;;GAEG;AACH,iBAAS,OAAO,CACd,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,eAAe,CAAC,EAAE,cAAc,GAC/B,YAAY,CAgCd;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC"} {"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../src/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAEtE,OAAO,EAAc,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C,UAAU,cAAc;IACtB;;OAEG;IACH,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IAEzD;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,GAAG,CAAC;IAEhC;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC;IAEZ;;OAEG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAEjC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AA6BD;;GAEG;AACH,iBAAS,OAAO,CACd,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,eAAe,CAAC,EAAE,cAAc,GAC/B,YAAY,CAgCd;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC"}

View File

@@ -16,6 +16,10 @@ const DEFAULT_OPTIONS = {
sourceType: 'script', sourceType: 'script',
emitDecoratorMetadata: false, emitDecoratorMetadata: false,
}; };
/**
* Convert ecmaVersion to lib.
* `'latest'` is converted to 1e8 at parser.
*/
function mapEcmaVersion(version) { function mapEcmaVersion(version) {
if (version == null || version === 3 || version === 5) { if (version == null || version === 3 || version === 5) {
return 'es5'; return 'es5';

View File

@@ -1 +1 @@
{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../src/analyze.ts"],"names":[],"mappings":";;;AACA,kEAA8D;AAC9D,6CAA6D;AAC7D,i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SAAS;YAC3B,CAAC,CAAC,eAAe,CAAC,SAAS;QAC/B,eAAe,EACb,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,eAAe,mCAAI,eAAe,CAAC,eAAe;QACrE,UAAU,EAAE,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,UAAU,mCAAI,eAAe,CAAC,UAAU;QACrE,GAAG,EAAE,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,GAAG,mCAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QAC1D,qBAAqB,EACnB,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,qBAAqB,mCACtC,eAAe,CAAC,qBAAqB;KACxC,CAAC;IAEF,mCAAmC;IACnC,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAS,CAAC,CAAC;IAE3D,MAAM,YAAY,GAAG,IAAI,2BAAY,CAAC,OAAO,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG,IAAI,uBAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAEzD,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEvB,OAAO,YAAY,CAAC;AACtB,CAAC;AAEQ,0BAAO"}

View File

@@ -2,7 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.DefinitionBase = void 0; exports.DefinitionBase = void 0;
const ID_1 = require("../ID"); const ID_1 = require("../ID");
const generator = ID_1.createIdGenerator(); const generator = (0, ID_1.createIdGenerator)();
class DefinitionBase { class DefinitionBase {
constructor(type, name, node, parent) { constructor(type, name, node, parent) {
/** /**

View File

@@ -1 +1 @@
{"version":3,"file":"DefinitionBase.js","sourceRoot":"","sources":["../../src/definition/DefinitionBase.ts"],"names":[],"mappings":";;;AAEA,8BAA0C;AAE1C,MAAM,SAAS,GAAG,sBAAiB,EAAE,CAAC;AAEtC,MAAe,cAAc;IAmC3B,YAAY,IAAW,EAAE,IAAW,EAAE,IAAW,EAAE,MAAe;QA7BlE;;WAEG;QACa,QAAG,GAAW,SAAS,EAAE,CAAC;QA2BxC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CAWF;AAEQ,wCAAc"} {"version":3,"file":"DefinitionBase.js","sourceRoot":"","sources":["../../src/definition/DefinitionBase.ts"],"names":[],"mappings":";;;AAEA,8BAA0C;AAE1C,MAAM,SAAS,GAAG,IAAA,sBAAiB,GAAE,CAAC;AAEtC,MAAe,cAAc;IAmC3B,YAAY,IAAW,EAAE,IAAW,EAAE,IAAW,EAAE,MAAe;QA7BlE;;WAEG;QACa,QAAG,GAAW,SAAS,EAAE,CAAC;QA2BxC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CAWF;AAEQ,wCAAc"}

View File

@@ -1 +1 @@
{"version":3,"file":"DefinitionType.d.ts","sourceRoot":"","sources":["../../src/definition/DefinitionType.ts"],"names":[],"mappings":"AAAA,aAAK,cAAc;IAEjB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,sBAAsB,2BAA2B;IACjD,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,YAAY,qBAAqB;IACjC,YAAY,iBAAiB;IAC7B,IAAI,SAAS;IACb,QAAQ,aAAa;CACtB;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"} {"version":3,"file":"DefinitionType.d.ts","sourceRoot":"","sources":["../../src/definition/DefinitionType.ts"],"names":[],"mappings":"AAAA,aAAK,cAAc;IACjB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,sBAAsB,2BAA2B;IACjD,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,YAAY,qBAAqB;IACjC,YAAY,iBAAiB;IAC7B,IAAI,SAAS;IACb,QAAQ,aAAa;CACtB;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}

View File

@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.DefinitionType = void 0; exports.DefinitionType = void 0;
var DefinitionType; var DefinitionType;
(function (DefinitionType) { (function (DefinitionType) {
// eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum
DefinitionType["CatchClause"] = "CatchClause"; DefinitionType["CatchClause"] = "CatchClause";
DefinitionType["ClassName"] = "ClassName"; DefinitionType["ClassName"] = "ClassName";
DefinitionType["FunctionName"] = "FunctionName"; DefinitionType["FunctionName"] = "FunctionName";

View File

@@ -1 +1 @@
{"version":3,"file":"DefinitionType.js","sourceRoot":"","sources":["../../src/definition/DefinitionType.ts"],"names":[],"mappings":";;;AAAA,IAAK,cAaJ;AAbD,WAAK,cAAc;IACjB,6EAA6E;IAC7E,6CAA2B,CAAA;IAC3B,yCAAuB,CAAA;IACvB,+CAA6B,CAAA;IAC7B,mEAAiD,CAAA;IACjD,iDAA+B,CAAA;IAC/B,yCAAuB,CAAA;IACvB,2CAAyB,CAAA;IACzB,mDAAiC,CAAA;IACjC,+CAA6B,CAAA;IAC7B,+BAAa,CAAA;IACb,uCAAqB,CAAA;AACvB,CAAC,EAbI,cAAc,KAAd,cAAc,QAalB;AAEQ,wCAAc"} {"version":3,"file":"DefinitionType.js","sourceRoot":"","sources":["../../src/definition/DefinitionType.ts"],"names":[],"mappings":";;;AAAA,IAAK,cAYJ;AAZD,WAAK,cAAc;IACjB,6CAA2B,CAAA;IAC3B,yCAAuB,CAAA;IACvB,+CAA6B,CAAA;IAC7B,mEAAiD,CAAA;IACjD,iDAA+B,CAAA;IAC/B,yCAAuB,CAAA;IACvB,2CAAyB,CAAA;IACzB,mDAAiC,CAAA;IACjC,+CAA6B,CAAA;IAC7B,+BAAa,CAAA;IACb,uCAAqB,CAAA;AACvB,CAAC,EAZI,cAAc,KAAd,cAAc,QAYlB;AAEQ,wCAAc"}

View File

@@ -7,19 +7,20 @@ declare class ClassVisitor extends Visitor {
static visit(referencer: Referencer, node: TSESTree.ClassDeclaration | TSESTree.ClassExpression, emitDecoratorMetadata: boolean): void; static visit(referencer: Referencer, node: TSESTree.ClassDeclaration | TSESTree.ClassExpression, emitDecoratorMetadata: boolean): void;
visit(node: TSESTree.Node | null | undefined): void; visit(node: TSESTree.Node | null | undefined): void;
protected visitClass(node: TSESTree.ClassDeclaration | TSESTree.ClassExpression): void; protected visitClass(node: TSESTree.ClassDeclaration | TSESTree.ClassExpression): void;
protected visitClassProperty(node: TSESTree.TSAbstractClassProperty | TSESTree.ClassProperty): void; protected visitPropertyDefinition(node: TSESTree.TSAbstractPropertyDefinition | TSESTree.PropertyDefinition): void;
protected visitFunctionParameterTypeAnnotation(node: TSESTree.Parameter, withDecorators: boolean): void; protected visitFunctionParameterTypeAnnotation(node: TSESTree.Parameter, withDecorators: boolean): void;
protected visitMethodFunction(node: TSESTree.FunctionExpression, methodNode: TSESTree.MethodDefinition): void; protected visitMethodFunction(node: TSESTree.FunctionExpression, methodNode: TSESTree.MethodDefinition): void;
protected visitProperty(node: TSESTree.ClassProperty | TSESTree.TSAbstractClassProperty | TSESTree.TSAbstractMethodDefinition): void; protected visitProperty(node: TSESTree.PropertyDefinition | TSESTree.TSAbstractPropertyDefinition | TSESTree.TSAbstractMethodDefinition): void;
protected visitMethod(node: TSESTree.MethodDefinition): void; protected visitMethod(node: TSESTree.MethodDefinition): void;
protected visitType(node: TSESTree.Node | null | undefined): void; protected visitType(node: TSESTree.Node | null | undefined): void;
protected visitMetadataType(node: TSESTree.TSTypeAnnotation | null | undefined, withDecorators: boolean): void; protected visitMetadataType(node: TSESTree.TSTypeAnnotation | null | undefined, withDecorators: boolean): void;
protected ClassBody(node: TSESTree.ClassBody): void; protected ClassBody(node: TSESTree.ClassBody): void;
protected ClassProperty(node: TSESTree.ClassProperty): void; protected PropertyDefinition(node: TSESTree.PropertyDefinition): void;
protected MethodDefinition(node: TSESTree.MethodDefinition): void; protected MethodDefinition(node: TSESTree.MethodDefinition): void;
protected TSAbstractClassProperty(node: TSESTree.TSAbstractClassProperty): void; protected TSAbstractPropertyDefinition(node: TSESTree.TSAbstractPropertyDefinition): void;
protected TSAbstractMethodDefinition(node: TSESTree.TSAbstractMethodDefinition): void; protected TSAbstractMethodDefinition(node: TSESTree.TSAbstractMethodDefinition): void;
protected Identifier(node: TSESTree.Identifier): void; protected Identifier(node: TSESTree.Identifier): void;
protected PrivateIdentifier(): void;
} }
export { ClassVisitor }; export { ClassVisitor };
//# sourceMappingURL=ClassVisitor.d.ts.map //# sourceMappingURL=ClassVisitor.d.ts.map

View File

@@ -1 +1 @@
{"version":3,"file":"ClassVisitor.d.ts","sourceRoot":"","sources":["../../src/referencer/ClassVisitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,cAAM,YAAa,SAAQ,OAAO;;gBAM9B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,QAAQ,CAAC,eAAe,EAC1D,qBAAqB,EAAE,OAAO;IAQhC,MAAM,CAAC,KAAK,CACV,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,QAAQ,CAAC,eAAe,EAC1D,qBAAqB,EAAE,OAAO,GAC7B,IAA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U,EAAE,QAAQ,CAAC,gBAAgB,GACpC,IAAI;IAsHP,SAAS,CAAC,aAAa,CACrB,IAAI,EACA,QAAQ,CAAC,kBAAkB,GAC3B,QAAQ,CAAC,4BAA4B,GACrC,QAAQ,CAAC,0BAA0B,GACtC,IAAI;IAwBP,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,IAAI;IAgB5D,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;IAOjE,SAAS,CAAC,iBAAiB,CACzB,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,IAAI,GAAG,SAAS,EAClD,cAAc,EAAE,OAAO,GACtB,IAAI;IA0CP,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,GAAG,IAAI;IAMnD,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,kBAAkB,GAAG,IAAI;IAIrE,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,IAAI;IAIjE,SAAS,CAAC,4BAA4B,CACpC,IAAI,EAAE,QAAQ,CAAC,4BAA4B,GAC1C,IAAI;IAIP,SAAS,CAAC,0BAA0B,CAClC,IAAI,EAAE,QAAQ,CAAC,0BAA0B,GACxC,IAAI;IAIP,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI;IAIrD,SAAS,CAAC,iBAAiB,IAAI,IAAI;CAGpC;AAsCD,OAAO,EAAE,YAAY,EAAE,CAAC"}

View File

@@ -68,7 +68,7 @@ class ClassVisitor extends Visitor_1.Visitor {
this.visit(node.body); this.visit(node.body);
__classPrivateFieldGet(this, _ClassVisitor_referencer, "f").close(node); __classPrivateFieldGet(this, _ClassVisitor_referencer, "f").close(node);
} }
visitClassProperty(node) { visitPropertyDefinition(node) {
this.visitProperty(node); this.visitProperty(node);
/** /**
* class A { * class A {
@@ -185,7 +185,15 @@ class ClassVisitor extends Visitor_1.Visitor {
if (node.computed) { if (node.computed) {
__classPrivateFieldGet(this, _ClassVisitor_referencer, "f").visit(node.key); __classPrivateFieldGet(this, _ClassVisitor_referencer, "f").visit(node.key);
} }
__classPrivateFieldGet(this, _ClassVisitor_referencer, "f").visit(node.value); if (node.value) {
if (node.type === types_1.AST_NODE_TYPES.PropertyDefinition) {
__classPrivateFieldGet(this, _ClassVisitor_referencer, "f").scopeManager.nestClassFieldInitializerScope(node.value);
}
__classPrivateFieldGet(this, _ClassVisitor_referencer, "f").visit(node.value);
if (node.type === types_1.AST_NODE_TYPES.PropertyDefinition) {
__classPrivateFieldGet(this, _ClassVisitor_referencer, "f").close(node.value);
}
}
if ('decorators' in node) { if ('decorators' in node) {
(_a = node.decorators) === null || _a === void 0 ? void 0 : _a.forEach(d => __classPrivateFieldGet(this, _ClassVisitor_referencer, "f").visit(d)); (_a = node.decorators) === null || _a === void 0 ? void 0 : _a.forEach(d => __classPrivateFieldGet(this, _ClassVisitor_referencer, "f").visit(d));
} }
@@ -250,14 +258,14 @@ class ClassVisitor extends Visitor_1.Visitor {
// for all nodes it cares about (see the instance visit method above) // for all nodes it cares about (see the instance visit method above)
this.visitChildren(node); this.visitChildren(node);
} }
ClassProperty(node) { PropertyDefinition(node) {
this.visitClassProperty(node); this.visitPropertyDefinition(node);
} }
MethodDefinition(node) { MethodDefinition(node) {
this.visitMethod(node); this.visitMethod(node);
} }
TSAbstractClassProperty(node) { TSAbstractPropertyDefinition(node) {
this.visitClassProperty(node); this.visitPropertyDefinition(node);
} }
TSAbstractMethodDefinition(node) { TSAbstractMethodDefinition(node) {
this.visitProperty(node); this.visitProperty(node);
@@ -265,6 +273,9 @@ class ClassVisitor extends Visitor_1.Visitor {
Identifier(node) { Identifier(node) {
__classPrivateFieldGet(this, _ClassVisitor_referencer, "f").visit(node); __classPrivateFieldGet(this, _ClassVisitor_referencer, "f").visit(node);
} }
PrivateIdentifier() {
// intentionally skip
}
} }
exports.ClassVisitor = ClassVisitor; exports.ClassVisitor = ClassVisitor;
_ClassVisitor_classNode = new WeakMap(), _ClassVisitor_referencer = new WeakMap(), _ClassVisitor_emitDecoratorMetadata = new WeakMap(); _ClassVisitor_classNode = new WeakMap(), _ClassVisitor_referencer = new WeakMap(), _ClassVisitor_emitDecoratorMetadata = new WeakMap();

View File

@@ -21,7 +21,7 @@ var ReferenceFlag;
ReferenceFlag[ReferenceFlag["ReadWrite"] = 3] = "ReadWrite"; ReferenceFlag[ReferenceFlag["ReadWrite"] = 3] = "ReadWrite";
})(ReferenceFlag || (ReferenceFlag = {})); })(ReferenceFlag || (ReferenceFlag = {}));
exports.ReferenceFlag = ReferenceFlag; exports.ReferenceFlag = ReferenceFlag;
const generator = ID_1.createIdGenerator(); const generator = (0, ID_1.createIdGenerator)();
var ReferenceTypeFlag; var ReferenceTypeFlag;
(function (ReferenceTypeFlag) { (function (ReferenceTypeFlag) {
ReferenceTypeFlag[ReferenceTypeFlag["Value"] = 1] = "Value"; ReferenceTypeFlag[ReferenceTypeFlag["Value"] = 1] = "Value";

View File

@@ -1 +1 @@
{"version":3,"file":"Reference.js","sourceRoot":"","sources":["../../src/referencer/Reference.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,8BAA0C;AAI1C,IAAK,aAIJ;AAJD,WAAK,aAAa;IAChB,iDAAU,CAAA;IACV,mDAAW,CAAA;IACX,2DAAe,CAAA;AACjB,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB;AA0ImB,sCAAa;AAlIjC,MAAM,SAAS,GAAG,sBAAiB,EAAE,CAAC;AAEtC,IAAK,iBAGJ;AAHD,WAAK,iBAAiB;IACpB,2DAAW,CAAA;IACX,yDAAU,CAAA;AACZ,CAAC,EAHI,iBAAiB,KAAjB,iBAAiB,QAGrB;AA6HkC,8CAAiB;AA3HpD;;GAEG;AACH,MAAM,SAAS;IAwDb,YACE,UAAwD,EACxD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;SAClB;QAED,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,uBAAA,IAAI,4BAAkB,aAAa,MAAA,CAAC;IACtC,CAAC;IAnCD;;OAEG;IACH,IAAW,eAAe;QACxB,OAAO,CAAC,uBAAA,IAAI,gCAAe,GAAG,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,IAAW,gBAAgB;QACzB,OAAO,CAAC,uBAAA,IAAI,gCAAe,GAAG,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC;IAyBD;;;OAGG;IACI,OAAO;QACZ,OAAO,CAAC,CAAC,CAAC,uBAAA,IAAI,uBAAM,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACI,MAAM;QACX,OAAO,CAAC,CAAC,CAAC,uBAAA,IAAI,uBAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACI,UAAU;QACf,OAAO,uBAAA,IAAI,uBAAM,KAAK,aAAa,CAAC,IAAI,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACI,WAAW;QAChB,OAAO,uBAAA,IAAI,uBAAM,KAAK,aAAa,CAAC,KAAK,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACI,WAAW;QAChB,OAAO,uBAAA,IAAI,uBAAM,KAAK,aAAa,CAAC,SAAS,CAAC;IAChD,CAAC;CACF;AAEQ,8BAAS"}

View File

@@ -60,6 +60,7 @@ declare class Referencer extends Visitor {
protected MemberExpression(node: TSESTree.MemberExpression): void; protected MemberExpression(node: TSESTree.MemberExpression): void;
protected MetaProperty(): void; protected MetaProperty(): void;
protected NewExpression(node: TSESTree.NewExpression): void; protected NewExpression(node: TSESTree.NewExpression): void;
protected PrivateIdentifier(): void;
protected Program(node: TSESTree.Program): void; protected Program(node: TSESTree.Program): void;
protected Property(node: TSESTree.Property): void; protected Property(node: TSESTree.Property): void;
protected SwitchStatement(node: TSESTree.SwitchStatement): void; protected SwitchStatement(node: TSESTree.SwitchStatement): void;

View File

@@ -1 +1 @@
{"version":3,"file":"Referencer.d.ts","sourceRoot":"","sources":["../../src/referencer/Referencer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,GAAG,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAKzE,OAAO,EAAiB,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAapD,OAAO,EAAE,KAAK,EAAe,MAAM,UAAU,CAAC;AAE9C,UAAU,iBAAkB,SAAQ,cAAc;IAChD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,GAAG,EAAE,GAAG,EAAE,CAAC;IACX,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAGD,cAAM,UAAW,SAAQ,OAAO;;IAO9B,SAAgB,YAAY,EAAE,YAAY,CAAC;gBAE/B,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,YAAY;IAS3D,YAAY,IAAI,KAAK;IACrB,YAAY,CAAC,WAAW,EAAE,IAAI,GAAG,KAAK,GAAG,IAAI;IAQ7C,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI;IAQhC,uBAAuB,CAC5B,OAAO,EAAE,QAAQ,CAAC,UAAU,EAC5B,WAAW,EAAE,CAAC,QAAQ,CAAC,oBAAoB,GAAG,QAAQ,CAAC,iBAAiB,CAAC,EAAE,EAC3E,mBAAmB,EAAE,uBAAuB,GAAG,IAAI,EACnD,IAAI,EAAE,OAAO,GACZ,IAAI;IAYP,OAAO,CAAC,sBAAsB;IAmB9B;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAgBjC,OAAO,CAAC,kBA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B,GACvC,IAAI;IAaP,SAAS,CAAC,6BAA6B,CACrC,IAAI,EAAE,QAAQ,CAAC,6BAA6B,GAC3C,IAAI;IAIP,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,iBAAiB,GAAG,IAAI;IA+CnE,SAAS,CAAC,sBAAsB,CAC9B,IAAI,EAAE,QAAQ,CAAC,sBAAsB,GACpC,IAAI;IAIP,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,mBAAmB,GAAG,IAAI;IAevE,SAAS,CAAC,sBAAsB,CAC9B,IAAI,EAAE,QAAQ,CAAC,sBAAsB,GACpC,IAAI;IAIP,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,eAAe,GAAG,IAAI;IAI/D,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,IAAI;IAcjE,SAAS,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,mBAAmB,GAAG,IAAI;IAyCvE,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,aAAa,GAAG,IAAI;CAU5D;AAED,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC"}

View File

@@ -42,7 +42,7 @@ class Referencer extends Visitor_1.Visitor {
} }
currentScope(dontThrowOnNull) { currentScope(dontThrowOnNull) {
if (!dontThrowOnNull) { if (!dontThrowOnNull) {
assert_1.assert(this.scopeManager.currentScope, 'aaa'); (0, assert_1.assert)(this.scopeManager.currentScope, 'aaa');
} }
return this.scopeManager.currentScope; return this.scopeManager.currentScope;
} }
@@ -329,7 +329,7 @@ class Referencer extends Visitor_1.Visitor {
this.visitType(node.typeAnnotation); this.visitType(node.typeAnnotation);
} }
ImportDeclaration(node) { ImportDeclaration(node) {
assert_1.assert(this.scopeManager.isES6() && this.scopeManager.isModule(), 'ImportDeclaration should appear when the mode is ES6 and in the module context.'); (0, assert_1.assert)(this.scopeManager.isES6() && this.scopeManager.isModule(), 'ImportDeclaration should appear when the mode is ES6 and in the module context.');
ImportVisitor_1.ImportVisitor.visit(this, node); ImportVisitor_1.ImportVisitor.visit(this, node);
} }
JSXAttribute(node) { JSXAttribute(node) {
@@ -384,6 +384,9 @@ class Referencer extends Visitor_1.Visitor {
this.visitChildren(node, ['typeParameters']); this.visitChildren(node, ['typeParameters']);
this.visitType(node.typeParameters); this.visitType(node.typeParameters);
} }
PrivateIdentifier() {
// private identifiers are members on classes and thus have no variables to to reference
}
Program(node) { Program(node) {
const globalScope = this.scopeManager.nestGlobalScope(node); const globalScope = this.scopeManager.nestGlobalScope(node);
this.populateGlobalsFromLib(globalScope); this.populateGlobalsFromLib(globalScope);

View File

@@ -0,0 +1,10 @@
import { TSESTree } from '@typescript-eslint/types';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
import { ScopeManager } from '../ScopeManager';
declare class ClassFieldInitializerScope extends ScopeBase<ScopeType.classFieldInitializer, TSESTree.Expression, Scope> {
constructor(scopeManager: ScopeManager, upperScope: ClassFieldInitializerScope['upper'], block: ClassFieldInitializerScope['block']);
}
export { ClassFieldInitializerScope };
//# sourceMappingURL=ClassFieldInitializerScope.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ClassFieldInitializerScope.d.ts","sourceRoot":"","sources":["../../src/scope/ClassFieldInitializerScope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,cAAM,0BAA2B,SAAQ,SAAS,CAChD,SAAS,CAAC,qBAAqB,EAE/B,QAAQ,CAAC,UAAU,EACnB,KAAK,CACN;gBAEG,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,0BAA0B,CAAC,OAAO,CAAC,EAC/C,KAAK,EAAE,0BAA0B,CAAC,OAAO,CAAC;CAU7C;AAED,OAAO,EAAE,0BAA0B,EAAE,CAAC"}

View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClassFieldInitializerScope = void 0;
const ScopeBase_1 = require("./ScopeBase");
const ScopeType_1 = require("./ScopeType");
class ClassFieldInitializerScope extends ScopeBase_1.ScopeBase {
constructor(scopeManager, upperScope, block) {
super(scopeManager, ScopeType_1.ScopeType.classFieldInitializer, upperScope, block, false);
}
}
exports.ClassFieldInitializerScope = ClassFieldInitializerScope;
//# sourceMappingURL=ClassFieldInitializerScope.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ClassFieldInitializerScope.js","sourceRoot":"","sources":["../../src/scope/ClassFieldInitializerScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AAGxC,MAAM,0BAA2B,SAAQ,qBAKxC;IACC,YACE,YAA0B,EAC1B,UAA+C,EAC/C,KAA0C;QAE1C,KAAK,CACH,YAAY,EACZ,qBAAS,CAAC,qBAAqB,EAC/B,UAAU,EACV,KAAK,EACL,KAAK,CACN,CAAC;IACJ,CAAC;CACF;AAEQ,gEAA0B"}

View File

@@ -20,7 +20,7 @@ class GlobalScope extends ScopeBase_1.ScopeBase {
this.defineVariable(new variable_1.ImplicitLibVariable(this, name, options), this.set, this.variables, null, null); this.defineVariable(new variable_1.ImplicitLibVariable(this, name, options), this.set, this.variables, null, null);
} }
close(scopeManager) { close(scopeManager) {
assert_1.assert(this.leftToResolve); (0, assert_1.assert)(this.leftToResolve);
for (const ref of this.leftToResolve) { for (const ref of this.leftToResolve) {
if (ref.maybeImplicitGlobal && !this.set.has(ref.identifier.name)) { if (ref.maybeImplicitGlobal && !this.set.has(ref.identifier.name)) {
// create an implicit global variable from assignment expression // create an implicit global variable from assignment expression

View File

@@ -1 +1 @@
{"version":3,"file":"GlobalScope.js","sourceRoot":"","sources":["../../src/scope/GlobalScope.ts"],"names":[],"mappings":";;;AAAA,oDAAoE;AAEpE,2CAAwC;AACxC,2CAAwC;AACxC,sCAAmC;AACnC,qGAAkG;AAGlG,0CAIqB;AAErB,MAAM,WAAY,SAAQ,qBAOzB;IAYC,YAAY,YAA0B,EAAE,KAA2B;QACjE,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC1D,IAAI,CAAC,QAAQ,GAAG;YACd,GAAG,EAAE,IAAI,GAAG,EAAoB;YAChC,SAAS,EAAE,EAAE;YACb,gBAAgB,EAAE,EAAE;SACrB,CAAC;IACJ,CAAC;IAEM,sBAAsB,CAC3B,IAAY,EACZ,OAAmC;QAEnC,IAAI,CAAC,cAAc,CACjB,IAAI,8BAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAC5C,IAAI,CAAC,GAAG,EACR,IAAI,CAAC,SAAS,EACd,IAAI,EACJ,IAAI,CACL,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,YAA0B;QACrC,eAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAE3B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,aAAa,EAAE;YACpC,IAAI,GAAG,CAAC,mBAAmB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBACjE,gEAAgE;gBAChE,MAAM,IAAI,GAAG,GAAG,CAAC,mBAAmB,CAAC;gBACrC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC;gBAC1B,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,UAAU,EAAE;oBACnD,IAAI,CAAC,cAAc,CACjB,IAAI,CAAC,IAAI,EACT,IAAI,CAA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CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBACjE,gEAAgE;gBAChE,MAAM,IAAI,GAAG,GAAG,CAAC,mBAAmB,CAAC;gBACrC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC;gBAC1B,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,UAAU,EAAE;oBACnD,IAAI,CAAC,cAAc,CACjB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,QAAQ,CAAC,GAAG,EACjB,IAAI,CAAC,QAAQ,CAAC,SAAS,EACvB,IAAI,EACJ,IAAI,mEAAgC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAC9D,CAAC;iBACH;aACF;SACF;QAED,IAAI,CAAC,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC;QACpD,OAAO,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACnC,CAAC;CACF;AAEQ,kCAAW"}

View File

@@ -1,5 +1,6 @@
import { BlockScope } from './BlockScope'; import { BlockScope } from './BlockScope';
import { CatchScope } from './CatchScope'; import { CatchScope } from './CatchScope';
import { ClassFieldInitializerScope } from './ClassFieldInitializerScope';
import { ClassScope } from './ClassScope'; import { ClassScope } from './ClassScope';
import { ConditionalTypeScope } from './ConditionalTypeScope'; import { ConditionalTypeScope } from './ConditionalTypeScope';
import { ForScope } from './ForScope'; import { ForScope } from './ForScope';
@@ -14,6 +15,6 @@ import { TSEnumScope } from './TSEnumScope';
import { TSModuleScope } from './TSModuleScope'; import { TSModuleScope } from './TSModuleScope';
import { TypeScope } from './TypeScope'; import { TypeScope } from './TypeScope';
import { WithScope } from './WithScope'; import { WithScope } from './WithScope';
declare type Scope = BlockScope | CatchScope | ClassScope | ConditionalTypeScope | ForScope | FunctionExpressionNameScope | FunctionScope | FunctionTypeScope | GlobalScope | MappedTypeScope | ModuleScope | SwitchScope | TSEnumScope | TSModuleScope | TypeScope | WithScope; declare type Scope = BlockScope | CatchScope | ClassScope | ClassFieldInitializerScope | ConditionalTypeScope | ForScope | FunctionExpressionNameScope | FunctionScope | FunctionTypeScope | GlobalScope | MappedTypeScope | ModuleScope | SwitchScope | TSEnumScope | TSModuleScope | TypeScope | WithScope;
export { Scope }; export { Scope };
//# sourceMappingURL=Scope.d.ts.map //# sourceMappingURL=Scope.d.ts.map

View File

@@ -1 +1 @@
{"version":3,"file":"Scope.d.ts","sourceRoot":"","sources":["../../src/scope/Scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,aAAK,KAAK,GACN,UAAU,GACV,UAAU,GACV,UAAU,GACV,oBAAoB,GACpB,QAAQ,GACR,2BAA2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,CAAC,oBAAoB,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI;IAQpD,OAAO,CAAC,0BAA0B;IAmBlC,SAAS,CAAC,cAAc,CACtB,cAAc,EAAE,MAAM,GAAG,QAAQ,EACjC,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC1B,SAAS,EAAE,QAAQ,EAAE,EACrB,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI,EAChC,GAAG,EAAE,UAAU,GAAG,IAAI,GACrB,IAAI;IAuBA,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI;IAIlE,uBAAuB,CAC5B,IAAI,EAAE,QAAQ,CAAC,aAAa,EAC5B,GAAG,EAAE,UAAU,GACd,IAAI;IAIA,cAAc,CACnB,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,aAAa,EAClD,MAAM,GAAE,aAAkC,EAC1C,SAAS,CAAC,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI,EACtC,mBAAmB,CAAC,EAAE,uBAAuB,GAAG,IAAI,EACpD,IAAI,UAAQ,GACX,IAAI;IAeA,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI;IAe9C,sBAAsB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,IAAI;CAc/D;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}

View File

@@ -106,10 +106,11 @@ function registerScope(scopeManager, scope) {
scopeManager.nodeToScope.set(scope.block, [scope]); scopeManager.nodeToScope.set(scope.block, [scope]);
} }
} }
const generator = ID_1.createIdGenerator(); const generator = (0, ID_1.createIdGenerator)();
const VARIABLE_SCOPE_TYPES = new Set([ const VARIABLE_SCOPE_TYPES = new Set([
ScopeType_1.ScopeType.global, ScopeType_1.ScopeType.classFieldInitializer,
ScopeType_1.ScopeType.function, ScopeType_1.ScopeType.function,
ScopeType_1.ScopeType.global,
ScopeType_1.ScopeType.module, ScopeType_1.ScopeType.module,
ScopeType_1.ScopeType.tsModule, ScopeType_1.ScopeType.tsModule,
]); ]);
@@ -280,7 +281,7 @@ class ScopeBase {
closeRef = __classPrivateFieldGet(this, _ScopeBase_globalCloseRef, "f"); closeRef = __classPrivateFieldGet(this, _ScopeBase_globalCloseRef, "f");
} }
// Try Resolving all references in this scope. // Try Resolving all references in this scope.
assert_1.assert(this.leftToResolve); (0, assert_1.assert)(this.leftToResolve);
for (let i = 0; i < this.leftToResolve.length; ++i) { for (let i = 0; i < this.leftToResolve.length; ++i) {
const ref = this.leftToResolve[i]; const ref = this.leftToResolve[i];
closeRef(ref, scopeManager); closeRef(ref, scopeManager);

File diff suppressed because one or more lines are too long

View File

@@ -2,6 +2,7 @@ declare enum ScopeType {
block = "block", block = "block",
catch = "catch", catch = "catch",
class = "class", class = "class",
classFieldInitializer = "class-field-initializer",
conditionalType = "conditionalType", conditionalType = "conditionalType",
for = "for", for = "for",
function = "function", function = "function",

View File

@@ -1 +1 @@
{"version":3,"file":"ScopeType.d.ts","sourceRoot":"","sources":["../../src/scope/ScopeType.ts"],"names":[],"mappings":"AAAA,aAAK,SAAS;IACZ,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;IACf,eAAe,oBAAoB;IACnC,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,sBAAsB,6BAA6B;IACnD,YAAY,iBAAiB;IAC7B,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"} {"version":3,"file":"ScopeType.d.ts","sourceRoot":"","sources":["../../src/scope/ScopeType.ts"],"names":[],"mappings":"AAAA,aAAK,SAAS;IACZ,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;IACf,qBAAqB,4BAA4B;IACjD,eAAe,oBAAoB;IACnC,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,sBAAsB,6BAA6B;IACnD,YAAY,iBAAiB;IAC7B,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}

View File

@@ -6,6 +6,7 @@ var ScopeType;
ScopeType["block"] = "block"; ScopeType["block"] = "block";
ScopeType["catch"] = "catch"; ScopeType["catch"] = "catch";
ScopeType["class"] = "class"; ScopeType["class"] = "class";
ScopeType["classFieldInitializer"] = "class-field-initializer";
ScopeType["conditionalType"] = "conditionalType"; ScopeType["conditionalType"] = "conditionalType";
ScopeType["for"] = "for"; ScopeType["for"] = "for";
ScopeType["function"] = "function"; ScopeType["function"] = "function";

View File

@@ -1 +1 @@
{"version":3,"file":"ScopeType.js","sourceRoot":"","sources":["../../src/scope/ScopeType.ts"],"names":[],"mappings":";;;AAAA,IAAK,SAiBJ;AAjBD,WAAK,SAAS;IACZ,4BAAe,CAAA;IACf,4BAAe,CAAA;IACf,4BAAe,CAAA;IACf,gDAAmC,CAAA;IACnC,wBAAW,CAAA;IACX,kCAAqB,CAAA;IACrB,gEAAmD,CAAA;IACnD,0CAA6B,CAAA;IAC7B,8BAAiB,CAAA;IACjB,sCAAyB,CAAA;IACzB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;IACrB,0BAAa,CAAA;IACb,0BAAa,CAAA;AACf,CAAC,EAjBI,SAAS,KAAT,SAAS,QAiBb;AAEQ,8BAAS"} {"version":3,"file":"ScopeType.js","sourceRoot":"","sources":["../../src/scope/ScopeType.ts"],"names":[],"mappings":";;;AAAA,IAAK,SAkBJ;AAlBD,WAAK,SAAS;IACZ,4BAAe,CAAA;IACf,4BAAe,CAAA;IACf,4BAAe,CAAA;IACf,8DAAiD,CAAA;IACjD,gDAAmC,CAAA;IACnC,wBAAW,CAAA;IACX,kCAAqB,CAAA;IACrB,gEAAmD,CAAA;IACnD,0CAA6B,CAAA;IAC7B,8BAAiB,CAAA;IACjB,sCAAyB,CAAA;IACzB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;IACrB,0BAAa,CAAA;IACb,0BAAa,CAAA;AACf,CAAC,EAlBI,SAAS,KAAT,SAAS,QAkBb;AAEQ,8BAAS"}

View File

@@ -12,7 +12,7 @@ class WithScope extends ScopeBase_1.ScopeBase {
if (this.shouldStaticallyClose()) { if (this.shouldStaticallyClose()) {
return super.close(scopeManager); return super.close(scopeManager);
} }
assert_1.assert(this.leftToResolve); (0, assert_1.assert)(this.leftToResolve);
for (let i = 0; i < this.leftToResolve.length; ++i) { for (let i = 0; i < this.leftToResolve.length; ++i) {
const ref = this.leftToResolve[i]; const ref = this.leftToResolve[i];
this.delegateToUpperScope(ref); this.delegateToUpperScope(ref);

View File

@@ -1 +1 @@
{"version":3,"file":"WithScope.js","sourceRoot":"","sources":["../../src/scope/WithScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AACxC,sCAAmC;AAGnC,MAAM,SAAU,SAAQ,qBAIvB;IACC,YACE,YAA0B,EAC1B,UAA8B,EAC9B,KAAyB;QAEzB,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;IACD,KAAK,CAAC,YAA0B;QAC9B,IAAI,IAAI,CAAC,qBAAqB,EAAE,EAAE;YAChC,OAAO,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;SAClC;QACD,eAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YAClD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;YAClC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;SAChC;QACD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF;AAEQ,8BAAS"} {"version":3,"file":"WithScope.js","sourceRoot":"","sources":["../../src/scope/WithScope.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,2CAAwC;AACxC,sCAAmC;AAGnC,MAAM,SAAU,SAAQ,qBAIvB;IACC,YACE,YAA0B,EAC1B,UAA8B,EAC9B,KAAyB;QAEzB,KAAK,CAAC,YAAY,EAAE,qBAAS,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;IACD,KAAK,CAAC,YAA0B;QAC9B,IAAI,IAAI,CAAC,qBAAqB,EAAE,EAAE;YAChC,OAAO,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;SAClC;QACD,IAAA,eAAM,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YAClD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;YAClC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;SAChC;QACD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF;AAEQ,8BAAS"}

View File

@@ -1,5 +1,6 @@
export * from './BlockScope'; export * from './BlockScope';
export * from './CatchScope'; export * from './CatchScope';
export * from './ClassFieldInitializerScope';
export * from './ClassScope'; export * from './ClassScope';
export * from './ConditionalTypeScope'; export * from './ConditionalTypeScope';
export * from './ForScope'; export * from './ForScope';

View File

@@ -1 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scope/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"} {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scope/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}

View File

@@ -12,6 +12,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./BlockScope"), exports); __exportStar(require("./BlockScope"), exports);
__exportStar(require("./CatchScope"), exports); __exportStar(require("./CatchScope"), exports);
__exportStar(require("./ClassFieldInitializerScope"), exports);
__exportStar(require("./ClassScope"), exports); __exportStar(require("./ClassScope"), exports);
__exportStar(require("./ConditionalTypeScope"), exports); __exportStar(require("./ConditionalTypeScope"), exports);
__exportStar(require("./ForScope"), exports); __exportStar(require("./ForScope"), exports);

View File

@@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scope/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAC7B,+CAA6B;AAC7B,yDAAuC;AACvC,6CAA2B;AAC3B,gEAA8C;AAC9C,kDAAgC;AAChC,sDAAoC;AACpC,gDAA8B;AAC9B,oDAAkC;AAClC,gDAA8B;AAC9B,0CAAwB;AACxB,8CAA4B;AAC5B,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC;AAChC,8CAA4B;AAC5B,8CAA4B"} {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scope/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAC7B,+DAA6C;AAC7C,+CAA6B;AAC7B,yDAAuC;AACvC,6CAA2B;AAC3B,gEAA8C;AAC9C,kDAAgC;AAChC,sDAAoC;AACpC,gDAA8B;AAC9B,oDAAkC;AAClC,gDAA8B;AAC9B,0CAAwB;AACxB,8CAA4B;AAC5B,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC;AAChC,8CAA4B;AAC5B,8CAA4B"}

View File

@@ -2,7 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.VariableBase = void 0; exports.VariableBase = void 0;
const ID_1 = require("../ID"); const ID_1 = require("../ID");
const generator = ID_1.createIdGenerator(); const generator = (0, ID_1.createIdGenerator)();
class VariableBase { class VariableBase {
constructor(name, scope) { constructor(name, scope) {
/** /**

View File

@@ -1 +1 @@
{"version":3,"file":"VariableBase.js","sourceRoot":"","sources":["../../src/variable/VariableBase.ts"],"names":[],"mappings":";;;AAEA,8BAA0C;AAI1C,MAAM,SAAS,GAAG,sBAAiB,EAAE,CAAC;AAEtC,MAAM,YAAY;IAsChB,YAAY,IAAY,EAAE,KAAY;QArCtC;;WAEG;QACa,QAAG,GAAW,SAAS,EAAE,CAAC;QAE1C;;;WAGG;QACa,SAAI,GAAiB,EAAE,CAAC;QACxC;;;WAGG;QACI,eAAU,GAAG,KAAK,CAAC;QAC1B;;;;WAIG;QACa,gBAAW,GAA0B,EAAE,CAAC;QAMxD;;;;WAIG;QACa,eAAU,GAAgB,EAAE,CAAC;QAO3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAEQ,oCAAY"} {"version":3,"file":"VariableBase.js","sourceRoot":"","sources":["../../src/variable/VariableBase.ts"],"names":[],"mappings":";;;AAEA,8BAA0C;AAI1C,MAAM,SAAS,GAAG,IAAA,sBAAiB,GAAE,CAAC;AAEtC,MAAM,YAAY;IAsChB,YAAY,IAAY,EAAE,KAAY;QArCtC;;WAEG;QACa,QAAG,GAAW,SAAS,EAAE,CAAC;QAE1C;;;WAGG;QACa,SAAI,GAAiB,EAAE,CAAC;QACxC;;;WAGG;QACI,eAAU,GAAG,KAAK,CAAC;QAC1B;;;;WAIG;QACa,gBAAW,GAA0B,EAAE,CAAC;QAMxD;;;;WAIG;QACa,eAAU,GAAgB,EAAE,CAAC;QAO3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAEQ,oCAAY"}

View File

@@ -1,6 +1,6 @@
{ {
"name": "@typescript-eslint/scope-manager", "name": "@typescript-eslint/scope-manager",
"version": "4.29.2", "version": "5.0.0",
"description": "TypeScript scope analyser for ESLint", "description": "TypeScript scope analyser for ESLint",
"keywords": [ "keywords": [
"eslint", "eslint",
@@ -8,7 +8,7 @@
"estree" "estree"
], ],
"engines": { "engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}, },
"files": [ "files": [
"dist", "dist",
@@ -39,12 +39,12 @@
"typecheck": "tsc -p tsconfig.json --noEmit" "typecheck": "tsc -p tsconfig.json --noEmit"
}, },
"dependencies": { "dependencies": {
"@typescript-eslint/types": "4.29.2", "@typescript-eslint/types": "5.0.0",
"@typescript-eslint/visitor-keys": "4.29.2" "@typescript-eslint/visitor-keys": "5.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/glob": "*", "@types/glob": "*",
"@typescript-eslint/typescript-estree": "4.29.2", "@typescript-eslint/typescript-estree": "5.0.0",
"glob": "*", "glob": "*",
"jest-specific-snapshot": "*", "jest-specific-snapshot": "*",
"make-dir": "*", "make-dir": "*",
@@ -64,5 +64,5 @@
] ]
} }
}, },
"gitHead": "bf402f4a04397943ca916c8333186f539986a247" "gitHead": "101abc72f0baced5cdf609d99418ad9f10830c73"
} }

View File

@@ -3,6 +3,76 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11)
### Features
* support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933)
# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04)
**Note:** Version bump only for package @typescript-eslint/types
# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27)
### Features
* Support `'latest'` as `ecmaVersion` ([#3873](https://github.com/typescript-eslint/typescript-eslint/issues/3873)) ([25a42c0](https://github.com/typescript-eslint/typescript-eslint/commit/25a42c0bbe92d1ecbc2e8ff9ef3a3ef413f728b0))
## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20)
**Note:** Version bump only for package @typescript-eslint/types
## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13)
**Note:** Version bump only for package @typescript-eslint/types
# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06)
**Note:** Version bump only for package @typescript-eslint/types
# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30)
**Note:** Version bump only for package @typescript-eslint/types
## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23)
**Note:** Version bump only for package @typescript-eslint/types
## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) ## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16)
**Note:** Version bump only for package @typescript-eslint/types **Note:** Version bump only for package @typescript-eslint/types

View File

@@ -59,7 +59,6 @@ export declare enum AST_NODE_TYPES {
ClassBody = "ClassBody", ClassBody = "ClassBody",
ClassDeclaration = "ClassDeclaration", ClassDeclaration = "ClassDeclaration",
ClassExpression = "ClassExpression", ClassExpression = "ClassExpression",
ClassProperty = "ClassProperty",
ConditionalExpression = "ConditionalExpression", ConditionalExpression = "ConditionalExpression",
ContinueStatement = "ContinueStatement", ContinueStatement = "ContinueStatement",
DebuggerStatement = "DebuggerStatement", DebuggerStatement = "DebuggerStatement",
@@ -107,12 +106,15 @@ export declare enum AST_NODE_TYPES {
NewExpression = "NewExpression", NewExpression = "NewExpression",
ObjectExpression = "ObjectExpression", ObjectExpression = "ObjectExpression",
ObjectPattern = "ObjectPattern", ObjectPattern = "ObjectPattern",
PrivateIdentifier = "PrivateIdentifier",
Program = "Program", Program = "Program",
Property = "Property", Property = "Property",
PropertyDefinition = "PropertyDefinition",
RestElement = "RestElement", RestElement = "RestElement",
ReturnStatement = "ReturnStatement", ReturnStatement = "ReturnStatement",
SequenceExpression = "SequenceExpression", SequenceExpression = "SequenceExpression",
SpreadElement = "SpreadElement", SpreadElement = "SpreadElement",
StaticBlock = "StaticBlock",
Super = "Super", Super = "Super",
SwitchCase = "SwitchCase", SwitchCase = "SwitchCase",
SwitchStatement = "SwitchStatement", SwitchStatement = "SwitchStatement",
@@ -132,9 +134,9 @@ export declare enum AST_NODE_TYPES {
/** /**
* TS-prefixed nodes * TS-prefixed nodes
*/ */
TSAbstractClassProperty = "TSAbstractClassProperty",
TSAbstractKeyword = "TSAbstractKeyword", TSAbstractKeyword = "TSAbstractKeyword",
TSAbstractMethodDefinition = "TSAbstractMethodDefinition", TSAbstractMethodDefinition = "TSAbstractMethodDefinition",
TSAbstractPropertyDefinition = "TSAbstractPropertyDefinition",
TSAnyKeyword = "TSAnyKeyword", TSAnyKeyword = "TSAnyKeyword",
TSArrayType = "TSArrayType", TSArrayType = "TSArrayType",
TSAsExpression = "TSAsExpression", TSAsExpression = "TSAsExpression",
@@ -179,7 +181,6 @@ export declare enum AST_NODE_TYPES {
TSObjectKeyword = "TSObjectKeyword", TSObjectKeyword = "TSObjectKeyword",
TSOptionalType = "TSOptionalType", TSOptionalType = "TSOptionalType",
TSParameterProperty = "TSParameterProperty", TSParameterProperty = "TSParameterProperty",
TSParenthesizedType = "TSParenthesizedType",
TSPrivateKeyword = "TSPrivateKeyword", TSPrivateKeyword = "TSPrivateKeyword",
TSPropertySignature = "TSPropertySignature", TSPropertySignature = "TSPropertySignature",
TSProtectedKeyword = "TSProtectedKeyword", TSProtectedKeyword = "TSProtectedKeyword",
@@ -242,7 +243,6 @@ declare interface BaseToken extends NodeOrTokenData {
value: string; value: string;
} }
export declare interface BigIntLiteral extends LiteralBase { export declare interface BigIntLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: bigint | null; value: bigint | null;
bigint: string; bigint: string;
} }
@@ -264,7 +264,6 @@ export declare interface BlockStatement extends BaseNode {
body: Statement[]; body: Statement[];
} }
export declare interface BooleanLiteral extends LiteralBase { export declare interface BooleanLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: boolean; value: boolean;
raw: 'false' | 'true'; raw: 'false' | 'true';
} }
@@ -311,39 +310,19 @@ declare interface ClassDeclarationBase extends BaseNode {
declare?: boolean; declare?: boolean;
decorators?: Decorator[]; decorators?: Decorator[];
} }
export declare type ClassElement = ClassProperty | MethodDefinition | TSAbstractClassProperty | TSAbstractMethodDefinition | TSIndexSignature; export declare type ClassElement = MethodDefinition | PropertyDefinition | StaticBlock | TSAbstractMethodDefinition | TSAbstractPropertyDefinition | TSIndexSignature;
export declare interface ClassExpression extends ClassDeclarationBase { export declare interface ClassExpression extends ClassDeclarationBase {
type: AST_NODE_TYPES.ClassExpression; type: AST_NODE_TYPES.ClassExpression;
} }
export declare type ClassProperty = ClassPropertyComputedName | ClassPropertyNonComputedName; declare interface ClassMethodDefinitionNonComputedNameBase extends MethodDefinitionBase {
declare interface ClassPropertyBase extends BaseNode { key: ClassPropertyNameNonComputed;
key: PropertyName;
value: Expression | null;
computed: boolean;
static: boolean;
declare: boolean;
readonly?: boolean;
decorators?: Decorator[];
accessibility?: Accessibility;
optional?: boolean;
definite?: boolean;
typeAnnotation?: TSTypeAnnotation;
override?: boolean;
}
export declare interface ClassPropertyComputedName extends ClassPropertyComputedNameBase {
type: AST_NODE_TYPES.ClassProperty;
}
declare interface ClassPropertyComputedNameBase extends ClassPropertyBase {
key: PropertyNameComputed;
computed: true;
}
export declare interface ClassPropertyNonComputedName extends ClassPropertyNonComputedNameBase {
type: AST_NODE_TYPES.ClassProperty;
}
declare interface ClassPropertyNonComputedNameBase extends ClassPropertyBase {
key: PropertyNameNonComputed;
computed: false; computed: false;
} }
declare interface ClassPropertyDefinitionNonComputedNameBase extends PropertyDefinitionBase {
key: ClassPropertyNameNonComputed;
computed: false;
}
export declare type ClassPropertyNameNonComputed = PrivateIdentifier | PropertyNameNonComputed;
export declare type Comment = BlockComment | LineComment; export declare type Comment = BlockComment | LineComment;
export declare interface ConditionalExpression extends BaseNode { export declare interface ConditionalExpression extends BaseNode {
type: AST_NODE_TYPES.ConditionalExpression; type: AST_NODE_TYPES.ConditionalExpression;
@@ -375,7 +354,7 @@ export declare interface EmptyStatement extends BaseNode {
export declare type EntityName = Identifier | TSQualifiedName; export declare type EntityName = Identifier | TSQualifiedName;
export declare interface ExportAllDeclaration extends BaseNode { export declare interface ExportAllDeclaration extends BaseNode {
type: AST_NODE_TYPES.ExportAllDeclaration; type: AST_NODE_TYPES.ExportAllDeclaration;
source: Expression | null; source: StringLiteral | null;
exportKind: ExportKind; exportKind: ExportKind;
exported: Identifier | null; exported: Identifier | null;
} }
@@ -391,7 +370,7 @@ export declare interface ExportNamedDeclaration extends BaseNode {
type: AST_NODE_TYPES.ExportNamedDeclaration; type: AST_NODE_TYPES.ExportNamedDeclaration;
declaration: ExportDeclaration | null; declaration: ExportDeclaration | null;
specifiers: ExportSpecifier[]; specifiers: ExportSpecifier[];
source: Expression | null; source: StringLiteral | null;
exportKind: ExportKind; exportKind: ExportKind;
} }
export declare interface ExportSpecifier extends BaseNode { export declare interface ExportSpecifier extends BaseNode {
@@ -399,7 +378,7 @@ export declare interface ExportSpecifier extends BaseNode {
local: Identifier; local: Identifier;
exported: Identifier; exported: Identifier;
} }
export declare type Expression = ArrayExpression | ArrayPattern | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | ClassExpression | ClassExpression | ConditionalExpression | FunctionExpression | FunctionExpression | Identifier | ImportExpression | JSXElement | JSXFragment | LiteralExpression | LogicalExpression | MemberExpression | MetaProperty | NewExpression | ObjectExpression | ObjectPattern | SequenceExpression | Super | TaggedTemplateExpression | TemplateLiteral | ThisExpression | TSAsExpression | TSNonNullExpression | TSTypeAssertion | UnaryExpression | UpdateExpression | YieldExpression; export declare type Expression = ArrayExpression | ArrayPattern | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | ImportExpression | JSXElement | JSXFragment | LiteralExpression | LogicalExpression | MemberExpression | MetaProperty | NewExpression | ObjectExpression | ObjectPattern | SequenceExpression | Super | TaggedTemplateExpression | TemplateLiteral | ThisExpression | TSAsExpression | TSNonNullExpression | TSTypeAssertion | UnaryExpression | UpdateExpression | YieldExpression;
export declare interface ExpressionStatement extends BaseNode { export declare interface ExpressionStatement extends BaseNode {
type: AST_NODE_TYPES.ExpressionStatement; type: AST_NODE_TYPES.ExpressionStatement;
expression: Expression; expression: Expression;
@@ -465,7 +444,7 @@ export declare interface IfStatement extends BaseNode {
export declare type ImportClause = ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier; export declare type ImportClause = ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier;
export declare interface ImportDeclaration extends BaseNode { export declare interface ImportDeclaration extends BaseNode {
type: AST_NODE_TYPES.ImportDeclaration; type: AST_NODE_TYPES.ImportDeclaration;
source: Literal; source: StringLiteral;
specifiers: ImportClause[]; specifiers: ImportClause[];
importKind: ImportKind; importKind: ImportKind;
} }
@@ -573,22 +552,13 @@ export declare interface LabeledStatement extends BaseNode {
label: Identifier; label: Identifier;
body: Statement; body: Statement;
} }
export declare type LeftHandSideExpression = ArrayExpression | ArrayPattern | ArrowFunctionExpression | CallExpression | ClassExpression | FunctionExpression | Identifier | JSXElement | JSXFragment | LiteralExpression | MemberExpression | MetaProperty | ObjectExpression | ObjectPattern | Super | TaggedTemplateExpression | ThisExpression | TSAsExpression | TSNonNullExpression | TSTypeAssertion; export declare type LeftHandSideExpression = ArrayExpression | ArrayPattern | ArrowFunctionExpression | CallExpression | ClassExpression | FunctionExpression | Identifier | JSXElement | JSXFragment | LiteralExpression | MemberExpression | MetaProperty | ObjectExpression | ObjectPattern | SequenceExpression | Super | TaggedTemplateExpression | ThisExpression | TSAsExpression | TSNonNullExpression | TSTypeAssertion;
export declare interface LineAndColumnData {
/**
* Line number (1-indexed)
*/
line: number;
/**
* Column number on the line (0-indexed)
*/
column: number;
}
export declare interface LineComment extends BaseToken { export declare interface LineComment extends BaseToken {
type: AST_TOKEN_TYPES.Line; type: AST_TOKEN_TYPES.Line;
} }
export declare type Literal = BigIntLiteral | BooleanLiteral | NullLiteral | NumberLiteral | RegExpLiteral | StringLiteral; export declare type Literal = BigIntLiteral | BooleanLiteral | NullLiteral | NumberLiteral | RegExpLiteral | StringLiteral;
declare interface LiteralBase extends BaseNode { declare interface LiteralBase extends BaseNode {
type: AST_NODE_TYPES.Literal;
raw: string; raw: string;
value: RegExp | bigint | boolean | number | string | null; value: RegExp | bigint | boolean | number | string | null;
} }
@@ -600,7 +570,7 @@ export declare interface LogicalExpression extends BinaryExpressionBase {
export declare type MemberExpression = MemberExpressionComputedName | MemberExpressionNonComputedName; export declare type MemberExpression = MemberExpressionComputedName | MemberExpressionNonComputedName;
declare interface MemberExpressionBase extends BaseNode { declare interface MemberExpressionBase extends BaseNode {
object: LeftHandSideExpression; object: LeftHandSideExpression;
property: Expression | Identifier; property: Expression | Identifier | PrivateIdentifier;
computed: boolean; computed: boolean;
optional: boolean; optional: boolean;
} }
@@ -611,7 +581,7 @@ export declare interface MemberExpressionComputedName extends MemberExpressionBa
} }
export declare interface MemberExpressionNonComputedName extends MemberExpressionBase { export declare interface MemberExpressionNonComputedName extends MemberExpressionBase {
type: AST_NODE_TYPES.MemberExpression; type: AST_NODE_TYPES.MemberExpression;
property: Identifier; property: Identifier | PrivateIdentifier;
computed: false; computed: false;
} }
export declare interface MetaProperty extends BaseNode { export declare interface MetaProperty extends BaseNode {
@@ -640,7 +610,7 @@ declare interface MethodDefinitionComputedNameBase extends MethodDefinitionBase
key: PropertyNameComputed; key: PropertyNameComputed;
computed: true; computed: true;
} }
export declare interface MethodDefinitionNonComputedName extends MethodDefinitionNonComputedNameBase { export declare interface MethodDefinitionNonComputedName extends ClassMethodDefinitionNonComputedNameBase {
type: AST_NODE_TYPES.MethodDefinition; type: AST_NODE_TYPES.MethodDefinition;
} }
declare interface MethodDefinitionNonComputedNameBase extends MethodDefinitionBase { declare interface MethodDefinitionNonComputedNameBase extends MethodDefinitionBase {
@@ -654,10 +624,13 @@ export declare interface NewExpression extends BaseNode {
arguments: Expression[]; arguments: Expression[];
typeParameters?: TSTypeParameterInstantiation; typeParameters?: TSTypeParameterInstantiation;
} }
export declare type Node = ArrayExpression | ArrayPattern | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BinaryExpression | BlockStatement | BreakStatement | CallExpression | CatchClause | ChainExpression | ClassBody | ClassDeclaration | ClassExpression | ClassProperty | ConditionalExpression | ContinueStatement | DebuggerStatement | Decorator | DoWhileStatement | EmptyStatement | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | ImportDeclaration | ImportDefaultSpecifier | ImportExpression | ImportNamespaceSpecifier | ImportSpecifier | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LabeledStatement | Literal | LogicalExpression | MemberExpression | MetaProperty | MethodDefinition | NewExpression | ObjectExpression | ObjectPattern | Program | Property | RestElement | ReturnStatement | SequenceExpression | SpreadElement | Super | SwitchCase | SwitchStatement | TaggedTemplateExpression | TemplateElement | TemplateLiteral | ThisExpression | ThrowStatement | TryStatement | TSAbstractClassProperty | TSAbstractKeyword | TSAbstractMethodDefinition | TSAnyKeyword | TSArrayType | TSAsExpression | TSAsyncKeyword | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSClassImplements | TSConditionalType | TSConstructorType | TSConstructSignatureDeclaration | TSDeclareFunction | TSDeclareKeyword | TSEmptyBodyFunctionExpression | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExportKeyword | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexedAccessType | TSIndexSignature | TSInferType | TSInterfaceBody | TSInterfaceDeclaration | TSInterfaceHeritage | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPrivateKeyword | TSPropertySignature | TSProtectedKeyword | TSPublicKeyword | TSQualifiedName | TSReadonlyKeyword | TSRestType | TSStaticKeyword | TSStringKeyword | TSSymbolKeyword | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | UnaryExpression | UpdateExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | YieldExpression; export declare type Node = ArrayExpression | ArrayPattern | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BinaryExpression | BlockStatement | BreakStatement | CallExpression | CatchClause | ChainExpression | ClassBody | ClassDeclaration | ClassExpression | ConditionalExpression | ContinueStatement | DebuggerStatement | Decorator | DoWhileStatement | EmptyStatement | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | ImportDeclaration | ImportDefaultSpecifier | ImportExpression | ImportNamespaceSpecifier | ImportSpecifier | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LabeledStatement | Literal | LogicalExpression | MemberExpression | MetaProperty | MethodDefinition | NewExpression | ObjectExpression | ObjectPattern | PrivateIdentifier | Program | Property | PropertyDefinition | RestElement | ReturnStatement | SequenceExpression | SpreadElement | StaticBlock | Super | SwitchCase | SwitchStatement | TaggedTemplateExpression | TemplateElement | TemplateLiteral | ThisExpression | ThrowStatement | TryStatement | TSAbstractKeyword | TSAbstractMethodDefinition | TSAbstractPropertyDefinition | TSAnyKeyword | TSArrayType | TSAsExpression | TSAsyncKeyword | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSClassImplements | TSConditionalType | TSConstructorType | TSConstructSignatureDeclaration | TSDeclareFunction | TSDeclareKeyword | TSEmptyBodyFunctionExpression | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExportKeyword | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexedAccessType | TSIndexSignature | TSInferType | TSInterfaceBody | TSInterfaceDeclaration | TSInterfaceHeritage | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSPrivateKeyword | TSPropertySignature | TSProtectedKeyword | TSPublicKeyword | TSQualifiedName | TSReadonlyKeyword | TSRestType | TSStaticKeyword | TSStringKeyword | TSSymbolKeyword | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | UnaryExpression | UpdateExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | YieldExpression;
declare interface NodeOrTokenData { declare interface NodeOrTokenData {
/** /**
* The source location information of the node. * The source location information of the node.
*
* The loc property is defined as nullable by ESTree, but ESLint requires this property.
*
* @see {SourceLocation} * @see {SourceLocation}
*/ */
loc: SourceLocation; loc: SourceLocation;
@@ -668,7 +641,6 @@ declare interface NodeOrTokenData {
type: string; type: string;
} }
export declare interface NullLiteral extends LiteralBase { export declare interface NullLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: null; value: null;
raw: 'null'; raw: 'null';
} }
@@ -676,7 +648,6 @@ export declare interface NullToken extends BaseToken {
type: AST_TOKEN_TYPES.Null; type: AST_TOKEN_TYPES.Null;
} }
export declare interface NumberLiteral extends LiteralBase { export declare interface NumberLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: number; value: number;
} }
export declare interface NumericToken extends BaseToken { export declare interface NumericToken extends BaseToken {
@@ -700,7 +671,21 @@ export declare type OptionalRangeAndLoc<T> = Pick<T, Exclude<keyof T, 'loc' | 'r
loc?: SourceLocation; loc?: SourceLocation;
}; };
export declare type Parameter = ArrayPattern | AssignmentPattern | Identifier | ObjectPattern | RestElement | TSParameterProperty; export declare type Parameter = ArrayPattern | AssignmentPattern | Identifier | ObjectPattern | RestElement | TSParameterProperty;
export declare interface Position {
/**
* Line number (1-indexed)
*/
line: number;
/**
* Column number on the line (0-indexed)
*/
column: number;
}
export declare type PrimaryExpression = ArrayExpression | ArrayPattern | ClassExpression | FunctionExpression | Identifier | JSXElement | JSXFragment | JSXOpeningElement | LiteralExpression | MetaProperty | ObjectExpression | ObjectPattern | Super | TemplateLiteral | ThisExpression | TSNullKeyword; export declare type PrimaryExpression = ArrayExpression | ArrayPattern | ClassExpression | FunctionExpression | Identifier | JSXElement | JSXFragment | JSXOpeningElement | LiteralExpression | MetaProperty | ObjectExpression | ObjectPattern | Super | TemplateLiteral | ThisExpression | TSNullKeyword;
export declare interface PrivateIdentifier extends BaseNode {
type: AST_NODE_TYPES.PrivateIdentifier;
name: string;
}
export declare interface Program extends BaseNode { export declare interface Program extends BaseNode {
type: AST_NODE_TYPES.Program; type: AST_NODE_TYPES.Program;
body: ProgramStatement[]; body: ProgramStatement[];
@@ -724,7 +709,36 @@ export declare interface PropertyComputedName extends PropertyBase {
key: PropertyNameComputed; key: PropertyNameComputed;
computed: true; computed: true;
} }
export declare type PropertyName = PropertyNameComputed | PropertyNameNonComputed; export declare type PropertyDefinition = PropertyDefinitionComputedName | PropertyDefinitionNonComputedName;
declare interface PropertyDefinitionBase extends BaseNode {
key: PropertyName;
value: Expression | null;
computed: boolean;
static: boolean;
declare: boolean;
readonly?: boolean;
decorators?: Decorator[];
accessibility?: Accessibility;
optional?: boolean;
definite?: boolean;
typeAnnotation?: TSTypeAnnotation;
override?: boolean;
}
export declare interface PropertyDefinitionComputedName extends PropertyDefinitionComputedNameBase {
type: AST_NODE_TYPES.PropertyDefinition;
}
declare interface PropertyDefinitionComputedNameBase extends PropertyDefinitionBase {
key: PropertyNameComputed;
computed: true;
}
export declare interface PropertyDefinitionNonComputedName extends ClassPropertyDefinitionNonComputedNameBase {
type: AST_NODE_TYPES.PropertyDefinition;
}
declare interface PropertyDefinitionNonComputedNameBase extends PropertyDefinitionBase {
key: PropertyNameNonComputed;
computed: false;
}
export declare type PropertyName = ClassPropertyNameNonComputed | PropertyNameComputed | PropertyNameNonComputed;
export declare type PropertyNameComputed = Expression; export declare type PropertyNameComputed = Expression;
export declare type PropertyNameNonComputed = Identifier | NumberLiteral | StringLiteral; export declare type PropertyNameNonComputed = Identifier | NumberLiteral | StringLiteral;
export declare interface PropertyNonComputedName extends PropertyBase { export declare interface PropertyNonComputedName extends PropertyBase {
@@ -780,6 +794,7 @@ export declare interface PunctuatorTokenToText {
[SyntaxKind.AtToken]: '@'; [SyntaxKind.AtToken]: '@';
[SyntaxKind.QuestionQuestionToken]: '??'; [SyntaxKind.QuestionQuestionToken]: '??';
[SyntaxKind.BacktickToken]: '`'; [SyntaxKind.BacktickToken]: '`';
[SyntaxKind.HashToken]: '#';
[SyntaxKind.EqualsToken]: '='; [SyntaxKind.EqualsToken]: '=';
[SyntaxKind.PlusEqualsToken]: '+='; [SyntaxKind.PlusEqualsToken]: '+=';
[SyntaxKind.MinusEqualsToken]: '-='; [SyntaxKind.MinusEqualsToken]: '-=';
@@ -804,7 +819,6 @@ export declare interface PunctuatorTokenToText {
*/ */
export declare type Range = [number, number]; export declare type Range = [number, number];
export declare interface RegExpLiteral extends LiteralBase { export declare interface RegExpLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: RegExp | null; value: RegExp | null;
regex: { regex: {
pattern: string; pattern: string;
@@ -838,19 +852,22 @@ export declare interface SourceLocation {
/** /**
* The position of the first character of the parsed source region * The position of the first character of the parsed source region
*/ */
start: LineAndColumnData; start: Position;
/** /**
* The position of the first character after the parsed source region * The position of the first character after the parsed source region
*/ */
end: LineAndColumnData; end: Position;
} }
export declare interface SpreadElement extends BaseNode { export declare interface SpreadElement extends BaseNode {
type: AST_NODE_TYPES.SpreadElement; type: AST_NODE_TYPES.SpreadElement;
argument: Expression; argument: Expression;
} }
export declare type Statement = BlockStatement | BreakStatement | ClassDeclaration | ContinueStatement | DebuggerStatement | DoWhileStatement | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | IfStatement | ImportDeclaration | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | TSDeclareFunction | TSEnumDeclaration | TSExportAssignment | TSImportEqualsDeclaration | TSInterfaceDeclaration | TSModuleDeclaration | TSNamespaceExportDeclaration | TSTypeAliasDeclaration | VariableDeclaration | WhileStatement | WithStatement; export declare type Statement = BlockStatement | BreakStatement | ClassDeclaration | ContinueStatement | DebuggerStatement | DoWhileStatement | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | IfStatement | ImportDeclaration | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | TSDeclareFunction | TSEnumDeclaration | TSExportAssignment | TSImportEqualsDeclaration | TSInterfaceDeclaration | TSModuleDeclaration | TSNamespaceExportDeclaration | TSTypeAliasDeclaration | VariableDeclaration | WhileStatement | WithStatement;
export declare interface StaticBlock extends BaseNode {
type: AST_NODE_TYPES.StaticBlock;
body: Statement[];
}
export declare interface StringLiteral extends LiteralBase { export declare interface StringLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: string; value: string;
} }
export declare interface StringToken extends BaseToken { export declare interface StringToken extends BaseToken {
@@ -905,13 +922,6 @@ export declare interface TryStatement extends BaseNode {
handler: CatchClause | null; handler: CatchClause | null;
finalizer: BlockStatement | null; finalizer: BlockStatement | null;
} }
export declare type TSAbstractClassProperty = TSAbstractClassPropertyComputedName | TSAbstractClassPropertyNonComputedName;
export declare interface TSAbstractClassPropertyComputedName extends ClassPropertyComputedNameBase {
type: AST_NODE_TYPES.TSAbstractClassProperty;
}
export declare interface TSAbstractClassPropertyNonComputedName extends ClassPropertyNonComputedNameBase {
type: AST_NODE_TYPES.TSAbstractClassProperty;
}
export declare interface TSAbstractKeyword extends BaseNode { export declare interface TSAbstractKeyword extends BaseNode {
type: AST_NODE_TYPES.TSAbstractKeyword; type: AST_NODE_TYPES.TSAbstractKeyword;
} }
@@ -922,6 +932,15 @@ export declare interface TSAbstractMethodDefinitionComputedName extends MethodDe
export declare interface TSAbstractMethodDefinitionNonComputedName extends MethodDefinitionNonComputedNameBase { export declare interface TSAbstractMethodDefinitionNonComputedName extends MethodDefinitionNonComputedNameBase {
type: AST_NODE_TYPES.TSAbstractMethodDefinition; type: AST_NODE_TYPES.TSAbstractMethodDefinition;
} }
export declare type TSAbstractPropertyDefinition = TSAbstractPropertyDefinitionComputedName | TSAbstractPropertyDefinitionNonComputedName;
export declare interface TSAbstractPropertyDefinitionComputedName extends PropertyDefinitionComputedNameBase {
type: AST_NODE_TYPES.TSAbstractPropertyDefinition;
value: null;
}
export declare interface TSAbstractPropertyDefinitionNonComputedName extends PropertyDefinitionNonComputedNameBase {
type: AST_NODE_TYPES.TSAbstractPropertyDefinition;
value: null;
}
export declare interface TSAnyKeyword extends BaseNode { export declare interface TSAnyKeyword extends BaseNode {
type: AST_NODE_TYPES.TSAnyKeyword; type: AST_NODE_TYPES.TSAnyKeyword;
} }
@@ -1173,10 +1192,6 @@ export declare interface TSParameterProperty extends BaseNode {
parameter: AssignmentPattern | BindingName | RestElement; parameter: AssignmentPattern | BindingName | RestElement;
decorators?: Decorator[]; decorators?: Decorator[];
} }
export declare interface TSParenthesizedType extends BaseNode {
type: AST_NODE_TYPES.TSParenthesizedType;
typeAnnotation: TypeNode;
}
export declare interface TSPrivateKeyword extends BaseNode { export declare interface TSPrivateKeyword extends BaseNode {
type: AST_NODE_TYPES.TSPrivateKeyword; type: AST_NODE_TYPES.TSPrivateKeyword;
} }
@@ -1309,7 +1324,7 @@ export declare interface TSVoidKeyword extends BaseNode {
type: AST_NODE_TYPES.TSVoidKeyword; type: AST_NODE_TYPES.TSVoidKeyword;
} }
export declare type TypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSIndexSignature | TSMethodSignature | TSPropertySignature; export declare type TypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSIndexSignature | TSMethodSignature | TSPropertySignature;
export declare type TypeNode = TSAnyKeyword | TSArrayType | TSBigIntKeyword | TSBooleanKeyword | TSConditionalType | TSConstructorType | TSFunctionType | TSImportType | TSIndexedAccessType | TSInferType | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSNamedTupleMember | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParenthesizedType | TSRestType | TSStringKeyword | TSSymbolKeyword | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeLiteral | TSTypeOperator | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword; export declare type TypeNode = TSAnyKeyword | TSArrayType | TSBigIntKeyword | TSBooleanKeyword | TSConditionalType | TSConstructorType | TSFunctionType | TSImportType | TSIndexedAccessType | TSInferType | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSNamedTupleMember | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSRestType | TSStringKeyword | TSSymbolKeyword | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeLiteral | TSTypeOperator | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword;
export declare interface UnaryExpression extends UnaryExpressionBase { export declare interface UnaryExpression extends UnaryExpressionBase {
type: AST_NODE_TYPES.UnaryExpression; type: AST_NODE_TYPES.UnaryExpression;
operator: '-' | '!' | '+' | '~' | 'delete' | 'typeof' | 'void'; operator: '-' | '!' | '+' | '~' | 'delete' | 'typeof' | 'void';

File diff suppressed because one or more lines are too long

View File

@@ -27,7 +27,6 @@ var AST_NODE_TYPES;
AST_NODE_TYPES["ClassBody"] = "ClassBody"; AST_NODE_TYPES["ClassBody"] = "ClassBody";
AST_NODE_TYPES["ClassDeclaration"] = "ClassDeclaration"; AST_NODE_TYPES["ClassDeclaration"] = "ClassDeclaration";
AST_NODE_TYPES["ClassExpression"] = "ClassExpression"; AST_NODE_TYPES["ClassExpression"] = "ClassExpression";
AST_NODE_TYPES["ClassProperty"] = "ClassProperty";
AST_NODE_TYPES["ConditionalExpression"] = "ConditionalExpression"; AST_NODE_TYPES["ConditionalExpression"] = "ConditionalExpression";
AST_NODE_TYPES["ContinueStatement"] = "ContinueStatement"; AST_NODE_TYPES["ContinueStatement"] = "ContinueStatement";
AST_NODE_TYPES["DebuggerStatement"] = "DebuggerStatement"; AST_NODE_TYPES["DebuggerStatement"] = "DebuggerStatement";
@@ -75,12 +74,15 @@ var AST_NODE_TYPES;
AST_NODE_TYPES["NewExpression"] = "NewExpression"; AST_NODE_TYPES["NewExpression"] = "NewExpression";
AST_NODE_TYPES["ObjectExpression"] = "ObjectExpression"; AST_NODE_TYPES["ObjectExpression"] = "ObjectExpression";
AST_NODE_TYPES["ObjectPattern"] = "ObjectPattern"; AST_NODE_TYPES["ObjectPattern"] = "ObjectPattern";
AST_NODE_TYPES["PrivateIdentifier"] = "PrivateIdentifier";
AST_NODE_TYPES["Program"] = "Program"; AST_NODE_TYPES["Program"] = "Program";
AST_NODE_TYPES["Property"] = "Property"; AST_NODE_TYPES["Property"] = "Property";
AST_NODE_TYPES["PropertyDefinition"] = "PropertyDefinition";
AST_NODE_TYPES["RestElement"] = "RestElement"; AST_NODE_TYPES["RestElement"] = "RestElement";
AST_NODE_TYPES["ReturnStatement"] = "ReturnStatement"; AST_NODE_TYPES["ReturnStatement"] = "ReturnStatement";
AST_NODE_TYPES["SequenceExpression"] = "SequenceExpression"; AST_NODE_TYPES["SequenceExpression"] = "SequenceExpression";
AST_NODE_TYPES["SpreadElement"] = "SpreadElement"; AST_NODE_TYPES["SpreadElement"] = "SpreadElement";
AST_NODE_TYPES["StaticBlock"] = "StaticBlock";
AST_NODE_TYPES["Super"] = "Super"; AST_NODE_TYPES["Super"] = "Super";
AST_NODE_TYPES["SwitchCase"] = "SwitchCase"; AST_NODE_TYPES["SwitchCase"] = "SwitchCase";
AST_NODE_TYPES["SwitchStatement"] = "SwitchStatement"; AST_NODE_TYPES["SwitchStatement"] = "SwitchStatement";
@@ -100,9 +102,9 @@ var AST_NODE_TYPES;
/** /**
* TS-prefixed nodes * TS-prefixed nodes
*/ */
AST_NODE_TYPES["TSAbstractClassProperty"] = "TSAbstractClassProperty";
AST_NODE_TYPES["TSAbstractKeyword"] = "TSAbstractKeyword"; AST_NODE_TYPES["TSAbstractKeyword"] = "TSAbstractKeyword";
AST_NODE_TYPES["TSAbstractMethodDefinition"] = "TSAbstractMethodDefinition"; AST_NODE_TYPES["TSAbstractMethodDefinition"] = "TSAbstractMethodDefinition";
AST_NODE_TYPES["TSAbstractPropertyDefinition"] = "TSAbstractPropertyDefinition";
AST_NODE_TYPES["TSAnyKeyword"] = "TSAnyKeyword"; AST_NODE_TYPES["TSAnyKeyword"] = "TSAnyKeyword";
AST_NODE_TYPES["TSArrayType"] = "TSArrayType"; AST_NODE_TYPES["TSArrayType"] = "TSArrayType";
AST_NODE_TYPES["TSAsExpression"] = "TSAsExpression"; AST_NODE_TYPES["TSAsExpression"] = "TSAsExpression";
@@ -147,7 +149,6 @@ var AST_NODE_TYPES;
AST_NODE_TYPES["TSObjectKeyword"] = "TSObjectKeyword"; AST_NODE_TYPES["TSObjectKeyword"] = "TSObjectKeyword";
AST_NODE_TYPES["TSOptionalType"] = "TSOptionalType"; AST_NODE_TYPES["TSOptionalType"] = "TSOptionalType";
AST_NODE_TYPES["TSParameterProperty"] = "TSParameterProperty"; AST_NODE_TYPES["TSParameterProperty"] = "TSParameterProperty";
AST_NODE_TYPES["TSParenthesizedType"] = "TSParenthesizedType";
AST_NODE_TYPES["TSPrivateKeyword"] = "TSPrivateKeyword"; AST_NODE_TYPES["TSPrivateKeyword"] = "TSPrivateKeyword";
AST_NODE_TYPES["TSPropertySignature"] = "TSPropertySignature"; AST_NODE_TYPES["TSPropertySignature"] = "TSPropertySignature";
AST_NODE_TYPES["TSProtectedKeyword"] = "TSProtectedKeyword"; AST_NODE_TYPES["TSProtectedKeyword"] = "TSProtectedKeyword";

View File

@@ -1 +1 @@
{"version":3,"file":"ast-spec.js","sourceRoot":"","sources":["../src/ast-spec.ts"],"names":[],"mappings":";AAAA;;;;;;;;gDAQgD;;;AA6DhD,IAAY,cAqKX;AArKD,WAAY,cAAc;IACxB,qDAAmC,CAAA;IACnC,+CAA6B,CAAA;IAC7B,qEAAmD,CAAA;IACnD,+DAA6C,CAAA;IAC7C,yDAAuC,CAAA;IACvC,qDAAmC,CAAA;IACnC,uDAAqC,CAAA;IACrC,mDAAiC,CAAA;IACjC,mDAAiC,CAAA;IACjC,mDAAiC,CAAA;IACjC,6CAA2B,CAAA;IAC3B,qDAAmC,CAAA;IACnC,yCAAuB,CAAA;IACvB,uDAAqC,CAAA;IACrC,qDAAmC,CAAA;IACnC,iDAA+B,CAAA;IAC/B,iEAA+C,CAAA;IAC/C,yDAAuC,CAAA;IACvC,yDAAuC,CAAA;IACvC,yCAAuB,CAAA;IACvB,uDAAqC,CAAA;IACrC,mDAAiC,CAAA;IACjC,+DAA6C,CAAA;IAC7C,uEAAqD,CAAA;IACrD,mEAAiD,CAAA;IACjD,qDAAmC,CAAA;IACnC,6DAA2C,CAAA;IAC3C,mDAAiC,CAAA;IACjC,mDAAiC,CAAA;IACjC,+CAA6B,CAAA;IAC7B,6DAA2C,CAAA;IAC3C,2DAAyC,CAAA;IACzC,2CAAyB,CAAA;IACzB,6CAA2B,CAAA;IAC3B,yDAAuC,CAAA;IACvC,mEAAiD,CAAA;IACjD,uDAAqC,CAAA;IACrC,uEAAqD,CAAA;IACrD,qDAAmC,CAAA;IACnC,+CAA6B,CAAA;IAC7B,yDAAuC,CAAA;IACvC,2DAAyC,CAAA;IACzC,2CAAyB,CAAA;IACzB,2DAAyC,CAAA;IACzC,mEAAiD,CAAA;IACjD,6CAA2B,CAAA;IAC3B,iDAA+B,CAAA;IAC/B,6DAA2C,CAAA;IAC3C,yDAAuC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AAA;IAC3B,qDAAmC,CAAA;IACnC,2DAAyC,CAAA;IACzC,6CAA2B,CAAA;IAC3B,uDAAqC,CAAA;IACrC,iDAA+B,CAAA;AACjC,CAAC,EAtKW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAsKzB;AAED,IAAY,eAcX;AAdD,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,4CAAyB,CAAA;IACzB,kDAA+B,CAAA;IAC/B,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,gCAAa,CAAA;IACb,sCAAmB,CAAA;IACnB,4CAAyB,CAAA;IACzB,0DAAuC,CAAA;IACvC,oCAAiB,CAAA;IACjB,wCAAqB,CAAA;IACrB,kCAAe,CAAA;IACf,gCAAa,CAAA;AACf,CAAC,EAdW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAc1B"}

View File

@@ -1,14 +1,14 @@
import { Lib } from './lib'; import { Lib } from './lib';
import type { Program } from 'typescript'; import type { Program } from 'typescript';
declare type DebugLevel = boolean | ('typescript-eslint' | 'eslint' | 'typescript')[]; declare type DebugLevel = boolean | ('typescript-eslint' | 'eslint' | 'typescript')[];
declare type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020; declare type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022;
declare type SourceType = 'script' | 'module'; declare type SourceType = 'script' | 'module';
interface ParserOptions { interface ParserOptions {
ecmaFeatures?: { ecmaFeatures?: {
globalReturn?: boolean; globalReturn?: boolean;
jsx?: boolean; jsx?: boolean;
}; };
ecmaVersion?: EcmaVersion; ecmaVersion?: EcmaVersion | 'latest';
jsxPragma?: string | null; jsxPragma?: string | null;
jsxFragmentName?: string | null; jsxFragmentName?: string | null;
lib?: Lib[]; lib?: Lib[];

View File

@@ -1 +1 @@
{"version":3,"file":"parser-options.d.ts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,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,2CAA2C,CAAC,EAAE,OAAO,CAAC;IACtD,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gDAAgD,CAAC,EAAE,OAAO,CAAC;IAC3D,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,uBAAuB,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC"}

View File

@@ -1,6 +1,6 @@
{ {
"name": "@typescript-eslint/types", "name": "@typescript-eslint/types",
"version": "4.29.2", "version": "5.0.0",
"description": "Types for the TypeScript-ESTree AST spec", "description": "Types for the TypeScript-ESTree AST spec",
"keywords": [ "keywords": [
"eslint", "eslint",
@@ -8,7 +8,7 @@
"estree" "estree"
], ],
"engines": { "engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}, },
"files": [ "files": [
"dist", "dist",
@@ -52,5 +52,5 @@
"devDependencies": { "devDependencies": {
"typescript": "*" "typescript": "*"
}, },
"gitHead": "bf402f4a04397943ca916c8333186f539986a247" "gitHead": "101abc72f0baced5cdf609d99418ad9f10830c73"
} }

Some files were not shown because too many files have changed in this diff Show More