Compare commits

...

57 Commits

Author SHA1 Message Date
Chuan-kai Lin
e891551dd4 Merge pull request #799 from github/update-v1.0.21-a53b8d0e
Merge main into v1
2021-10-28 14:18:14 -07:00
github-actions[bot]
bd48dc5be5 1.0.21 2021-10-28 20:46:17 +00:00
Chuan-kai Lin
a53b8d0ed1 Merge pull request #795 from github/cklin/codeql-cli-2.7.0-update
Update CodeQL bundle to 20211025 / 2.7.0
2021-10-25 14:10:10 -07:00
Chuan-kai Lin
22747bcb77 Update CodeQL bundle to 20211025 / 2.7.0 2021-10-25 13:45:26 -07:00
Edoardo Pirovano
503f29874a Merge pull request #793 from github/mergeback/v1.0.20-to-main-e86ea38e
Mergeback v1.0.20 refs/heads/v1 into main
2021-10-25 19:31:43 +01:00
github-actions[bot]
c3b8b48b76 Update checked-in dependencies 2021-10-25 18:15:07 +00:00
Edoardo Pirovano
eae8bacaeb Merge branch 'main' into mergeback/v1.0.20-to-main-e86ea38e 2021-10-25 19:12:04 +01:00
Edoardo Pirovano
c226132b0b Merge pull request #794 from edoardopirovano/fix-update-deps
Further fix to update dependencies workflow
2021-10-25 18:30:44 +01:00
Edoardo Pirovano
d3f5d485b3 Further fix to update dependencies workflow 2021-10-25 18:09:40 +01:00
github-actions[bot]
4647e20bb5 1.0.21 2021-10-25 16:50:12 +00:00
github-actions[bot]
1a3e71aa9a Update changelog and version after v1.0.20 2021-10-25 16:50:10 +00:00
Edoardo Pirovano
e86ea38e3f Merge pull request #791 from github/update-v1.0.20-c89d9bd8
Merge main into v1
2021-10-25 17:48:58 +01:00
Aditya Sharad
968c038839 Merge pull request #777 from github/adityasharad/upload-sarif-limits
upload-sarif: Link to docs on upload limits
2021-10-25 09:24:07 -07:00
Aditya Sharad
86fea52924 Merge branch 'main' into adityasharad/upload-sarif-limits 2021-10-25 08:54:15 -07:00
github-actions[bot]
0499230710 1.0.20 2021-10-25 09:02:27 +00:00
Aditya Sharad
c89d9bd8b0 Merge pull request #790 from edoardopirovano/fix-workflow
Fix syntax in a workflow
2021-10-22 09:51:17 -07:00
Edoardo Pirovano
63fd41bf33 Fix syntax in a workflow 2021-10-22 17:40:41 +01:00
Edoardo Pirovano
a35be9cc60 Merge pull request #784 from github/aeisenberg/workflow-fix
Fix failing workflow on main
2021-10-22 11:52:48 +01:00
Edoardo Pirovano
0ebee75b04 Merge pull request #789 from edoardopirovano/secure-workflow
Improve workflow to update dependencies
2021-10-22 11:03:09 +01:00
Edoardo Pirovano
70f007a73c Improve workflow to update dependencies 2021-10-22 10:43:31 +01:00
Andrew Eisenberg
1beeda3ba3 Fix failing workflow on main
We do not want this database uploaded for remote queries.
2021-10-21 11:04:28 -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
Aditya Sharad
73f3a24896 upload-sarif: Link to docs on upload limits 2021-10-14 12:17:06 -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
784 changed files with 23889 additions and 584 deletions

View File

@@ -60,6 +60,7 @@ jobs:
- uses: ./../action/analyze
with:
output: ${{ runner.temp }}/results
upload-database: false
env:
TEST_MODE: true
- name: Assert Results

View File

@@ -58,7 +58,7 @@ jobs:
- name: Verify packages installed
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
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
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Initialize CodeQL
uses: ./init
with:
@@ -149,5 +153,5 @@ jobs:
- name: Verify packages installed
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

View File

@@ -7,7 +7,7 @@ jobs:
update:
name: Update dependencies
runs-on: macos-latest
if: contains(github.event.pull_request.labels.*.name, 'Update dependencies')
if: contains(github.event.pull_request.labels.*.name, 'Update dependencies') && (github.event.pull_request.head.repo.full_name == 'github/codeql-action')
steps:
- name: Checkout repository
uses: actions/checkout@v2
@@ -24,8 +24,8 @@ jobs:
env:
BRANCH: '${{ github.head_ref }}'
run: |
git fetch
git checkout $BRANCH
git fetch origin "$BRANCH" --depth=1
git checkout "origin/$BRANCH"
sudo npm install --force -g npm@latest
npm install
npm ci
@@ -35,5 +35,5 @@ jobs:
git config --global user.name "github-actions[bot]"
git add node_modules
git commit -am "Update checked-in dependencies"
git push origin "$BRANCH"
git push origin "HEAD:$BRANCH"
fi

View File

@@ -1,9 +1,25 @@
# CodeQL Action and CodeQL Runner Changelog
## [UNRELEASED]
## 1.0.21 - 28 Oct 2021
- Update default CodeQL bundle version to 2.7.0. [#795](https://github.com/github/codeql-action/pull/795)
## 1.0.20 - 25 Oct 2021
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.

19
lib/codeql.js generated
View File

@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getExtraOptions = exports.getCachedCodeQL = exports.setCodeQL = exports.getCodeQL = exports.convertToSemVer = exports.getCodeQLURLVersion = exports.setupCodeQL = exports.getCodeQLActionRepository = exports.CODEQL_VERSION_COUNTS_LINES = exports.CODEQL_VERSION_NEW_TRACING = 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 path = __importStar(require("path"));
const toolrunner = __importStar(require("@actions/exec/lib/toolrunner"));
@@ -71,8 +71,23 @@ const CODEQL_VERSION_DIAGNOSTICS = "2.5.6";
const CODEQL_VERSION_METRICS = "2.5.5";
const CODEQL_VERSION_GROUP_RULES = "2.5.5";
const CODEQL_VERSION_SARIF_GROUP = "2.5.3";
exports.CODEQL_VERSION_NEW_TRACING = "2.6.0"; // Use multi-language (>= 2.5.6) and indirect (>= 2.6.0) tracing.
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() {
let platform;
if (process.platform === "win32") {

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,3 @@
{
"bundleVersion": "codeql-bundle-20210921"
"bundleVersion": "codeql-bundle-20211025"
}

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

@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "1.0.17",
"version": "1.0.21",
"lockfileVersion": 2,
"requires": true,
"packages": {
@@ -676,25 +676,25 @@
}
},
"node_modules/@typescript-eslint/parser": {
"version": "4.29.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.29.2.tgz",
"integrity": "sha512-WQ6BPf+lNuwteUuyk1jD/aHKqMQ9jrdCn7Gxt9vvBnzbpj7aWEf+aZsJ1zvTjx5zFxGCt000lsbD9tQPEL8u6g==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.0.0.tgz",
"integrity": "sha512-B6D5rmmQ14I1fdzs71eL3DAuvnPHTY/t7rQABrL9BLnx/H51Un8ox1xqYAchs0/V2trcoyxB1lMJLlrwrJCDgw==",
"dev": true,
"dependencies": {
"@typescript-eslint/scope-manager": "4.29.2",
"@typescript-eslint/types": "4.29.2",
"@typescript-eslint/typescript-estree": "4.29.2",
"@typescript-eslint/scope-manager": "5.0.0",
"@typescript-eslint/types": "5.0.0",
"@typescript-eslint/typescript-estree": "5.0.0",
"debug": "^4.3.1"
},
"engines": {
"node": "^10.12.0 || >=12.0.0"
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"eslint": "^5.0.0 || ^6.0.0 || ^7.0.0"
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
},
"peerDependenciesMeta": {
"typescript": {
@@ -703,16 +703,16 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": {
"version": "4.29.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.29.2.tgz",
"integrity": "sha512-mfHmvlQxmfkU8D55CkZO2sQOueTxLqGvzV+mG6S/6fIunDiD2ouwsAoiYCZYDDK73QCibYjIZmGhpvKwAB5BOA==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.0.0.tgz",
"integrity": "sha512-5RFjdA/ain/MDUHYXdF173btOKncIrLuBmA9s6FJhzDrRAyVSA+70BHg0/MW6TE+UiKVyRtX91XpVS0gVNwVDQ==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "4.29.2",
"@typescript-eslint/visitor-keys": "4.29.2"
"@typescript-eslint/types": "5.0.0",
"@typescript-eslint/visitor-keys": "5.0.0"
},
"engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"type": "opencollective",
@@ -720,12 +720,12 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": {
"version": "4.29.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.29.2.tgz",
"integrity": "sha512-K6ApnEXId+WTGxqnda8z4LhNMa/pZmbTFkDxEBLQAbhLZL50DjeY0VIDCml/0Y3FlcbqXZrABqrcKxq+n0LwzQ==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.0.0.tgz",
"integrity": "sha512-dU/pKBUpehdEqYuvkojmlv0FtHuZnLXFBn16zsDmlFF3LXkOpkAQ2vrKc3BidIIve9EMH2zfTlxqw9XM0fFN5w==",
"dev": true,
"engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"type": "opencollective",
@@ -733,13 +733,13 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
"version": "4.29.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.29.2.tgz",
"integrity": "sha512-TJ0/hEnYxapYn9SGn3dCnETO0r+MjaxtlWZ2xU+EvytF0g4CqTpZL48SqSNn2hXsPolnewF30pdzR9a5Lj3DNg==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.0.0.tgz",
"integrity": "sha512-V/6w+PPQMhinWKSn+fCiX5jwvd1vRBm7AX7SJQXEGQtwtBvjMPjaU3YTQ1ik2UF1u96X7tsB96HMnulG3eLi9Q==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "4.29.2",
"@typescript-eslint/visitor-keys": "4.29.2",
"@typescript-eslint/types": "5.0.0",
"@typescript-eslint/visitor-keys": "5.0.0",
"debug": "^4.3.1",
"globby": "^11.0.3",
"is-glob": "^4.0.1",
@@ -747,7 +747,7 @@
"tsutils": "^3.21.0"
},
"engines": {
"node": "^10.12.0 || >=12.0.0"
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"type": "opencollective",
@@ -760,22 +760,31 @@
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": {
"version": "4.29.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.29.2.tgz",
"integrity": "sha512-bDgJLQ86oWHJoZ1ai4TZdgXzJxsea3Ee9u9wsTAvjChdj2WLcVsgWYAPeY7RQMn16tKrlQaBnpKv7KBfs4EQag==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.0.0.tgz",
"integrity": "sha512-yRyd2++o/IrJdyHuYMxyFyBhU762MRHQ/bAGQeTnN3pGikfh+nEmM61XTqaDH1XDp53afZ+waXrk0ZvenoZ6xw==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "4.29.2",
"eslint-visitor-keys": "^2.0.0"
"@typescript-eslint/types": "5.0.0",
"eslint-visitor-keys": "^3.0.0"
},
"engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"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": {
"version": "4.28.5",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.28.5.tgz",
@@ -2295,6 +2304,107 @@
"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": {
"version": "1.0.1",
"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.
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)
**Note:** Version bump only for package @typescript-eslint/parser

View File

@@ -53,7 +53,7 @@ interface ParserOptions {
jsx?: boolean;
globalReturn?: boolean;
};
ecmaVersion?: number;
ecmaVersion?: number | 'latest';
jsxPragma?: 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`.
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 year: es2015, es2016, es2017, es2018, es2019, es2020, ...
- A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, ..., or
- 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

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 debug_1 = __importDefault(require("debug"));
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) {
if (typeof value !== 'boolean') {
return fallback;
@@ -73,7 +73,7 @@ function parseForESLint(code, options) {
jsx: validateBoolean(options.ecmaFeatures.jsx),
});
const analyzeOptions = {
ecmaVersion: options.ecmaVersion,
ecmaVersion: options.ecmaVersion === 'latest' ? 1e8 : options.ecmaVersion,
globalReturn: options.ecmaFeatures.globalReturn,
jsxPragma: options.jsxPragma,
jsxFragmentName: options.jsxFragmentName,
@@ -94,7 +94,7 @@ function parseForESLint(code, options) {
if (!warnOnUnsupportedTypeScriptVersion) {
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;
if (services.hasFullTypeInformation) {
// automatically apply the options configured for the program
@@ -126,7 +126,7 @@ function parseForESLint(code, options) {
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 };
}
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,SAAS,eAAe,CACtB,KAA0B,EAC1B,QAAQ,GAAG,KAAK;IAEhB,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;QAC9B,OAAO,QAAQ,CAAC;KACjB;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAC/C,SAAS,MAAM,CAAC,eAAgC;;IAC9C,IAAI,e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 +3,82 @@
All notable changes to this project will be documented in this file.
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)
**Note:** Version bump only for package @typescript-eslint/scope-manager

View File

@@ -39,8 +39,9 @@ interface AnalyzeOptions {
/**
* Which ECMAScript version is considered.
* 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.

View File

@@ -1,5 +1,6 @@
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 { ClassFieldInitializerScope } from './scope/ClassFieldInitializerScope';
import { Variable } from './variable';
interface ScopeManagerOptions {
globalReturn?: boolean;
@@ -50,6 +51,7 @@ declare class ScopeManager {
nestBlockScope(node: BlockScope['block']): BlockScope;
nestCatchScope(node: CatchScope['block']): CatchScope;
nestClassScope(node: ClassScope['block']): ClassScope;
nestClassFieldInitializerScope(node: ClassFieldInitializerScope['block']): ClassFieldInitializerScope;
nestConditionalTypeScope(node: ConditionalTypeScope['block']): ConditionalTypeScope;
nestForScope(node: ForScope['block']): ForScope;
nestFunctionExpressionNameScope(node: FunctionExpressionNameScope['block']): FunctionExpressionNameScope;

View File

@@ -1 +1 @@
{"version":3,"file":"ScopeManager.d.ts","sourceRoot":"","sources":["../src/ScopeManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACR,2BAA2B,EAC3B,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,WAAW,EACX,KAAK,EACL,WAAW,EACX,WAAW,EACX,aAAa,EACb,SAAS,EACT,SAAS,EACV,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,UAAU,mBAAmB;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,cAAM,YAAY;;IACT,YAAY,EAAE,KAAK,GAAG,IAAI,CAAC;IAClC,SAAgB,iBAAiB,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtE;;;OAGG;IACI,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IACvC,SAAgB,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAE7D;;;OAGG;IACH,SAAgB,MAAM,EAAE,KAAK,EAAE,CAAC;IAEhC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O,CAAC,EAC5B,kBAAkB,EAAE,OAAO,GAC1B,aAAa;IAOT,qBAAqB,CAC1B,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAC/B,iBAAiB;IAKb,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,WAAW;IAIxD,mBAAmB,CAAC,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC,GAAG,eAAe;IAKpE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,WAAW;IAKxD,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;
const assert_1 = require("./assert");
const scope_1 = require("./scope");
const ClassFieldInitializerScope_1 = require("./scope/ClassFieldInitializerScope");
class ScopeManager {
constructor(options) {
_ScopeManager_options.set(this, void 0);
@@ -104,73 +105,77 @@ class ScopeManager {
}
nestScope(scope) {
if (scope instanceof scope_1.GlobalScope) {
assert_1.assert(this.currentScope === null);
(0, assert_1.assert)(this.currentScope === null);
this.globalScope = scope;
}
this.currentScope = scope;
return scope;
}
nestBlockScope(node) {
assert_1.assert(this.currentScope);
(0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.BlockScope(this, this.currentScope, 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));
}
nestClassScope(node) {
assert_1.assert(this.currentScope);
(0, assert_1.assert)(this.currentScope);
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) {
assert_1.assert(this.currentScope);
(0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.ConditionalTypeScope(this, this.currentScope, 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));
}
nestFunctionExpressionNameScope(node) {
assert_1.assert(this.currentScope);
(0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.FunctionExpressionNameScope(this, this.currentScope, node));
}
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));
}
nestFunctionTypeScope(node) {
assert_1.assert(this.currentScope);
(0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.FunctionTypeScope(this, this.currentScope, node));
}
nestGlobalScope(node) {
return this.nestScope(new scope_1.GlobalScope(this, 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));
}
nestModuleScope(node) {
assert_1.assert(this.currentScope);
(0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.ModuleScope(this, this.currentScope, 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));
}
nestTSEnumScope(node) {
assert_1.assert(this.currentScope);
(0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.TSEnumScope(this, this.currentScope, 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));
}
nestTypeScope(node) {
assert_1.assert(this.currentScope);
(0, assert_1.assert)(this.currentScope);
return this.nestScope(new scope_1.TypeScope(this, this.currentScope, 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));
}
}

File diff suppressed because one or more lines are too long

View File

@@ -9,8 +9,9 @@ interface AnalyzeOptions {
/**
* Which ECMAScript version is considered.
* 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.
* 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,C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,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC"}

View File

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

View File

@@ -1 +1 @@
{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../src/analyze.ts"],"names":[],"mappings":";;;AACA,kEAA8D;AAC9D,6CAA6D;AAC7D,iDAA8C;AAC9C,+BAA2C;AAmE3C,MAAM,eAAe,GAA6B;IAChD,gBAAgB,EAAE,0BAAW;IAC7B,WAAW,EAAE,IAAI;IACjB,YAAY,EAAE,KAAK;IACnB,aAAa,EAAE,KAAK;IACpB,SAAS,EAAE,OAAO;IAClB,eAAe,EAAE,IAAI;IACrB,GAAG,EAAE,CAAC,QAAQ,CAAC;IACf,UAAU,EAAE,QAAQ;IACpB,qBAAqB,EAAE,KAAK;CAC7B,CAAC;AAEF,SAAS,cAAc,CAAC,OAAgC;IACtD,IAAI,OAAO,IAAI,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,EAAE;QACrD,OAAO,KAAK,CAAC;KACd;IAED,MAAM,IAAI,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,KAAK,IAAI,EAAE,CAAC;IAExB,OAAO,GAAG,IAAI,SAAW,CAAC,CAAC,CAAE,GAAW,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;AAC5E,CAAC;AAED;;GAEG;AACH,SAAS,OAAO,CACd,IAAmB,EACnB,eAAgC;;IAEhC,MAAM,WAAW,GACf,MAAA,eAAe,aAAf,eAAe,uB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DefinitionBase = void 0;
const ID_1 = require("../ID");
const generator = ID_1.createIdGenerator();
const generator = (0, ID_1.createIdGenerator)();
class DefinitionBase {
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;
var DefinitionType;
(function (DefinitionType) {
// eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum
DefinitionType["CatchClause"] = "CatchClause";
DefinitionType["ClassName"] = "ClassName";
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;
visit(node: TSESTree.Node | null | undefined): 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 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 visitType(node: TSESTree.Node | null | undefined): void;
protected visitMetadataType(node: TSESTree.TSTypeAnnotation | null | undefined, withDecorators: boolean): 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 TSAbstractClassProperty(node: TSESTree.TSAbstractClassProperty): void;
protected TSAbstractPropertyDefinition(node: TSESTree.TSAbstractPropertyDefinition): void;
protected TSAbstractMethodDefinition(node: TSESTree.TSAbstractMethodDefinition): void;
protected Identifier(node: TSESTree.Identifier): void;
protected PrivateIdentifier(): void;
}
export { ClassVisitor };
//# 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,IAAI;IASP,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;IAanD,SAAS,CAAC,UAAU,CAClB,IAAI,EAAE,QAAQ,CAAC,gBAAgB,GAAG,QAAQ,CAAC,eAAe,GACzD,IAAI;IAgCP,SAAS,CAAC,kBAAkB,CAC1B,IAAI,EAAE,QAAQ,CAAC,uBAAuB,GAAG,QAAQ,CAAC,aAAa,GAC9D,IAAI;IAWP,SAAS,CAAC,oCAAoC,CAC5C,IAAI,EAAE,QAAQ,CAAC,SAAS,EACxB,cAAc,EAAE,OAAO,GACtB,IAAI;IAUP,SAAS,CAAC,mBAAmB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AAG,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);
__classPrivateFieldGet(this, _ClassVisitor_referencer, "f").close(node);
}
visitClassProperty(node) {
visitPropertyDefinition(node) {
this.visitProperty(node);
/**
* class A {
@@ -185,7 +185,15 @@ class ClassVisitor extends Visitor_1.Visitor {
if (node.computed) {
__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) {
(_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)
this.visitChildren(node);
}
ClassProperty(node) {
this.visitClassProperty(node);
PropertyDefinition(node) {
this.visitPropertyDefinition(node);
}
MethodDefinition(node) {
this.visitMethod(node);
}
TSAbstractClassProperty(node) {
this.visitClassProperty(node);
TSAbstractPropertyDefinition(node) {
this.visitPropertyDefinition(node);
}
TSAbstractMethodDefinition(node) {
this.visitProperty(node);
@@ -265,6 +273,9 @@ class ClassVisitor extends Visitor_1.Visitor {
Identifier(node) {
__classPrivateFieldGet(this, _ClassVisitor_referencer, "f").visit(node);
}
PrivateIdentifier() {
// intentionally skip
}
}
exports.ClassVisitor = ClassVisitor;
_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 = {}));
exports.ReferenceFlag = ReferenceFlag;
const generator = ID_1.createIdGenerator();
const generator = (0, ID_1.createIdGenerator)();
var ReferenceTypeFlag;
(function (ReferenceTypeFlag) {
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,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AS,IAAI,MAAA,CAAC;QAElB,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;YAClB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;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 MetaProperty(): void;
protected NewExpression(node: TSESTree.NewExpression): void;
protected PrivateIdentifier(): void;
protected Program(node: TSESTree.Program): void;
protected Property(node: TSESTree.Property): 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,kBAAkB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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) {
if (!dontThrowOnNull) {
assert_1.assert(this.scopeManager.currentScope, 'aaa');
(0, assert_1.assert)(this.scopeManager.currentScope, 'aaa');
}
return this.scopeManager.currentScope;
}
@@ -329,7 +329,7 @@ class Referencer extends Visitor_1.Visitor {
this.visitType(node.typeAnnotation);
}
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);
}
JSXAttribute(node) {
@@ -384,6 +384,9 @@ class Referencer extends Visitor_1.Visitor {
this.visitChildren(node, ['typeParameters']);
this.visitType(node.typeParameters);
}
PrivateIdentifier() {
// private identifiers are members on classes and thus have no variables to to reference
}
Program(node) {
const globalScope = this.scopeManager.nestGlobalScope(node);
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);
}
close(scopeManager) {
assert_1.assert(this.leftToResolve);
(0, assert_1.assert)(this.leftToResolve);
for (const ref of this.leftToResolve) {
if (ref.maybeImplicitGlobal && !this.set.has(ref.identifier.name)) {
// 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,QAA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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 { CatchScope } from './CatchScope';
import { ClassFieldInitializerScope } from './ClassFieldInitializerScope';
import { ClassScope } from './ClassScope';
import { ConditionalTypeScope } from './ConditionalTypeScope';
import { ForScope } from './ForScope';
@@ -14,6 +15,6 @@ import { TSEnumScope } from './TSEnumScope';
import { TSModuleScope } from './TSModuleScope';
import { TypeScope } from './TypeScope';
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 };
//# 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,CAA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,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]);
}
}
const generator = ID_1.createIdGenerator();
const generator = (0, ID_1.createIdGenerator)();
const VARIABLE_SCOPE_TYPES = new Set([
ScopeType_1.ScopeType.global,
ScopeType_1.ScopeType.classFieldInitializer,
ScopeType_1.ScopeType.function,
ScopeType_1.ScopeType.global,
ScopeType_1.ScopeType.module,
ScopeType_1.ScopeType.tsModule,
]);
@@ -280,7 +281,7 @@ class ScopeBase {
closeRef = __classPrivateFieldGet(this, _ScopeBase_globalCloseRef, "f");
}
// 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) {
const ref = this.leftToResolve[i];
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",
catch = "catch",
class = "class",
classFieldInitializer = "class-field-initializer",
conditionalType = "conditionalType",
for = "for",
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["catch"] = "catch";
ScopeType["class"] = "class";
ScopeType["classFieldInitializer"] = "class-field-initializer";
ScopeType["conditionalType"] = "conditionalType";
ScopeType["for"] = "for";
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()) {
return super.close(scopeManager);
}
assert_1.assert(this.leftToResolve);
(0, assert_1.assert)(this.leftToResolve);
for (let i = 0; i < this.leftToResolve.length; ++i) {
const ref = this.leftToResolve[i];
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,K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AAC;CACF;AAEQ,8BAAS"}

View File

@@ -1,5 +1,6 @@
export * from './BlockScope';
export * from './CatchScope';
export * from './ClassFieldInitializerScope';
export * from './ClassScope';
export * from './ConditionalTypeScope';
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 });
__exportStar(require("./BlockScope"), exports);
__exportStar(require("./CatchScope"), exports);
__exportStar(require("./ClassFieldInitializerScope"), exports);
__exportStar(require("./ClassScope"), exports);
__exportStar(require("./ConditionalTypeScope"), 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 });
exports.VariableBase = void 0;
const ID_1 = require("../ID");
const generator = ID_1.createIdGenerator();
const generator = (0, ID_1.createIdGenerator)();
class VariableBase {
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",
"version": "4.29.2",
"version": "5.0.0",
"description": "TypeScript scope analyser for ESLint",
"keywords": [
"eslint",
@@ -8,7 +8,7 @@
"estree"
],
"engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"files": [
"dist",
@@ -39,12 +39,12 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@typescript-eslint/types": "4.29.2",
"@typescript-eslint/visitor-keys": "4.29.2"
"@typescript-eslint/types": "5.0.0",
"@typescript-eslint/visitor-keys": "5.0.0"
},
"devDependencies": {
"@types/glob": "*",
"@typescript-eslint/typescript-estree": "4.29.2",
"@typescript-eslint/typescript-estree": "5.0.0",
"glob": "*",
"jest-specific-snapshot": "*",
"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.
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)
**Note:** Version bump only for package @typescript-eslint/types

View File

@@ -59,7 +59,6 @@ export declare enum AST_NODE_TYPES {
ClassBody = "ClassBody",
ClassDeclaration = "ClassDeclaration",
ClassExpression = "ClassExpression",
ClassProperty = "ClassProperty",
ConditionalExpression = "ConditionalExpression",
ContinueStatement = "ContinueStatement",
DebuggerStatement = "DebuggerStatement",
@@ -107,12 +106,15 @@ export declare enum AST_NODE_TYPES {
NewExpression = "NewExpression",
ObjectExpression = "ObjectExpression",
ObjectPattern = "ObjectPattern",
PrivateIdentifier = "PrivateIdentifier",
Program = "Program",
Property = "Property",
PropertyDefinition = "PropertyDefinition",
RestElement = "RestElement",
ReturnStatement = "ReturnStatement",
SequenceExpression = "SequenceExpression",
SpreadElement = "SpreadElement",
StaticBlock = "StaticBlock",
Super = "Super",
SwitchCase = "SwitchCase",
SwitchStatement = "SwitchStatement",
@@ -132,9 +134,9 @@ export declare enum AST_NODE_TYPES {
/**
* TS-prefixed nodes
*/
TSAbstractClassProperty = "TSAbstractClassProperty",
TSAbstractKeyword = "TSAbstractKeyword",
TSAbstractMethodDefinition = "TSAbstractMethodDefinition",
TSAbstractPropertyDefinition = "TSAbstractPropertyDefinition",
TSAnyKeyword = "TSAnyKeyword",
TSArrayType = "TSArrayType",
TSAsExpression = "TSAsExpression",
@@ -179,7 +181,6 @@ export declare enum AST_NODE_TYPES {
TSObjectKeyword = "TSObjectKeyword",
TSOptionalType = "TSOptionalType",
TSParameterProperty = "TSParameterProperty",
TSParenthesizedType = "TSParenthesizedType",
TSPrivateKeyword = "TSPrivateKeyword",
TSPropertySignature = "TSPropertySignature",
TSProtectedKeyword = "TSProtectedKeyword",
@@ -242,7 +243,6 @@ declare interface BaseToken extends NodeOrTokenData {
value: string;
}
export declare interface BigIntLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: bigint | null;
bigint: string;
}
@@ -264,7 +264,6 @@ export declare interface BlockStatement extends BaseNode {
body: Statement[];
}
export declare interface BooleanLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: boolean;
raw: 'false' | 'true';
}
@@ -311,39 +310,19 @@ declare interface ClassDeclarationBase extends BaseNode {
declare?: boolean;
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 {
type: AST_NODE_TYPES.ClassExpression;
}
export declare type ClassProperty = ClassPropertyComputedName | ClassPropertyNonComputedName;
declare interface ClassPropertyBase 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 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;
declare interface ClassMethodDefinitionNonComputedNameBase extends MethodDefinitionBase {
key: ClassPropertyNameNonComputed;
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 interface ConditionalExpression extends BaseNode {
type: AST_NODE_TYPES.ConditionalExpression;
@@ -375,7 +354,7 @@ export declare interface EmptyStatement extends BaseNode {
export declare type EntityName = Identifier | TSQualifiedName;
export declare interface ExportAllDeclaration extends BaseNode {
type: AST_NODE_TYPES.ExportAllDeclaration;
source: Expression | null;
source: StringLiteral | null;
exportKind: ExportKind;
exported: Identifier | null;
}
@@ -391,7 +370,7 @@ export declare interface ExportNamedDeclaration extends BaseNode {
type: AST_NODE_TYPES.ExportNamedDeclaration;
declaration: ExportDeclaration | null;
specifiers: ExportSpecifier[];
source: Expression | null;
source: StringLiteral | null;
exportKind: ExportKind;
}
export declare interface ExportSpecifier extends BaseNode {
@@ -399,7 +378,7 @@ export declare interface ExportSpecifier extends BaseNode {
local: 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 {
type: AST_NODE_TYPES.ExpressionStatement;
expression: Expression;
@@ -465,7 +444,7 @@ export declare interface IfStatement extends BaseNode {
export declare type ImportClause = ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier;
export declare interface ImportDeclaration extends BaseNode {
type: AST_NODE_TYPES.ImportDeclaration;
source: Literal;
source: StringLiteral;
specifiers: ImportClause[];
importKind: ImportKind;
}
@@ -573,22 +552,13 @@ export declare interface LabeledStatement extends BaseNode {
label: Identifier;
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 interface LineAndColumnData {
/**
* Line number (1-indexed)
*/
line: number;
/**
* Column number on the line (0-indexed)
*/
column: number;
}
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 LineComment extends BaseToken {
type: AST_TOKEN_TYPES.Line;
}
export declare type Literal = BigIntLiteral | BooleanLiteral | NullLiteral | NumberLiteral | RegExpLiteral | StringLiteral;
declare interface LiteralBase extends BaseNode {
type: AST_NODE_TYPES.Literal;
raw: string;
value: RegExp | bigint | boolean | number | string | null;
}
@@ -600,7 +570,7 @@ export declare interface LogicalExpression extends BinaryExpressionBase {
export declare type MemberExpression = MemberExpressionComputedName | MemberExpressionNonComputedName;
declare interface MemberExpressionBase extends BaseNode {
object: LeftHandSideExpression;
property: Expression | Identifier;
property: Expression | Identifier | PrivateIdentifier;
computed: boolean;
optional: boolean;
}
@@ -611,7 +581,7 @@ export declare interface MemberExpressionComputedName extends MemberExpressionBa
}
export declare interface MemberExpressionNonComputedName extends MemberExpressionBase {
type: AST_NODE_TYPES.MemberExpression;
property: Identifier;
property: Identifier | PrivateIdentifier;
computed: false;
}
export declare interface MetaProperty extends BaseNode {
@@ -640,7 +610,7 @@ declare interface MethodDefinitionComputedNameBase extends MethodDefinitionBase
key: PropertyNameComputed;
computed: true;
}
export declare interface MethodDefinitionNonComputedName extends MethodDefinitionNonComputedNameBase {
export declare interface MethodDefinitionNonComputedName extends ClassMethodDefinitionNonComputedNameBase {
type: AST_NODE_TYPES.MethodDefinition;
}
declare interface MethodDefinitionNonComputedNameBase extends MethodDefinitionBase {
@@ -654,10 +624,13 @@ export declare interface NewExpression extends BaseNode {
arguments: Expression[];
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 {
/**
* The source location information of the node.
*
* The loc property is defined as nullable by ESTree, but ESLint requires this property.
*
* @see {SourceLocation}
*/
loc: SourceLocation;
@@ -668,7 +641,6 @@ declare interface NodeOrTokenData {
type: string;
}
export declare interface NullLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: null;
raw: 'null';
}
@@ -676,7 +648,6 @@ export declare interface NullToken extends BaseToken {
type: AST_TOKEN_TYPES.Null;
}
export declare interface NumberLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: number;
}
export declare interface NumericToken extends BaseToken {
@@ -700,7 +671,21 @@ export declare type OptionalRangeAndLoc<T> = Pick<T, Exclude<keyof T, 'loc' | 'r
loc?: SourceLocation;
};
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 interface PrivateIdentifier extends BaseNode {
type: AST_NODE_TYPES.PrivateIdentifier;
name: string;
}
export declare interface Program extends BaseNode {
type: AST_NODE_TYPES.Program;
body: ProgramStatement[];
@@ -724,7 +709,36 @@ export declare interface PropertyComputedName extends PropertyBase {
key: PropertyNameComputed;
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 PropertyNameNonComputed = Identifier | NumberLiteral | StringLiteral;
export declare interface PropertyNonComputedName extends PropertyBase {
@@ -780,6 +794,7 @@ export declare interface PunctuatorTokenToText {
[SyntaxKind.AtToken]: '@';
[SyntaxKind.QuestionQuestionToken]: '??';
[SyntaxKind.BacktickToken]: '`';
[SyntaxKind.HashToken]: '#';
[SyntaxKind.EqualsToken]: '=';
[SyntaxKind.PlusEqualsToken]: '+=';
[SyntaxKind.MinusEqualsToken]: '-=';
@@ -804,7 +819,6 @@ export declare interface PunctuatorTokenToText {
*/
export declare type Range = [number, number];
export declare interface RegExpLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: RegExp | null;
regex: {
pattern: string;
@@ -838,19 +852,22 @@ export declare interface SourceLocation {
/**
* 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
*/
end: LineAndColumnData;
end: Position;
}
export declare interface SpreadElement extends BaseNode {
type: AST_NODE_TYPES.SpreadElement;
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 interface StaticBlock extends BaseNode {
type: AST_NODE_TYPES.StaticBlock;
body: Statement[];
}
export declare interface StringLiteral extends LiteralBase {
type: AST_NODE_TYPES.Literal;
value: string;
}
export declare interface StringToken extends BaseToken {
@@ -905,13 +922,6 @@ export declare interface TryStatement extends BaseNode {
handler: CatchClause | 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 {
type: AST_NODE_TYPES.TSAbstractKeyword;
}
@@ -922,6 +932,15 @@ export declare interface TSAbstractMethodDefinitionComputedName extends MethodDe
export declare interface TSAbstractMethodDefinitionNonComputedName extends MethodDefinitionNonComputedNameBase {
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 {
type: AST_NODE_TYPES.TSAnyKeyword;
}
@@ -1173,10 +1192,6 @@ export declare interface TSParameterProperty extends BaseNode {
parameter: AssignmentPattern | BindingName | RestElement;
decorators?: Decorator[];
}
export declare interface TSParenthesizedType extends BaseNode {
type: AST_NODE_TYPES.TSParenthesizedType;
typeAnnotation: TypeNode;
}
export declare interface TSPrivateKeyword extends BaseNode {
type: AST_NODE_TYPES.TSPrivateKeyword;
}
@@ -1309,7 +1324,7 @@ export declare interface TSVoidKeyword extends BaseNode {
type: AST_NODE_TYPES.TSVoidKeyword;
}
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 {
type: AST_NODE_TYPES.UnaryExpression;
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["ClassDeclaration"] = "ClassDeclaration";
AST_NODE_TYPES["ClassExpression"] = "ClassExpression";
AST_NODE_TYPES["ClassProperty"] = "ClassProperty";
AST_NODE_TYPES["ConditionalExpression"] = "ConditionalExpression";
AST_NODE_TYPES["ContinueStatement"] = "ContinueStatement";
AST_NODE_TYPES["DebuggerStatement"] = "DebuggerStatement";
@@ -75,12 +74,15 @@ var AST_NODE_TYPES;
AST_NODE_TYPES["NewExpression"] = "NewExpression";
AST_NODE_TYPES["ObjectExpression"] = "ObjectExpression";
AST_NODE_TYPES["ObjectPattern"] = "ObjectPattern";
AST_NODE_TYPES["PrivateIdentifier"] = "PrivateIdentifier";
AST_NODE_TYPES["Program"] = "Program";
AST_NODE_TYPES["Property"] = "Property";
AST_NODE_TYPES["PropertyDefinition"] = "PropertyDefinition";
AST_NODE_TYPES["RestElement"] = "RestElement";
AST_NODE_TYPES["ReturnStatement"] = "ReturnStatement";
AST_NODE_TYPES["SequenceExpression"] = "SequenceExpression";
AST_NODE_TYPES["SpreadElement"] = "SpreadElement";
AST_NODE_TYPES["StaticBlock"] = "StaticBlock";
AST_NODE_TYPES["Super"] = "Super";
AST_NODE_TYPES["SwitchCase"] = "SwitchCase";
AST_NODE_TYPES["SwitchStatement"] = "SwitchStatement";
@@ -100,9 +102,9 @@ var AST_NODE_TYPES;
/**
* TS-prefixed nodes
*/
AST_NODE_TYPES["TSAbstractClassProperty"] = "TSAbstractClassProperty";
AST_NODE_TYPES["TSAbstractKeyword"] = "TSAbstractKeyword";
AST_NODE_TYPES["TSAbstractMethodDefinition"] = "TSAbstractMethodDefinition";
AST_NODE_TYPES["TSAbstractPropertyDefinition"] = "TSAbstractPropertyDefinition";
AST_NODE_TYPES["TSAnyKeyword"] = "TSAnyKeyword";
AST_NODE_TYPES["TSArrayType"] = "TSArrayType";
AST_NODE_TYPES["TSAsExpression"] = "TSAsExpression";
@@ -147,7 +149,6 @@ var AST_NODE_TYPES;
AST_NODE_TYPES["TSObjectKeyword"] = "TSObjectKeyword";
AST_NODE_TYPES["TSOptionalType"] = "TSOptionalType";
AST_NODE_TYPES["TSParameterProperty"] = "TSParameterProperty";
AST_NODE_TYPES["TSParenthesizedType"] = "TSParenthesizedType";
AST_NODE_TYPES["TSPrivateKeyword"] = "TSPrivateKeyword";
AST_NODE_TYPES["TSPropertySignature"] = "TSPropertySignature";
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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AA;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 type { Program } from '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';
interface ParserOptions {
ecmaFeatures?: {
globalReturn?: boolean;
jsx?: boolean;
};
ecmaVersion?: EcmaVersion;
ecmaVersion?: EcmaVersion | 'latest';
jsxPragma?: string | null;
jsxFragmentName?: string | null;
lib?: Lib[];

View File

@@ -1 +1 @@
{"version":3,"file":"parser-options.d.ts","sourceRoot":"","sources":["../src/parser-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,aAAK,UAAU,GAAG,OAAO,GAAG,CAAC,mBAAmB,GAAG,QAAQ,GAAG,YAAY,CAAC,EAAE,CAAC;AAE9E,aAAK,WAAW,GACZ,CAAC,GACD,CAAC,GACD,CAAC,GACD,CAAC,GACD,CAAC,GACD,CAAC,GACD,EAAE,GACF,EAAE,GACF,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CAAC;AAET,aAAK,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEtC,UAAU,aAAa;IACrB,YAAY,CAAC,EAAE;QACb,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,GAAG,CAAC,EAAE,OAAO,CAAC;KACf,CA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AAc,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",
"version": "4.29.2",
"version": "5.0.0",
"description": "Types for the TypeScript-ESTree AST spec",
"keywords": [
"eslint",
@@ -8,7 +8,7 @@
"estree"
],
"engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"files": [
"dist",
@@ -52,5 +52,5 @@
"devDependencies": {
"typescript": "*"
},
"gitHead": "bf402f4a04397943ca916c8333186f539986a247"
"gitHead": "101abc72f0baced5cdf609d99418ad9f10830c73"
}

View File

@@ -3,6 +3,87 @@
All notable changes to this project will be documented in this file.
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)
### Bug Fixes
* **typescript-estree:** change `source` of ExportNamedDeclaration to Literal from Expression ([#3763](https://github.com/typescript-eslint/typescript-eslint/issues/3763)) ([dc5a0f5](https://github.com/typescript-eslint/typescript-eslint/commit/dc5a0f5104b400f4422b8d67ecfc6cc7a32613a2))
### Features
* **ast-spec:** bring `Node` objects in line with ESTree ([#3771](https://github.com/typescript-eslint/typescript-eslint/issues/3771)) ([dd14064](https://github.com/typescript-eslint/typescript-eslint/commit/dd140643b457aa515cc21fcda2b3cd4acc2a1c5c))
* **eslint-plugin:** update recommended configs ([#3809](https://github.com/typescript-eslint/typescript-eslint/issues/3809)) ([deeb7bb](https://github.com/typescript-eslint/typescript-eslint/commit/deeb7bb9334d301c6af56aefd37d318231af11ef))
* 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)
* remove `TSParenthesizedType` ([#3340](https://github.com/typescript-eslint/typescript-eslint/issues/3340)) ([c8ee432](https://github.com/typescript-eslint/typescript-eslint/commit/c8ee43269faea4c04ec02eaa2b81a0aa6eec5d3e)), closes [#3136](https://github.com/typescript-eslint/typescript-eslint/issues/3136)
* 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)
* **typescript-estree:** remove legacy `useJSXTextNode` option ([#3109](https://github.com/typescript-eslint/typescript-eslint/issues/3109)) ([5b84b98](https://github.com/typescript-eslint/typescript-eslint/commit/5b84b98fb3cf68d944b7d4e970f39f4e88f0b2d5))
# [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/typescript-estree
# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27)
**Note:** Version bump only for package @typescript-eslint/typescript-estree
## [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/typescript-estree
## [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/typescript-estree
# [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/typescript-estree
# [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/typescript-estree
## [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/typescript-estree

View File

@@ -101,14 +101,6 @@ interface ParseOptions {
* Set to true to create a top-level array containing all tokens from the file.
*/
tokens?: boolean;
/*
* The JSX AST changed the node type for string literals
* inside a JSX Element from `Literal` to `JSXText`.
* When value is `true`, these nodes will be parsed as type `JSXText`.
* When value is `false`, these nodes will be parsed as type `Literal`.
*/
useJSXTextNode?: boolean;
}
const PARSE_DEFAULT_OPTIONS: ParseOptions = {
@@ -120,7 +112,6 @@ const PARSE_DEFAULT_OPTIONS: ParseOptions = {
loggerFn: undefined,
range: false,
tokens: false,
useJSXTextNode: false,
};
declare function parse(
@@ -209,11 +200,11 @@ interface ParseAndGenerateServicesOptions extends ParseOptions {
tsconfigRootDir?: string;
/**
* Instance of a TypeScript Program object to be used for type information.
* An array of one or more instances of TypeScript Program objects to be used for type information.
* This overrides any program or programs that would have been computed from the `project` option.
* All linted files must be part of the provided program.
* All linted files must be part of the provided program(s).
*/
program?: import('typescript').Program;
programs?: Program[];
/**
***************************************************************************************
@@ -333,7 +324,7 @@ Types for the AST produced by the parse functions.
#### `createProgram(configFile, projectDirectory)`
This serves as a utility method for users of the `ParseOptions.program` feature to create a TypeScript program instance from a config file.
This serves as a utility method for users of the `ParseOptions.programs` feature to create a TypeScript program instance from a config file.
```ts
declare function createProgram(

View File

@@ -1,7 +1,7 @@
import { SourceFile } from 'typescript';
import type { SourceFile } from 'typescript';
import { ASTMaps } from './convert';
import { Extra } from './parser-options';
import { TSESTree } from './ts-estree';
import type { Extra } from './parser-options';
import type { TSESTree } from './ts-estree';
export declare function astConverter(ast: SourceFile, extra: Extra, shouldPreserveNodeMaps: boolean): {
estree: TSESTree.Program;
astMaps: ASTMaps;

View File

@@ -1 +1 @@
{"version":3,"file":"ast-converter.d.ts","sourceRoot":"","sources":["../src/ast-converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAA2B,OAAO,EAAE,MAAM,WAAW,CAAC;AAG7D,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,wBAAgB,YAAY,CAC1B,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,KAAK,EACZ,sBAAsB,EAAE,OAAO,GAC9B;IAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CA0DhD"}
{"version":3,"file":"ast-converter.d.ts","sourceRoot":"","sources":["../src/ast-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAA2B,OAAO,EAAE,MAAM,WAAW,CAAC;AAG7D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,wBAAgB,YAAY,CAC1B,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,KAAK,EACZ,sBAAsB,EAAE,OAAO,GAC9B;IAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAyDhD"}

View File

@@ -12,14 +12,13 @@ function astConverter(ast, extra, shouldPreserveNodeMaps) {
*/
const { parseDiagnostics } = ast;
if (parseDiagnostics.length) {
throw convert_1.convertError(parseDiagnostics[0]);
throw (0, convert_1.convertError)(parseDiagnostics[0]);
}
/**
* Recursively convert the TypeScript AST into an ESTree-compatible AST
*/
const instance = new convert_1.Converter(ast, {
errorOnUnknownASTType: extra.errorOnUnknownASTType || false,
useJSXTextNode: extra.useJSXTextNode || false,
shouldPreserveNodeMaps,
});
const estree = instance.convertProgram();
@@ -27,7 +26,7 @@ function astConverter(ast, extra, shouldPreserveNodeMaps) {
* Optionally remove range and loc if specified
*/
if (!extra.range || !extra.loc) {
simple_traverse_1.simpleTraverse(estree, {
(0, simple_traverse_1.simpleTraverse)(estree, {
enter: node => {
if (!extra.range) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- TS 4.0 made this an error because the types aren't optional
@@ -46,13 +45,13 @@ function astConverter(ast, extra, shouldPreserveNodeMaps) {
* Optionally convert and include all tokens in the AST
*/
if (extra.tokens) {
estree.tokens = node_utils_1.convertTokens(ast);
estree.tokens = (0, node_utils_1.convertTokens)(ast);
}
/**
* Optionally convert and include all comments in the AST
*/
if (extra.comment) {
estree.comments = convert_comments_1.convertComments(ast, extra.code);
estree.comments = (0, convert_comments_1.convertComments)(ast, extra.code);
}
const astMaps = instance.getASTMaps();
return { estree, astMaps };

View File

@@ -1 +1 @@
{"version":3,"file":"ast-converter.js","sourceRoot":"","sources":["../src/ast-converter.ts"],"names":[],"mappings":";;;AACA,uCAA6D;AAC7D,yDAAqD;AACrD,6CAA6C;AAG7C,uDAAmD;AAEnD,SAAgB,YAAY,CAC1B,GAAe,EACf,KAAY,EACZ,sBAA+B;IAE/B;;;OAGG;IACH,MAAM,EAAE,gBAAgB,EAAE,GAAG,GAAG,CAAC;IACjC,IAAI,gBAAgB,C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,CAAC,UAAU,EAAE,CAAC;IAEtC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC;AA7DD,oCA6DC"}

View File

@@ -33,12 +33,12 @@ const ts_estree_1 = require("./ts-estree");
*/
function convertComments(ast, code) {
const comments = [];
util_1.forEachComment(ast, (_, comment) => {
(0, util_1.forEachComment)(ast, (_, comment) => {
const type = comment.kind == ts.SyntaxKind.SingleLineCommentTrivia
? ts_estree_1.AST_TOKEN_TYPES.Line
: ts_estree_1.AST_TOKEN_TYPES.Block;
const range = [comment.pos, comment.end];
const loc = node_utils_1.getLocFor(range[0], range[1], ast);
const loc = (0, node_utils_1.getLocFor)(range[0], range[1], ast);
// both comments start with 2 characters - /* or //
const textStart = range[0] + 2;
const textEnd = comment.kind === ts.SyntaxKind.SingleLineCommentTrivia

View File

@@ -1 +1 @@
{"version":3,"file":"convert-comments.js","sourceRoot":"","sources":["../src/convert-comments.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,4CAAmD;AACnD,6CAAyC;AACzC,2CAAwD;AAExD;;;;;;GAMG;AACH,SAAgB,eAAe,CAC7B,GAAkB,EAClB,IAAY;IAEZ,MAAM,QAAQ,GAAuB,EAAE,CAAC;IAExC,qBAAc,CACZ,GAAG,EACH,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;QACb,MAAM,IAAI,GACR,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,UAAU,CAAC,uBAAuB;YACnD,CAAC,CAAC,2BAAe,CAAC,IAAI;YACtB,CAAC,CAAC,2BAAe,CAAC,KAAK,CAAC;QAC5B,MAAM,KAAK,GAAmB,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACzD,MAAM,GAAG,GAAG,sBAAS,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAE/C,mDAAmD;QACn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;QAE/C,mDAAmD;QACnD,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,OAAO,GACX,OAAO,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,uBAAuB;YACpD,CAAC,CAAC,sCAAsC;gBACtC,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS;YACtB,CAAC,CAAC,4CAA4C;gBAC5C,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC;QAC/B,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI;YACJ,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC;YACtC,KAAK;YACL,GAAG;SACJ,CAAC,CAAC;IACL,CAAC,EACD,GAAG,CACJ,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC;AAnCD,0CAmCC"}

View File

@@ -1,10 +1,10 @@
import * as ts from 'typescript';
import { TSError } from './node-utils';
import { ParserWeakMap, ParserWeakMapESTreeToTSNode } from './parser-options';
import type { ParserWeakMap, ParserWeakMapESTreeToTSNode } from './parser-options';
import type { SemanticOrSyntacticError } from './semantic-or-syntactic-errors';
import { TSESTree, TSNode } from './ts-estree';
interface ConverterOptions {
errorOnUnknownASTType: boolean;
useJSXTextNode: boolean;
shouldPreserveNodeMaps: boolean;
}
/**
@@ -12,7 +12,7 @@ interface ConverterOptions {
* @param error the error object
* @returns converted error object
*/
export declare function convertError(error: any): TSError;
export declare function convertError(error: ts.DiagnosticWithLocation | SemanticOrSyntacticError): TSError;
export interface ASTMaps {
esTreeNodeToTSNodeMap: ParserWeakMapESTreeToTSNode;
tsNodeToESTreeNodeMap: ParserWeakMap<TSNode, TSESTree.Node>;
@@ -141,6 +141,7 @@ export declare class Converter {
* @param childRange The child node range used to expand location
*/
private fixParentLocation;
private assertModuleSpecifier;
/**
* Converts a TypeScript node into an ESTree node.
* The core of the conversion logic:

View File

@@ -1 +1 @@
{"version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IA4D9B;;;;;;OAMG;IACH,OAAO,CAAC,sBAAsB;IA+C9B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,qBAAqB;IAe7B;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW;CAmkEpB"}

View File

@@ -33,7 +33,7 @@ const SyntaxKind = ts.SyntaxKind;
* @returns converted error object
*/
function convertError(error) {
return node_utils_1.createError(error.file, error.start, error.message || error.messageText);
return (0, node_utils_1.createError)(error.file, error.start, ('message' in error && error.message) || error.messageText);
}
exports.convertError = convertError;
class Converter {
@@ -106,10 +106,10 @@ class Converter {
const nextModifier = node.modifiers[1];
const declarationIsDefault = nextModifier && nextModifier.kind === SyntaxKind.DefaultKeyword;
const varToken = declarationIsDefault
? node_utils_1.findNextToken(nextModifier, this.ast, this.ast)
: node_utils_1.findNextToken(exportKeyword, this.ast, this.ast);
? (0, node_utils_1.findNextToken)(nextModifier, this.ast, this.ast)
: (0, node_utils_1.findNextToken)(exportKeyword, this.ast, this.ast);
result.range[0] = varToken.getStart(this.ast);
result.loc = node_utils_1.getLocFor(result.range[0], result.range[1], this.ast);
result.loc = (0, node_utils_1.getLocFor)(result.range[0], result.range[1], this.ast);
if (declarationIsDefault) {
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration,
@@ -174,12 +174,12 @@ class Converter {
createNode(node, data) {
const result = data;
if (!result.range) {
result.range = node_utils_1.getRange(
result.range = (0, node_utils_1.getRange)(
// this is completely valid, but TS hates it
node, this.ast);
}
if (!result.loc) {
result.loc = node_utils_1.getLocFor(result.range[0], result.range[1], this.ast);
result.loc = (0, node_utils_1.getLocFor)(result.range[0], result.range[1], this.ast);
}
if (result && this.options.shouldPreserveNodeMaps) {
this.esTreeNodeToTSNodeMap.set(result, node);
@@ -208,7 +208,7 @@ class Converter {
? 2
: 1;
const annotationStartCol = child.getFullStart() - offset;
const loc = node_utils_1.getLocFor(annotationStartCol, child.end, this.ast);
const loc = (0, node_utils_1.getLocFor)(annotationStartCol, child.end, this.ast);
return {
type: ts_estree_1.AST_NODE_TYPES.TSTypeAnnotation,
loc,
@@ -223,7 +223,7 @@ class Converter {
* @returns Array of body statements
*/
convertBodyExpressions(nodes, parent) {
let allowDirectives = node_utils_1.canContainDirective(parent);
let allowDirectives = (0, node_utils_1.canContainDirective)(parent);
return (nodes
.map(statement => {
const child = this.convertChild(statement);
@@ -251,7 +251,7 @@ class Converter {
* @returns TypeParameterInstantiation node
*/
convertTypeArgumentsToTypeParameters(typeArguments, node) {
const greaterThanToken = node_utils_1.findNextToken(typeArguments, this.ast, this.ast);
const greaterThanToken = (0, node_utils_1.findNextToken)(typeArguments, this.ast, this.ast);
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterInstantiation,
range: [typeArguments.pos - 1, greaterThanToken.end],
@@ -264,11 +264,11 @@ class Converter {
* @returns TypeParameterDeclaration node
*/
convertTSTypeParametersToTypeParametersDeclaration(typeParameters) {
const greaterThanToken = node_utils_1.findNextToken(typeParameters, this.ast, this.ast);
const greaterThanToken = (0, node_utils_1.findNextToken)(typeParameters, this.ast, this.ast);
return {
type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterDeclaration,
range: [typeParameters.pos - 1, greaterThanToken.end],
loc: node_utils_1.getLocFor(typeParameters.pos - 1, greaterThanToken.end, this.ast),
loc: (0, node_utils_1.getLocFor)(typeParameters.pos - 1, greaterThanToken.end, this.ast),
params: typeParameters.map(typeParameter => this.convertType(typeParameter)),
};
}
@@ -300,11 +300,11 @@ class Converter {
}
return { child: node.expression, isOptional: false };
})();
const isChildUnwrappable = node_utils_1.isChildUnwrappableOptionalChain(tsNode, child);
const isChildUnwrappable = (0, node_utils_1.isChildUnwrappableOptionalChain)(tsNode, child);
if (!isChildUnwrappable && !isOptional) {
return node;
}
if (isChildUnwrappable && node_utils_1.isChainExpression(child)) {
if (isChildUnwrappable && (0, node_utils_1.isChainExpression)(child)) {
// unwrap the chain expression child
const newChild = child.expression;
if (node.type === ts_estree_1.AST_NODE_TYPES.MemberExpression) {
@@ -329,7 +329,7 @@ class Converter {
*/
deeplyCopy(node) {
if (node.kind === ts.SyntaxKind.JSDocFunctionType) {
throw node_utils_1.createError(this.ast, node.pos, 'JSDoc types can only be used inside documentation comments.');
throw (0, node_utils_1.createError)(this.ast, node.pos, 'JSDoc types can only be used inside documentation comments.');
}
const customType = `TS${SyntaxKind[node.kind]}`;
/**
@@ -392,7 +392,7 @@ class Converter {
const colonIndex = text.indexOf(':');
// this is intentional we can ignore conversion if `:` is in first character
if (colonIndex > 0) {
const range = node_utils_1.getRange(node, this.ast);
const range = (0, node_utils_1.getRange)(node, this.ast);
const result = this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.JSXNamespacedName,
namespace: this.createNode(node, {
@@ -444,7 +444,7 @@ class Converter {
convertMethodSignature(node) {
const result = this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.TSMethodSignature,
computed: node_utils_1.isComputedProperty(node.name),
computed: (0, node_utils_1.isComputedProperty)(node.name),
key: this.convertChild(node.name),
params: this.convertParameters(node.parameters),
kind: (() => {
@@ -458,27 +458,27 @@ class Converter {
}
})(),
});
if (node_utils_1.isOptional(node)) {
if ((0, node_utils_1.isOptional)(node)) {
result.optional = true;
}
if (node.type) {
result.returnType = this.convertTypeAnnotation(node.type, node);
}
if (node_utils_1.hasModifier(SyntaxKind.ReadonlyKeyword, node)) {
if ((0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node)) {
result.readonly = true;
}
if (node.typeParameters) {
result.typeParameters =
this.convertTSTypeParametersToTypeParametersDeclaration(node.typeParameters);
}
const accessibility = node_utils_1.getTSNodeAccessibility(node);
const accessibility = (0, node_utils_1.getTSNodeAccessibility)(node);
if (accessibility) {
result.accessibility = accessibility;
}
if (node_utils_1.hasModifier(SyntaxKind.ExportKeyword, node)) {
if ((0, node_utils_1.hasModifier)(SyntaxKind.ExportKeyword, node)) {
result.export = true;
}
if (node_utils_1.hasModifier(SyntaxKind.StaticKeyword, node)) {
if ((0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node)) {
result.static = true;
}
return result;
@@ -539,11 +539,17 @@ class Converter {
fixParentLocation(result, childRange) {
if (childRange[0] < result.range[0]) {
result.range[0] = childRange[0];
result.loc.start = node_utils_1.getLineAndCharacterFor(result.range[0], this.ast);
result.loc.start = (0, node_utils_1.getLineAndCharacterFor)(result.range[0], this.ast);
}
if (childRange[1] > result.range[1]) {
result.range[1] = childRange[1];
result.loc.end = node_utils_1.getLineAndCharacterFor(result.range[1], this.ast);
result.loc.end = (0, node_utils_1.getLineAndCharacterFor)(result.range[1], this.ast);
}
}
assertModuleSpecifier(node) {
if (node.moduleSpecifier &&
node.moduleSpecifier.kind !== SyntaxKind.StringLiteral) {
throw (0, node_utils_1.createError)(this.ast, node.moduleSpecifier.pos, 'Module specifier must be a string literal.');
}
}
/**
@@ -577,6 +583,13 @@ class Converter {
name: node.text,
});
}
case SyntaxKind.PrivateIdentifier: {
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.PrivateIdentifier,
// typescript includes the `#` in the text
name: node.text.slice(1),
});
}
case SyntaxKind.WithStatement:
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.WithStatement,
@@ -693,7 +706,7 @@ class Converter {
});
// Declarations
case SyntaxKind.FunctionDeclaration: {
const isDeclare = node_utils_1.hasModifier(SyntaxKind.DeclareKeyword, node);
const isDeclare = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node);
const result = this.createNode(node, {
type: isDeclare || !node.body
? ts_estree_1.AST_NODE_TYPES.TSDeclareFunction
@@ -701,7 +714,7 @@ class Converter {
id: this.convertChild(node.name),
generator: !!node.asteriskToken,
expression: false,
async: node_utils_1.hasModifier(SyntaxKind.AsyncKeyword, node),
async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node),
params: this.convertParameters(node.parameters),
body: this.convertChild(node.body) || undefined,
});
@@ -735,7 +748,7 @@ class Converter {
const result = this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration,
declarations: node.declarationList.declarations.map(el => this.convertChild(el)),
kind: node_utils_1.getDeclarationKind(node.declarationList),
kind: (0, node_utils_1.getDeclarationKind)(node.declarationList),
});
/**
* Semantically, decorators are not allowed on variable declarations,
@@ -745,7 +758,7 @@ class Converter {
if (node.decorators) {
result.decorators = node.decorators.map(el => this.convertChild(el));
}
if (node_utils_1.hasModifier(SyntaxKind.DeclareKeyword, node)) {
if ((0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node)) {
result.declare = true;
}
// check for exports
@@ -756,7 +769,7 @@ class Converter {
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration,
declarations: node.declarations.map(el => this.convertChild(el)),
kind: node_utils_1.getDeclarationKind(node),
kind: (0, node_utils_1.getDeclarationKind)(node),
});
// Expressions
case SyntaxKind.ExpressionStatement:
@@ -803,7 +816,7 @@ class Converter {
type: ts_estree_1.AST_NODE_TYPES.Property,
key: this.convertChild(node.name),
value: this.converter(node.initializer, node, this.inTypeMode, this.allowPattern),
computed: node_utils_1.isComputedProperty(node.name),
computed: (0, node_utils_1.isComputedProperty)(node.name),
method: false,
shorthand: false,
kind: 'init',
@@ -839,18 +852,18 @@ class Converter {
case SyntaxKind.ComputedPropertyName:
return this.convertChild(node.expression);
case SyntaxKind.PropertyDeclaration: {
const isAbstract = node_utils_1.hasModifier(SyntaxKind.AbstractKeyword, node);
const isAbstract = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node);
const result = this.createNode(node, {
type: isAbstract
? ts_estree_1.AST_NODE_TYPES.TSAbstractClassProperty
: ts_estree_1.AST_NODE_TYPES.ClassProperty,
? ts_estree_1.AST_NODE_TYPES.TSAbstractPropertyDefinition
: ts_estree_1.AST_NODE_TYPES.PropertyDefinition,
key: this.convertChild(node.name),
value: this.convertChild(node.initializer),
computed: node_utils_1.isComputedProperty(node.name),
static: node_utils_1.hasModifier(SyntaxKind.StaticKeyword, node),
readonly: node_utils_1.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined,
declare: node_utils_1.hasModifier(SyntaxKind.DeclareKeyword, node),
override: node_utils_1.hasModifier(SyntaxKind.OverrideKeyword, node),
value: isAbstract ? null : this.convertChild(node.initializer),
computed: (0, node_utils_1.isComputedProperty)(node.name),
static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node),
readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node) || undefined,
declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node),
override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node),
});
if (node.type) {
result.typeAnnotation = this.convertTypeAnnotation(node.type, node);
@@ -858,7 +871,7 @@ class Converter {
if (node.decorators) {
result.decorators = node.decorators.map(el => this.convertChild(el));
}
const accessibility = node_utils_1.getTSNodeAccessibility(node);
const accessibility = (0, node_utils_1.getTSNodeAccessibility)(node);
if (accessibility) {
result.accessibility = accessibility;
}
@@ -891,7 +904,7 @@ class Converter {
id: null,
generator: !!node.asteriskToken,
expression: false,
async: node_utils_1.hasModifier(SyntaxKind.AsyncKeyword, node),
async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node),
body: this.convertChild(node.body),
range: [node.parameters.pos - 1, node.end],
params: [],
@@ -912,7 +925,7 @@ class Converter {
type: ts_estree_1.AST_NODE_TYPES.Property,
key: this.convertChild(node.name),
value: method,
computed: node_utils_1.isComputedProperty(node.name),
computed: (0, node_utils_1.isComputedProperty)(node.name),
method: node.kind === SyntaxKind.MethodDeclaration,
shorthand: false,
kind: 'init',
@@ -927,22 +940,22 @@ class Converter {
/**
* TypeScript class methods can be defined as "abstract"
*/
const methodDefinitionType = node_utils_1.hasModifier(SyntaxKind.AbstractKeyword, node)
const methodDefinitionType = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node)
? ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition
: ts_estree_1.AST_NODE_TYPES.MethodDefinition;
result = this.createNode(node, {
type: methodDefinitionType,
key: this.convertChild(node.name),
value: method,
computed: node_utils_1.isComputedProperty(node.name),
static: node_utils_1.hasModifier(SyntaxKind.StaticKeyword, node),
computed: (0, node_utils_1.isComputedProperty)(node.name),
static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node),
kind: 'method',
override: node_utils_1.hasModifier(SyntaxKind.OverrideKeyword, node),
override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node),
});
if (node.decorators) {
result.decorators = node.decorators.map(el => this.convertChild(el));
}
const accessibility = node_utils_1.getTSNodeAccessibility(node);
const accessibility = (0, node_utils_1.getTSNodeAccessibility)(node);
if (accessibility) {
result.accessibility = accessibility;
}
@@ -966,8 +979,8 @@ class Converter {
}
// TypeScript uses this even for static methods named "constructor"
case SyntaxKind.Constructor: {
const lastModifier = node_utils_1.getLastModifier(node);
const constructorToken = (lastModifier && node_utils_1.findNextToken(lastModifier, node, this.ast)) ||
const lastModifier = (0, node_utils_1.getLastModifier)(node);
const constructorToken = (lastModifier && (0, node_utils_1.findNextToken)(lastModifier, node, this.ast)) ||
node.getFirstToken();
const constructor = this.createNode(node, {
type: !node.body
@@ -996,9 +1009,9 @@ class Converter {
name: 'constructor',
range: [constructorToken.getStart(this.ast), constructorToken.end],
});
const isStatic = node_utils_1.hasModifier(SyntaxKind.StaticKeyword, node);
const isStatic = (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node);
const result = this.createNode(node, {
type: node_utils_1.hasModifier(SyntaxKind.AbstractKeyword, node)
type: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node)
? ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition
: ts_estree_1.AST_NODE_TYPES.MethodDefinition,
key: constructorKey,
@@ -1008,7 +1021,7 @@ class Converter {
kind: isStatic ? 'method' : 'constructor',
override: false,
});
const accessibility = node_utils_1.getTSNodeAccessibility(node);
const accessibility = (0, node_utils_1.getTSNodeAccessibility)(node);
if (accessibility) {
result.accessibility = accessibility;
}
@@ -1021,7 +1034,7 @@ class Converter {
generator: !!node.asteriskToken,
params: this.convertParameters(node.parameters),
body: this.convertChild(node.body),
async: node_utils_1.hasModifier(SyntaxKind.AsyncKeyword, node),
async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node),
expression: false,
});
// Process returnType
@@ -1110,7 +1123,7 @@ class Converter {
id: null,
params: this.convertParameters(node.parameters),
body: this.convertChild(node.body),
async: node_utils_1.hasModifier(SyntaxKind.AsyncKeyword, node),
async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node),
expression: node.body.kind !== SyntaxKind.Block,
});
// Process returnType
@@ -1220,7 +1233,7 @@ class Converter {
if (node.modifiers) {
// AssignmentPattern should not contain modifiers in range
result.range[0] = parameter.range[0];
result.loc = node_utils_1.getLocFor(result.range[0], result.range[1], this.ast);
result.loc = (0, node_utils_1.getLocFor)(result.range[0], result.range[1], this.ast);
}
}
else {
@@ -1233,18 +1246,18 @@ class Converter {
if (node.questionToken) {
if (node.questionToken.end > parameter.range[1]) {
parameter.range[1] = node.questionToken.end;
parameter.loc.end = node_utils_1.getLineAndCharacterFor(parameter.range[1], this.ast);
parameter.loc.end = (0, node_utils_1.getLineAndCharacterFor)(parameter.range[1], this.ast);
}
parameter.optional = true;
}
if (node.modifiers) {
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.TSParameterProperty,
accessibility: (_c = node_utils_1.getTSNodeAccessibility(node)) !== null && _c !== void 0 ? _c : undefined,
readonly: node_utils_1.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined,
static: node_utils_1.hasModifier(SyntaxKind.StaticKeyword, node) || undefined,
export: node_utils_1.hasModifier(SyntaxKind.ExportKeyword, node) || undefined,
override: node_utils_1.hasModifier(SyntaxKind.OverrideKeyword, node) || undefined,
accessibility: (_c = (0, node_utils_1.getTSNodeAccessibility)(node)) !== null && _c !== void 0 ? _c : undefined,
readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node) || undefined,
static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node) || undefined,
export: (0, node_utils_1.hasModifier)(SyntaxKind.ExportKeyword, node) || undefined,
override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node) || undefined,
parameter: result,
});
}
@@ -1273,7 +1286,7 @@ class Converter {
});
if (superClass) {
if (superClass.types.length > 1) {
throw node_utils_1.createError(this.ast, superClass.types[1].pos, 'Classes can only extend a single class.');
throw (0, node_utils_1.createError)(this.ast, superClass.types[1].pos, 'Classes can only extend a single class.');
}
if ((_e = superClass.types[0]) === null || _e === void 0 ? void 0 : _e.typeArguments) {
result.superTypeParameters =
@@ -1290,10 +1303,10 @@ class Converter {
/**
* TypeScript class declarations can be defined as "abstract"
*/
if (node_utils_1.hasModifier(SyntaxKind.AbstractKeyword, node)) {
if ((0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node)) {
result.abstract = true;
}
if (node_utils_1.hasModifier(SyntaxKind.DeclareKeyword, node)) {
if ((0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node)) {
result.declare = true;
}
if (node.decorators) {
@@ -1313,6 +1326,7 @@ class Converter {
body: this.convertBodyExpressions(node.statements, node),
});
case SyntaxKind.ImportDeclaration: {
this.assertModuleSpecifier(node);
const result = this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.ImportDeclaration,
source: this.convertChild(node.moduleSpecifier),
@@ -1358,7 +1372,8 @@ class Converter {
range: local.range,
});
}
case SyntaxKind.ExportDeclaration:
case SyntaxKind.ExportDeclaration: {
this.assertModuleSpecifier(node);
if (((_g = node.exportClause) === null || _g === void 0 ? void 0 : _g.kind) === SyntaxKind.NamedExports) {
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.ExportNamedDeclaration,
@@ -1384,6 +1399,7 @@ class Converter {
: null,
});
}
}
case SyntaxKind.ExportSpecifier:
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.ExportSpecifier,
@@ -1407,7 +1423,7 @@ class Converter {
// Unary Operations
case SyntaxKind.PrefixUnaryExpression:
case SyntaxKind.PostfixUnaryExpression: {
const operator = node_utils_1.getTextForTokenKind(node.operator);
const operator = (0, node_utils_1.getTextForTokenKind)(node.operator);
/**
* ESTree uses UpdateExpression for ++/--
*/
@@ -1452,13 +1468,13 @@ class Converter {
case SyntaxKind.TypeOperator:
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.TSTypeOperator,
operator: node_utils_1.getTextForTokenKind(node.operator),
operator: (0, node_utils_1.getTextForTokenKind)(node.operator),
typeAnnotation: this.convertChild(node.type),
});
// Binary Operations
case SyntaxKind.BinaryExpression: {
// TypeScript uses BinaryExpression for sequences as well
if (node_utils_1.isComma(node.operatorToken)) {
if ((0, node_utils_1.isComma)(node.operatorToken)) {
const result = this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.SequenceExpression,
expressions: [],
@@ -1475,7 +1491,7 @@ class Converter {
return result;
}
else {
const type = node_utils_1.getBinaryExpressionType(node.operatorToken);
const type = (0, node_utils_1.getBinaryExpressionType)(node.operatorToken);
if (this.allowPattern &&
type === ts_estree_1.AST_NODE_TYPES.AssignmentExpression) {
return this.createNode(node, {
@@ -1486,7 +1502,7 @@ class Converter {
}
return this.createNode(node, {
type,
operator: node_utils_1.getTextForTokenKind(node.operatorToken.kind),
operator: (0, node_utils_1.getTextForTokenKind)(node.operatorToken.kind),
left: this.converter(node.left, node, this.inTypeMode, type === ts_estree_1.AST_NODE_TYPES.AssignmentExpression),
right: this.convertChild(node.right),
});
@@ -1521,7 +1537,7 @@ class Converter {
case SyntaxKind.CallExpression: {
if (node.expression.kind === SyntaxKind.ImportKeyword) {
if (node.arguments.length !== 1) {
throw node_utils_1.createError(this.ast, node.arguments.pos, 'Dynamic import must have one specifier as an argument.');
throw (0, node_utils_1.createError)(this.ast, node.arguments.pos, 'Dynamic import must have one specifier as an argument.');
}
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.ImportExpression,
@@ -1569,7 +1585,7 @@ class Converter {
// TODO: do we really want to convert it to Token?
node.getFirstToken(), {
type: ts_estree_1.AST_NODE_TYPES.Identifier,
name: node_utils_1.getTextForTokenKind(node.keywordToken),
name: (0, node_utils_1.getTextForTokenKind)(node.keywordToken),
}),
property: this.convertChild(node.name),
});
@@ -1585,7 +1601,7 @@ class Converter {
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.Literal,
value: parent.kind === SyntaxKind.JsxAttribute
? node_utils_1.unescapeStringLiteralText(node.text)
? (0, node_utils_1.unescapeStringLiteralText)(node.text)
: node.text,
raw: node.getText(),
});
@@ -1598,7 +1614,7 @@ class Converter {
});
}
case SyntaxKind.BigIntLiteral: {
const range = node_utils_1.getRange(node, this.ast);
const range = (0, node_utils_1.getRange)(node, this.ast);
const rawValue = this.ast.text.slice(range[0], range[1]);
const bigint = rawValue
// remove suffix `n`
@@ -1698,7 +1714,7 @@ class Converter {
selfClosing: true,
name: this.convertJSXTagName(node.tagName, node),
attributes: node.attributes.properties.map(el => this.convertChild(el)),
range: node_utils_1.getRange(node, this.ast),
range: (0, node_utils_1.getRange)(node, this.ast),
}),
closingElement: null,
children: [],
@@ -1754,32 +1770,16 @@ class Converter {
value: this.convertChild(node.initializer),
});
}
/**
* The JSX AST changed the node type for string literals
* inside a JSX Element from `Literal` to `JSXText`. We
* provide a flag to support both types until `Literal`
* node type is deprecated in ESLint v5.
*/
case SyntaxKind.JsxText: {
const start = node.getFullStart();
const end = node.getEnd();
const text = this.ast.text.slice(start, end);
if (this.options.useJSXTextNode) {
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.JSXText,
value: node_utils_1.unescapeStringLiteralText(text),
raw: text,
range: [start, end],
});
}
else {
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.Literal,
value: node_utils_1.unescapeStringLiteralText(text),
raw: text,
range: [start, end],
});
}
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.JSXText,
value: (0, node_utils_1.unescapeStringLiteralText)(text),
raw: text,
range: [start, end],
});
}
case SyntaxKind.JsxSpreadAttribute:
return this.createNode(node, {
@@ -1885,7 +1885,7 @@ class Converter {
result.readonly = true;
}
else {
result.readonly = node_utils_1.getTextForTokenKind(node.readonlyToken.kind);
result.readonly = (0, node_utils_1.getTextForTokenKind)(node.readonlyToken.kind);
}
}
if (node.questionToken) {
@@ -1893,7 +1893,7 @@ class Converter {
result.optional = true;
}
else {
result.optional = node_utils_1.getTextForTokenKind(node.questionToken.kind);
result.optional = (0, node_utils_1.getTextForTokenKind)(node.questionToken.kind);
}
}
if (node.type) {
@@ -1909,7 +1909,7 @@ class Converter {
id: this.convertChild(node.name),
typeAnnotation: this.convertType(node.type),
});
if (node_utils_1.hasModifier(SyntaxKind.DeclareKeyword, node)) {
if ((0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node)) {
result.declare = true;
}
// Process typeParameters
@@ -1926,18 +1926,18 @@ class Converter {
case SyntaxKind.PropertySignature: {
const result = this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.TSPropertySignature,
optional: node_utils_1.isOptional(node) || undefined,
computed: node_utils_1.isComputedProperty(node.name),
optional: (0, node_utils_1.isOptional)(node) || undefined,
computed: (0, node_utils_1.isComputedProperty)(node.name),
key: this.convertChild(node.name),
typeAnnotation: node.type
? this.convertTypeAnnotation(node.type, node)
: undefined,
initializer: this.convertChild(node.initializer) || undefined,
readonly: node_utils_1.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined,
static: node_utils_1.hasModifier(SyntaxKind.StaticKeyword, node) || undefined,
export: node_utils_1.hasModifier(SyntaxKind.ExportKeyword, node) || undefined,
readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node) || undefined,
static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node) || undefined,
export: (0, node_utils_1.hasModifier)(SyntaxKind.ExportKeyword, node) || undefined,
});
const accessibility = node_utils_1.getTSNodeAccessibility(node);
const accessibility = (0, node_utils_1.getTSNodeAccessibility)(node);
if (accessibility) {
result.accessibility = accessibility;
}
@@ -1951,17 +1951,17 @@ class Converter {
if (node.type) {
result.typeAnnotation = this.convertTypeAnnotation(node.type, node);
}
if (node_utils_1.hasModifier(SyntaxKind.ReadonlyKeyword, node)) {
if ((0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node)) {
result.readonly = true;
}
const accessibility = node_utils_1.getTSNodeAccessibility(node);
const accessibility = (0, node_utils_1.getTSNodeAccessibility)(node);
if (accessibility) {
result.accessibility = accessibility;
}
if (node_utils_1.hasModifier(SyntaxKind.ExportKeyword, node)) {
if ((0, node_utils_1.hasModifier)(SyntaxKind.ExportKeyword, node)) {
result.export = true;
}
if (node_utils_1.hasModifier(SyntaxKind.StaticKeyword, node)) {
if ((0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node)) {
result.static = true;
}
return result;
@@ -1970,7 +1970,7 @@ class Converter {
const result = this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.TSConstructorType,
params: this.convertParameters(node.parameters),
abstract: node_utils_1.hasModifier(SyntaxKind.AbstractKeyword, node),
abstract: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node),
});
if (node.type) {
result.returnType = this.convertTypeAnnotation(node.type, node);
@@ -2051,10 +2051,10 @@ class Converter {
result.implements = interfaceImplements;
}
}
if (node_utils_1.hasModifier(SyntaxKind.AbstractKeyword, node)) {
if ((0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node)) {
result.abstract = true;
}
if (node_utils_1.hasModifier(SyntaxKind.DeclareKeyword, node)) {
if ((0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node)) {
result.declare = true;
}
// check for exports
@@ -2130,10 +2130,7 @@ class Converter {
}
// TypeScript specific types
case SyntaxKind.ParenthesizedType: {
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.TSParenthesizedType,
typeAnnotation: this.convertType(node.type),
});
return this.convertType(node.type);
}
case SyntaxKind.UnionType: {
return this.createNode(node, {
@@ -2189,7 +2186,7 @@ class Converter {
id: this.convertChild(node.name),
moduleReference: this.convertChild(node.moduleReference),
importKind: node.isTypeOnly ? 'type' : 'value',
isExport: node_utils_1.hasModifier(SyntaxKind.ExportKeyword, node),
isExport: (0, node_utils_1.hasModifier)(SyntaxKind.ExportKeyword, node),
});
}
case SyntaxKind.ExternalModuleReference: {
@@ -2265,6 +2262,12 @@ class Converter {
});
return result;
}
case SyntaxKind.ClassStaticBlockDeclaration: {
return this.createNode(node, {
type: ts_estree_1.AST_NODE_TYPES.StaticBlock,
body: this.convertBodyExpressions(node.body.statements, node),
});
}
default:
return this.deeplyCopy(node);
}

File diff suppressed because one or more lines are too long

View File

@@ -27,7 +27,7 @@ const debug_1 = __importDefault(require("debug"));
const path_1 = __importDefault(require("path"));
const ts = __importStar(require("typescript"));
const shared_1 = require("./shared");
const log = debug_1.default('typescript-eslint:typescript-estree:createDefaultProgram');
const log = (0, debug_1.default)('typescript-eslint:typescript-estree:createDefaultProgram');
/**
* @param code The code of the file being linted
* @param extra The config object
@@ -41,14 +41,14 @@ function createDefaultProgram(code, extra) {
return undefined;
}
const tsconfigPath = extra.projects[0];
const commandLine = ts.getParsedCommandLineOfConfigFile(tsconfigPath, shared_1.createDefaultCompilerOptionsFromExtra(extra), Object.assign(Object.assign({}, ts.sys), { onUnRecoverableConfigFileDiagnostic: () => { } }));
const commandLine = ts.getParsedCommandLineOfConfigFile(tsconfigPath, (0, shared_1.createDefaultCompilerOptionsFromExtra)(extra), Object.assign(Object.assign({}, ts.sys), { onUnRecoverableConfigFileDiagnostic: () => { } }));
if (!commandLine) {
return undefined;
}
const compilerHost = ts.createCompilerHost(commandLine.options,
/* setParentNodes */ true);
if (extra.moduleResolver) {
compilerHost.resolveModuleNames = shared_1.getModuleResolver(extra.moduleResolver).resolveModuleNames;
compilerHost.resolveModuleNames = (0, shared_1.getModuleResolver)(extra.moduleResolver).resolveModuleNames;
}
const oldReadFile = compilerHost.readFile;
compilerHost.readFile = (fileName) => path_1.default.normalize(fileName) === path_1.default.normalize(extra.filePath)

View File

@@ -1 +1 @@
{"version":3,"file":"createDefaultProgram.js","sourceRoot":"","sources":["../../src/create-program/createDefaultProgram.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,+CAAiC;AAEjC,qCAKkB;AAElB,MAAM,GAAG,GAAG,eAAK,CAAC,0DAA0D,CAAC,CAAC;AAE9E;;;;;;GAMG;AACH,SAAS,oBAAoB,CAC3B,IAAY,EACZ,KAAY;IAEZ,GAAG,CAAC,iCAAiC,EAAE,KAAK,CAAC,QAAQ,IAAI,cAAc,CAAC,CAAC;IAEzE,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QAClD,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,YAAY,GAAkB,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEtD,MAAM,WAAW,GAAG,EAAE,CAAC,gCAAgC,CACrD,YAAY,EACZ,8CAAqC,CAAC,KAAK,CAAC,kCACvC,EAAE,CAAC,GAAG,KAAE,mCAAmC,EAAE,GAAG,EAAE,GAAE,CAAC,IAC3D,CAAC;IAEF,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,YAAY,GAAG,EAAE,CAAC,kBAAkB,CACxC,WAAW,CAAC,OAAO;IACnB,oBAAoB,CAAC,IAAI,CAC1B,CAAC;IAEF,IAAI,KAAK,CAAC,cAAc,EAAE;QACxB,YAAY,CAAC,kBAAkB,GAAG,0BAAiB,CACjD,KAAK,CAAC,cAAc,CACrB,CAAC,kBAAkB,CAAC;KACtB;IAED,MAAM,WAAW,GAAG,YA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AG,KAAE,mCAAmC,EAAE,GAAG,EAAE,GAAE,CAAC,IAC3D,CAAC;IAEF,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,YAAY,GAAG,EAAE,CAAC,kBAAkB,CACxC,WAAW,CAAC,OAAO;IACnB,oBAAoB,CAAC,IAAI,CAC1B,CAAC;IAEF,IAAI,KAAK,CAAC,cAAc,EAAE;QACxB,YAAY,CAAC,kBAAkB,GAAG,IAAA,0BAAiB,EACjD,KAAK,CAAC,cAAc,CACrB,CAAC,kBAAkB,CAAC;KACtB;IAED,MAAM,WAAW,GAAG,YAAY,CAAC,QAAQ,CAAC;IAC1C,YAAY,CAAC,QAAQ,GAAG,CAAC,QAAgB,EAAsB,EAAE,CAC/D,cAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,cAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;QACzD,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAE5B,MAAM,OAAO,GAAG,EAAE,CAAC,aAAa,CAC9B,CAAC,KAAK,CAAC,QAAQ,CAAC,EAChB,WAAW,CAAC,OAAO,EACnB,YAAY,CACb,CAAC;IACF,MAAM,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAElD,OAAO,GAAG,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AACjC,CAAC;AAEQ,oDAAoB"}

View File

@@ -26,7 +26,7 @@ exports.createIsolatedProgram = void 0;
const debug_1 = __importDefault(require("debug"));
const ts = __importStar(require("typescript"));
const shared_1 = require("./shared");
const log = debug_1.default('typescript-eslint:typescript-estree:createIsolatedProgram');
const log = (0, debug_1.default)('typescript-eslint:typescript-estree:createIsolatedProgram');
/**
* @param code The code of the file being linted
* @returns Returns a new source file and program corresponding to the linted code
@@ -55,7 +55,7 @@ function createIsolatedProgram(code, extra) {
},
getSourceFile(filename) {
return ts.createSourceFile(filename, code, ts.ScriptTarget.Latest,
/* setParentNodes */ true, shared_1.getScriptKind(extra, filename));
/* setParentNodes */ true, (0, shared_1.getScriptKind)(extra, filename));
},
readFile() {
return undefined;
@@ -67,7 +67,7 @@ function createIsolatedProgram(code, extra) {
return null;
},
};
const program = ts.createProgram([extra.filePath], Object.assign({ noResolve: true, target: ts.ScriptTarget.Latest, jsx: extra.jsx ? ts.JsxEmit.Preserve : undefined }, shared_1.createDefaultCompilerOptionsFromExtra(extra)), compilerHost);
const program = ts.createProgram([extra.filePath], Object.assign({ noResolve: true, target: ts.ScriptTarget.Latest, jsx: extra.jsx ? ts.JsxEmit.Preserve : undefined }, (0, shared_1.createDefaultCompilerOptionsFromExtra)(extra)), compilerHost);
const ast = program.getSourceFile(extra.filePath);
if (!ast) {
throw new Error('Expected an ast to be returned for the single-file isolated program.');

View File

@@ -1 +1 @@
{"version":3,"file":"createIsolatedProgram.js","sourceRoot":"","sources":["../../src/create-program/createIsolatedProgram.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+CAAiC;AAEjC,qCAIkB;AAElB,MAAM,GAAG,GAAG,eAAK,CAAC,2DAA2D,CAAC,CAAC;AAE/E;;;GAGG;AACH,SAAS,qBAAqB,CAAC,IAAY,EAAE,KAAY;IACvD,GAAG,CACD,6CAA6C,EAC7C,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EACxB,KAAK,CAAC,QAAQ,CACf,CAAC;IAEF,MAAM,YAAY,GAAoB;QACpC,UAAU;YACR,OAAO,IAAI,CAAC;QACd,CAAC;QACD,oBAAoB;YAClB,OAAO,KAAK,CAAC,QAAQ,CAAC;QACxB,CAAC;QACD,mBAAmB;YACjB,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,cAAc;YACZ,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,qBAAqB;YACnB,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,6BAA6B;QAC7B,UAAU;YACR,OAAO,IAAI,CAAC;QACd,CAAC;QACD,aAAa,CAAC,QAAgB;YAC5B,OAAO,EAAE,CAAC,gBAAgB,CACxB,QAAQ,EACR,IAAI,EACJ,EAAE,CAAC,YAAY,CAAC,MAAM;YACtB,oBAAoB,CAAC,IAAI,EACzB,sBAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAC/B,CAAC;QACJ,CAAC;QACD,QAAQ;YACN,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,yBAAyB;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,SAAS;YACP,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC;IAEF,MAAM,OAAO,GAAG,EAAE,CAAC,aAAa,CAC9B,CAAC,KAAK,CAAC,QAAQ,CAAC,kBAEd,SAAS,EAAE,IAAI,EACf,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAC9B,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,IAC7C,8CAAqC,CAAC,KAAK,CAAC,GAEjD,YAAY,CACb,CAAC;IAEF,MAAM,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,CAAC,GAAG,EAAE;QACR,MAAM,IAAI,KAAK,CACb,sEAAsE,CACvE,CAAC;KACH;IAED,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AAC1B,CAAC;AAEQ,sDAAqB"}
{"version":3,"file":"createIsolatedProgram.js","sourceRoot":"","sources":["../../src/create-program/createIsolatedProgram.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+CAAiC;AAEjC,qCAIkB;AAElB,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,2DAA2D,CAAC,CAAC;AA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F,MAAM,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,CAAC,GAAG,EAAE;QACR,MAAM,IAAI,KAAK,CACb,sEAAsE,CACvE,CAAC;KACH;IAED,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AAC1B,CAAC;AAEQ,sDAAqB"}

View File

@@ -9,7 +9,7 @@ const path_1 = __importDefault(require("path"));
const createWatchProgram_1 = require("./createWatchProgram");
const node_utils_1 = require("../node-utils");
const shared_1 = require("./shared");
const log = debug_1.default('typescript-eslint:typescript-estree:createProjectProgram');
const log = (0, debug_1.default)('typescript-eslint:typescript-estree:createProjectProgram');
const DEFAULT_EXTRA_FILE_EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx'];
/**
* @param code The code of the file being linted
@@ -19,7 +19,7 @@ const DEFAULT_EXTRA_FILE_EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx'];
*/
function createProjectProgram(code, createDefaultProgram, extra) {
log('Creating project program for: %s', extra.filePath);
const astAndProgram = node_utils_1.firstDefined(createWatchProgram_1.getProgramsForProjects(code, extra.filePath, extra), currentProgram => shared_1.getAstFromProgram(currentProgram, extra));
const astAndProgram = (0, node_utils_1.firstDefined)((0, createWatchProgram_1.getProgramsForProjects)(code, extra.filePath, extra), currentProgram => (0, shared_1.getAstFromProgram)(currentProgram, extra));
if (!astAndProgram && !createDefaultProgram) {
// the file was either not matched within the tsconfig, or the extension wasn't expected
const errorLines = [

View File

@@ -1 +1 @@
{"version":3,"file":"createProjectProgram.js","sourceRoot":"","sources":["../../src/create-program/createProjectProgram.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,6DAA8D;AAC9D,8CAA6C;AAE7C,qCAA4D;AAE5D,MAAM,GAAG,GAAG,eAAK,CAAC,0DAA0D,CAAC,CAAC;AAE9E,MAAM,6BAA6B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAA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CAAC;YACvF,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE;gBAClC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;oBAChD,UAAU,CAAC,IAAI,CACb,GAAG,cAAc,4EAA4E,CAC9F,CAAC;oBACF,iBAAiB,GAAG,IAAI,CAAC;iBAC1B;aACF;iBAAM;gBACL,UAAU,CAAC,IAAI,CACb,GAAG,cAAc,sEAAsE,CACxF,CAAC;gBACF,iBAAiB,GAAG,IAAI,CAAC;aAC1B;SACF;QAED,IAAI,CAAC,iBAAiB,EAAE;YACtB,UAAU,CAAC,IAAI,CACb,qEAAqE,CACtE,CAAC;SACH;QAED,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;KACxC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAEQ,oDAAoB"}
{"version":3,"file":"createProjectProgram.js","sourceRoot":"","sources":["../../src/create-program/createProjectProgram.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,6DAA8D;AAC9D,8CAA6C;AAE7C,qCAA4D;AAE5D,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,0DAA0D,CAAC,CAAC;AAE9E,MAAM,6BAA6B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAErE;;;;;GAKG;AACH,SAAS,oBAAoB,CAC3B,IAAY,EACZ,oBAA6B,EAC7B,KAAY;IAEZ,GAAG,CAAC,kCAAkC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAExD,MAAM,aAAa,GAAG,IAAA,yBAAY,EAChC,IAAA,2CAAsB,EAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,EACnD,cAAc,CAAC,EAAE,CAAC,IAAA,0BAAiB,EAAC,cAAc,EAAE,KAAK,CAAC,CAC3D,CAAC;IAEF,IAAI,C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AiB,EAAE;YACtB,UAAU,CAAC,IAAI,CACb,qEAAqE,CACtE,CAAC;SACH;QAED,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;KACxC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAEQ,oDAAoB"}

View File

@@ -26,11 +26,11 @@ exports.createSourceFile = void 0;
const debug_1 = __importDefault(require("debug"));
const ts = __importStar(require("typescript"));
const shared_1 = require("./shared");
const log = debug_1.default('typescript-eslint:typescript-estree:createSourceFile');
const log = (0, debug_1.default)('typescript-eslint:typescript-estree:createSourceFile');
function createSourceFile(code, extra) {
log('Getting AST without type information in %s mode for: %s', extra.jsx ? 'TSX' : 'TS', extra.filePath);
return ts.createSourceFile(extra.filePath, code, ts.ScriptTarget.Latest,
/* setParentNodes */ true, shared_1.getScriptKind(extra));
/* setParentNodes */ true, (0, shared_1.getScriptKind)(extra));
}
exports.createSourceFile = createSourceFile;
//# sourceMappingURL=createSourceFile.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"createSourceFile.js","sourceRoot":"","sources":["../../src/create-program/createSourceFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+CAAiC;AAEjC,qCAAyC;AAEzC,MAAM,GAAG,GAAG,eAAK,CAAC,sDAAsD,CAAC,CAAC;AAE1E,SAAS,gBAAgB,CAAC,IAAY,EAAE,KAAY;IAClD,GAAG,CACD,yDAAyD,EACzD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EACxB,KAAK,CAAC,QAAQ,CACf,CAAC;IAEF,OAAO,EAAE,CAAC,gBAAgB,CACxB,KAAK,CAAC,QAAQ,EACd,IAAI,EACJ,EAAE,CAAC,YAAY,CAAC,MAAM;IACtB,oBAAoB,CAAC,IAAI,EACzB,sBAAa,CAAC,KAAK,CAAC,CACrB,CAAC;AACJ,CAAC;AAEQ,4CAAgB"}
{"version":3,"file":"createSourceFile.js","sourceRoot":"","sources":["../../src/create-program/createSourceFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+CAAiC;AAEjC,qCAAyC;AAEzC,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,sDAAsD,CAAC,CAAC;AAE1E,SAAS,gBAAgB,CAAC,IAAY,EAAE,KAAY;IAClD,GAAG,CACD,yDAAyD,EACzD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EACxB,KAAK,CAAC,QAAQ,CACf,CAAC;IAEF,OAAO,EAAE,CAAC,gBAAgB,CACxB,KAAK,CAAC,QAAQ,EACd,IAAI,EACJ,EAAE,CAAC,YAAY,CAAC,MAAM;IACtB,oBAAoB,CAAC,IAAI,EACzB,IAAA,sBAAa,EAAC,KAAK,CAAC,CACrB,CAAC;AACJ,CAAC;AAEQ,4CAAgB"}

View File

@@ -28,7 +28,7 @@ const fs_1 = __importDefault(require("fs"));
const semver_1 = __importDefault(require("semver"));
const ts = __importStar(require("typescript"));
const shared_1 = require("./shared");
const log = debug_1.default('typescript-eslint:typescript-estree:createWatchProgram');
const log = (0, debug_1.default)('typescript-eslint:typescript-estree:createWatchProgram');
/**
* Maps tsconfig paths to their corresponding file contents and resulting watches
*/
@@ -63,7 +63,7 @@ function clearWatchCaches() {
exports.clearWatchCaches = clearWatchCaches;
function saveWatchCallback(trackingMap) {
return (fileName, callback) => {
const normalizedFileName = shared_1.getCanonicalFileName(fileName);
const normalizedFileName = (0, shared_1.getCanonicalFileName)(fileName);
const watchers = (() => {
let watchers = trackingMap.get(normalizedFileName);
if (!watchers) {
@@ -109,8 +109,8 @@ function createHash(content) {
}
function updateCachedFileList(tsconfigPath, program, extra) {
const fileList = extra.EXPERIMENTAL_useSourceOfProjectReferenceRedirect
? new Set(program.getSourceFiles().map(sf => shared_1.getCanonicalFileName(sf.fileName)))
: new Set(program.getRootFileNames().map(f => shared_1.getCanonicalFileName(f)));
? new Set(program.getSourceFiles().map(sf => (0, shared_1.getCanonicalFileName)(sf.fileName)))
: new Set(program.getRootFileNames().map(f => (0, shared_1.getCanonicalFileName)(f)));
programFileListCache.set(tsconfigPath, fileList);
return fileList;
}
@@ -123,7 +123,7 @@ function updateCachedFileList(tsconfigPath, program, extra) {
* @returns The programs corresponding to the supplied tsconfig paths
*/
function getProgramsForProjects(code, filePathIn, extra) {
const filePath = shared_1.getCanonicalFileName(filePathIn);
const filePath = (0, shared_1.getCanonicalFileName)(filePathIn);
const results = [];
// preserve reference to code and file being linted
currentLintOperationState.code = code;
@@ -204,15 +204,15 @@ const isRunningNoTimeoutFix = semver_1.default.satisfies(ts.version, '>=3.9.0-be
function createWatchProgram(tsconfigPath, extra) {
log('Creating watch program for %s.', tsconfigPath);
// create compiler host
const watchCompilerHost = ts.createWatchCompilerHost(tsconfigPath, shared_1.createDefaultCompilerOptionsFromExtra(extra), ts.sys, ts.createAbstractBuilder, diagnosticReporter,
const watchCompilerHost = ts.createWatchCompilerHost(tsconfigPath, (0, shared_1.createDefaultCompilerOptionsFromExtra)(extra), ts.sys, ts.createAbstractBuilder, diagnosticReporter,
/*reportWatchStatus*/ () => { });
if (extra.moduleResolver) {
watchCompilerHost.resolveModuleNames = shared_1.getModuleResolver(extra.moduleResolver).resolveModuleNames;
watchCompilerHost.resolveModuleNames = (0, shared_1.getModuleResolver)(extra.moduleResolver).resolveModuleNames;
}
// ensure readFile reads the code being linted instead of the copy on disk
const oldReadFile = watchCompilerHost.readFile;
watchCompilerHost.readFile = (filePathIn, encoding) => {
const filePath = shared_1.getCanonicalFileName(filePathIn);
const filePath = (0, shared_1.getCanonicalFileName)(filePathIn);
const fileContent = filePath === currentLintOperationState.filePath
? currentLintOperationState.code
: oldReadFile(filePath, encoding);
@@ -340,7 +340,7 @@ function maybeInvalidateProgram(existingWatch, filePath, tsconfigPath) {
*/
log('File was not found in program - triggering folder update. %s', filePath);
// Find the correct directory callback by climbing the folder tree
const currentDir = shared_1.canonicalDirname(filePath);
const currentDir = (0, shared_1.canonicalDirname)(filePath);
let current = null;
let next = currentDir;
let hasCallback = false;
@@ -356,7 +356,7 @@ function maybeInvalidateProgram(existingWatch, filePath, tsconfigPath) {
});
hasCallback = true;
}
next = shared_1.canonicalDirname(current);
next = (0, shared_1.canonicalDirname)(current);
}
if (!hasCallback) {
/*
@@ -389,7 +389,7 @@ function maybeInvalidateProgram(existingWatch, filePath, tsconfigPath) {
// There are no deleted files, so it must be the former case of the file not belonging to this program
return null;
}
const fileWatchCallbacks = fileWatchCallbackTrackingMap.get(shared_1.getCanonicalFileName(deletedFile));
const fileWatchCallbacks = fileWatchCallbackTrackingMap.get((0, shared_1.getCanonicalFileName)(deletedFile));
if (!fileWatchCallbacks) {
// shouldn't happen, but just in case
log('Could not find watch callbacks for root file. %s', deletedFile);

View File

@@ -28,12 +28,12 @@ const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const ts = __importStar(require("typescript"));
const shared_1 = require("./shared");
const log = debug_1.default('typescript-eslint:typescript-estree:useProvidedProgram');
const log = (0, debug_1.default)('typescript-eslint:typescript-estree:useProvidedProgram');
function useProvidedPrograms(programInstances, extra) {
log('Retrieving ast for %s from provided program instance(s)', extra.filePath);
let astAndProgram;
for (const programInstance of programInstances) {
astAndProgram = shared_1.getAstFromProgram(programInstance, extra);
astAndProgram = (0, shared_1.getAstFromProgram)(programInstance, extra);
// Stop at the first applicable program instance
if (astAndProgram) {
break;

View File

@@ -1 +1 @@
{"version":3,"file":"useProvidedPrograms.js","sourceRoot":"","sources":["../../src/create-program/useProvidedPrograms.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AAEjC,qCAIkB;AAElB,MAAM,GAAG,GAAG,eAAK,CAAC,wDAAwD,CAAC,CAAC;AAE5E,SAAS,mBAAmB,CAC1B,gB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AC,GAAG,EAAE;QACvE,aAAa,EAAE,EAAE,CAAC,GAAG,CAAC,aAAa;QACnC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC;QAChD,yBAAyB,EAAE,EAAE,CAAC,GAAG,CAAC,yBAAyB;KAC5D,CACF,CAAC;IACF,MAAM,MAAM,GAAG,MAAO,CAAC,CAAC,sDAAsD;IAC9E,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;KACnD;IACD,MAAM,IAAI,GAAG,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzD,OAAO,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC;AAU6B,kEAA2B;AARzD,SAAS,iBAAiB,CAAC,WAA4B;IACrD,OAAO,EAAE,CAAC,iBAAiB,CAAC,WAAW,EAAE;QACvC,oBAAoB,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAC5B,mBAAmB,EAAE,OAAO,CAAC,GAAG;QAChC,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI;KACvB,CAAC,CAAC;AACL,CAAC"}

View File

@@ -77,7 +77,7 @@ export declare function getBinaryExpressionType<T extends ts.SyntaxKind>(operato
* @param ast the AST object
* @returns line and column
*/
export declare function getLineAndCharacterFor(pos: number, ast: ts.SourceFile): TSESTree.LineAndColumnData;
export declare function getLineAndCharacterFor(pos: number, ast: ts.SourceFile): TSESTree.Position;
/**
* Returns line and column data for the given start and end positions,
* for the given AST
@@ -92,7 +92,7 @@ export declare function getLocFor(start: number, end: number, ast: ts.SourceFile
* @param node
* @returns returns true if node can contain directive
*/
export declare function canContainDirective(node: ts.SourceFile | ts.Block | ts.ModuleBlock): boolean;
export declare function canContainDirective(node: ts.SourceFile | ts.Block | ts.ModuleBlock | ts.ClassStaticBlockDeclaration): boolean;
/**
* Returns range for the given ts.Node
* @param node the ts.Node or ts.Token

View File

@@ -1 +1 @@
{"version":3,"file":"node-utils.d.ts","sourceRoot":"","sources":["../src/node-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGxE,QAAA,MAAM,UAAU,sBAAgB,CAAC;AAWjC,UAAU,WAAY,SAAQ,QAAQ,CAAC,qBAAqB;IAC1D,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC;IACrC,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC;IAC7B,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,YAAY,CAAC;IAC7C,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC;IAC/B,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IACnC,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IACzC,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC;CACtC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,EAAE,CAAC,UAAU,EAC1D,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GACpB,OAAO,CAKT;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,EAAE,CAAC,UAAU,EACvD,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,GACpB,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,EAAE,CAAC,UAAU,EACzD,IAAI,EAAE,CAAC,GACN,CAAC,SAAS,MAAM,WAAW,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because one or more lines are too long

View File

@@ -25,7 +25,6 @@ export interface Extra {
strict: boolean;
tokens: null | TSESTree.Token[];
tsconfigRootDir: string;
useJSXTextNode: boolean;
moduleResolver: string;
}
interface ParseOptions {
@@ -80,7 +79,6 @@ interface ParseOptions {
* Set to true to create a top-level array containing all tokens from the file.
*/
tokens?: boolean;
useJSXTextNode?: boolean;
}
interface ParseAndGenerateServicesOptions extends ParseOptions {
/**

View File

@@ -1 +1 @@
{"version":3,"file":"parser-options.d.ts","sourceRoot":"","sources":["../src/parser-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE1E,aAAK,WAAW,GAAG,mBAAmB,GAAG,QAAQ,GAAG,YAAY,CAAC;AAEjE,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,UAAU,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B,2CAA2C,EAAE,OAAO,CAAC;IACrD,qBAAqB,EAAE,OAAO,CAAC;IAC/B,gDAAgD,EAAE,OAAO,CAAC;IAC1D,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,Q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C;CAChE;AAED,iBAAS,KAAK,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EACxD,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,CAAC,GACV,GAAG,CAAC,CAAC,CAAC,CAGR;AA8DD,iBAAS,iBAAiB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EACpE,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,CAAC,GACV,uBAAuB,CAAC,CAAC,CAAC,CAE5B;AAID,iBAAS,kCAAkC,IAAI,IAAI,CAElD;AAED,iBAAS,wBAAwB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EAC3E,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,CAAC,GACT,8BAA8B,CAAC,CAAC,CAAC,CAsInC;AAED,OAAO,EACL,GAAG,EACH,KAAK,EACL,wBAAwB,EACxB,iBAAiB,EACjB,8BAA8B,EAC9B,uBAAuB,EACvB,iBAAiB,EACjB,kCAAkC,GACnC,CAAC"}

View File

@@ -38,17 +38,17 @@ const createSourceFile_1 = require("./create-program/createSourceFile");
const semantic_or_syntactic_errors_1 = require("./semantic-or-syntactic-errors");
const shared_1 = require("./create-program/shared");
const useProvidedPrograms_1 = require("./create-program/useProvidedPrograms");
const log = debug_1.default('typescript-eslint:typescript-estree:parser');
const log = (0, debug_1.default)('typescript-eslint:typescript-estree:parser');
/**
* This needs to be kept in sync with the top-level README.md in the
* typescript-eslint monorepo
*/
const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <4.4.0';
const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <4.5.0';
/*
* The semver package will ignore prerelease ranges, and we don't want to explicitly document every one
* List them all separately here, so we can automatically create the full string
*/
const SUPPORTED_PRERELEASE_RANGES = ['4.3.0-beta', '4.3.1-rc'];
const SUPPORTED_PRERELEASE_RANGES = ['4.4.0-beta', '4.4.1-rc'];
const ACTIVE_TYPESCRIPT_VERSION = ts.version;
const isRunningSupportedTypeScriptVersion = semver_1.default.satisfies(ACTIVE_TYPESCRIPT_VERSION, [SUPPORTED_TYPESCRIPT_VERSIONS]
.concat(SUPPORTED_PRERELEASE_RANGES)
@@ -82,13 +82,13 @@ function enforceString(code) {
* @returns Returns a source file and program corresponding to the linted code
*/
function getProgramAndAST(code, programInstances, shouldProvideParserServices, shouldCreateDefaultProgram) {
return ((programInstances && useProvidedPrograms_1.useProvidedPrograms(programInstances, extra)) ||
return ((programInstances && (0, useProvidedPrograms_1.useProvidedPrograms)(programInstances, extra)) ||
(shouldProvideParserServices &&
createProjectProgram_1.createProjectProgram(code, shouldCreateDefaultProgram, extra)) ||
(0, createProjectProgram_1.createProjectProgram)(code, shouldCreateDefaultProgram, extra)) ||
(shouldProvideParserServices &&
shouldCreateDefaultProgram &&
createDefaultProgram_1.createDefaultProgram(code, extra)) ||
createIsolatedProgram_1.createIsolatedProgram(code, extra));
(0, createDefaultProgram_1.createDefaultProgram)(code, extra)) ||
(0, createIsolatedProgram_1.createIsolatedProgram)(code, extra));
}
/**
* Compute the filename based on the parser options.
@@ -126,7 +126,6 @@ function resetExtra() {
strict: false,
tokens: null,
tsconfigRootDir: process.cwd(),
useJSXTextNode: false,
/**
* Unless we can reliably infer otherwise, we default to assuming that this run could be part
* of a long-running session (e.g. in an IDE) and watch programs will therefore be required
@@ -136,7 +135,7 @@ function resetExtra() {
};
}
function getTsconfigPath(tsconfigPath, extra) {
return shared_1.getCanonicalFileName(shared_1.ensureAbsolutePath(tsconfigPath, extra));
return (0, shared_1.getCanonicalFileName)((0, shared_1.ensureAbsolutePath)(tsconfigPath, extra));
}
/**
* Normalizes, sanitizes, resolves and filters the provided project paths
@@ -158,10 +157,10 @@ function prepareAndTransformProjects(projectsInput, ignoreListInput) {
return [];
}
// Transform glob patterns into paths
const nonGlobProjects = sanitizedProjects.filter(project => !is_glob_1.default(project));
const globProjects = sanitizedProjects.filter(project => is_glob_1.default(project));
const nonGlobProjects = sanitizedProjects.filter(project => !(0, is_glob_1.default)(project));
const globProjects = sanitizedProjects.filter(project => (0, is_glob_1.default)(project));
const uniqueCanonicalProjectPaths = new Set(nonGlobProjects
.concat(globby_1.sync([...globProjects, ...ignoreListInput], {
.concat((0, globby_1.sync)([...globProjects, ...ignoreListInput], {
cwd: extra.tsconfigRootDir,
}))
.map(project => getTsconfigPath(project, extra)));
@@ -226,16 +225,6 @@ function applyParserOptionsToExtra(options) {
else {
extra.filePath = getFileName(extra);
}
/**
* The JSX AST changed the node type for string literals
* inside a JSX Element from `Literal` to `JSXText`.
*
* When value is `true`, these nodes will be parsed as type `JSXText`.
* When value is `false`, these nodes will be parsed as type `Literal`.
*/
if (typeof options.useJSXTextNode === 'boolean' && options.useJSXTextNode) {
extra.useJSXTextNode = true;
}
/**
* Allow the user to cause the parser to error if it encounters an unknown AST Node Type
* (used in testing)
@@ -257,7 +246,7 @@ function applyParserOptionsToExtra(options) {
extra.tsconfigRootDir = options.tsconfigRootDir;
}
// NOTE - ensureAbsolutePath relies upon having the correct tsconfigRootDir in extra
extra.filePath = shared_1.ensureAbsolutePath(extra.filePath, extra);
extra.filePath = (0, shared_1.ensureAbsolutePath)(extra.filePath, extra);
if (Array.isArray(options.programs)) {
if (!options.programs.length) {
throw new Error(`You have set parserOptions.programs to an empty array. This will cause all files to not be found in existing programs. Either provide one or more existing TypeScript Program instances in the array, or remove the parserOptions.programs setting.`);
@@ -346,7 +335,7 @@ function inferSingleRun(options) {
// Default to single runs for CI processes. CI=true is set by most CI providers by default.
process.env.CI === 'true' ||
// This will be true for invocations such as `npx eslint ...` and `./node_modules/.bin/eslint ...`
process.argv[1].endsWith(path_1.normalize('node_modules/.bin/eslint'))) {
process.argv[1].endsWith((0, path_1.normalize)('node_modules/.bin/eslint'))) {
extra.singleRun = true;
return;
}
@@ -396,11 +385,11 @@ function parseWithNodeMapsInternal(code, options, shouldPreserveNodeMaps) {
* Create a ts.SourceFile directly, no ts.Program is needed for a simple
* parse
*/
const ast = createSourceFile_1.createSourceFile(code, extra);
const ast = (0, createSourceFile_1.createSourceFile)(code, extra);
/**
* Convert the TypeScript AST to an ESTree-compatible one
*/
const { estree, astMaps } = ast_converter_1.astConverter(ast, extra, shouldPreserveNodeMaps);
const { estree, astMaps } = (0, ast_converter_1.astConverter)(ast, extra, shouldPreserveNodeMaps);
return {
ast: estree,
esTreeNodeToTSNodeMap: astMaps.esTreeNodeToTSNodeMap,
@@ -462,7 +451,7 @@ function parseAndGenerateServices(code, options) {
}
else {
log('Detected single-run/CLI usage, creating Program once ahead of time for project: %s', configFile);
const newProgram = useProvidedPrograms_1.createProgramFromConfigFile(configFile);
const newProgram = (0, useProvidedPrograms_1.createProgramFromConfigFile)(configFile);
existingPrograms.set(configFile, newProgram);
yield newProgram;
}
@@ -491,7 +480,7 @@ function parseAndGenerateServices(code, options) {
if (extra.singleRun &&
options.filePath &&
parseAndGenerateServicesCalls[options.filePath] > 1) {
const isolatedAstAndProgram = createIsolatedProgram_1.createIsolatedProgram(code, extra);
const isolatedAstAndProgram = (0, createIsolatedProgram_1.createIsolatedProgram)(code, extra);
ast = isolatedAstAndProgram.ast;
program = isolatedAstAndProgram.program;
}
@@ -505,15 +494,15 @@ function parseAndGenerateServices(code, options) {
* mappings between converted and original AST nodes
*/
const preserveNodeMaps = typeof extra.preserveNodeMaps === 'boolean' ? extra.preserveNodeMaps : true;
const { estree, astMaps } = ast_converter_1.astConverter(ast, extra, preserveNodeMaps);
const { estree, astMaps } = (0, ast_converter_1.astConverter)(ast, extra, preserveNodeMaps);
/**
* Even if TypeScript parsed the source code ok, and we had no problems converting the AST,
* there may be other syntactic or semantic issues in the code that we can optionally report on.
*/
if (program && extra.errorOnTypeScriptSyntacticAndSemanticIssues) {
const error = semantic_or_syntactic_errors_1.getFirstSemanticOrSyntacticError(program, ast);
const error = (0, semantic_or_syntactic_errors_1.getFirstSemanticOrSyntacticError)(program, ast);
if (error) {
throw convert_1.convertError(error);
throw (0, convert_1.convertError)(error);
}
}
/**

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