diff --git a/.all-contributorsrc b/.all-contributorsrc index 1c5c3a5adcdb..3223dd887fc0 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -9,334 +9,376 @@ "imageSize": 100, "commit": false, "contributors": [ - { - "login": "JamesHenry", - "name": "James Henry", - "avatar_url": "https://avatars1.githubusercontent.com/u/900523?v=4", - "profile": "https://github.com/JamesHenry", - "contributions": [] - }, { "login": "bradzacher", "name": "Brad Zacher", - "avatar_url": "https://avatars1.githubusercontent.com/u/7462525?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/7462525?v=4", "profile": "https://github.com/bradzacher", "contributions": [] }, + { + "login": "JamesHenry", + "name": "James Henry", + "avatar_url": "https://avatars.githubusercontent.com/u/900523?v=4", + "profile": "https://github.com/JamesHenry", + "contributions": [] + }, { "login": "armano2", "name": "Armano", - "avatar_url": "https://avatars1.githubusercontent.com/u/625469?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/625469?v=4", "profile": "https://github.com/armano2", "contributions": [] }, { "login": "a-tarasyuk", - "name": "Alexander T.", - "avatar_url": "https://avatars0.githubusercontent.com/u/509265?v=4", + "name": "Oleksandr T.", + "avatar_url": "https://avatars.githubusercontent.com/u/509265?v=4", "profile": "https://github.com/a-tarasyuk", "contributions": [] }, { "login": "soda0289", "name": "Reyad Attiyat", - "avatar_url": "https://avatars1.githubusercontent.com/u/2373964?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/2373964?v=4", "profile": "https://github.com/soda0289", "contributions": [] }, { "login": "weirdpattern", "name": "Patricio Trevino", - "avatar_url": "https://avatars0.githubusercontent.com/u/19519411?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/19519411?v=4", "profile": "https://github.com/weirdpattern", "contributions": [] }, { "login": "G-Rath", "name": "Gareth Jones", - "avatar_url": "https://avatars2.githubusercontent.com/u/3151613?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/3151613?v=4", "profile": "https://github.com/G-Rath", "contributions": [] }, { "login": "nzakas", "name": "Nicholas C. Zakas", - "avatar_url": "https://avatars3.githubusercontent.com/u/38546?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/38546?v=4", "profile": "https://github.com/nzakas", "contributions": [] }, { "login": "j-f1", "name": "Jed Fox", - "avatar_url": "https://avatars2.githubusercontent.com/u/25517624?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/25517624?v=4", "profile": "https://github.com/j-f1", "contributions": [] }, + { + "login": "JoshuaKGoldberg", + "name": "Josh Goldberg", + "avatar_url": "https://avatars.githubusercontent.com/u/3335181?v=4", + "profile": "https://github.com/JoshuaKGoldberg", + "contributions": [] + }, { "login": "uniqueiniquity", "name": "Ben Lichtman", - "avatar_url": "https://avatars1.githubusercontent.com/u/9092011?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/9092011?v=4", "profile": "https://github.com/uniqueiniquity", "contributions": [] }, { - "login": "JoshuaKGoldberg", - "name": "Josh Goldberg", - "avatar_url": "https://avatars1.githubusercontent.com/u/3335181?v=4", - "profile": "https://github.com/JoshuaKGoldberg", + "login": "yeonjuan", + "name": "YeonJuan", + "avatar_url": "https://avatars.githubusercontent.com/u/41323220?v=4", + "profile": "https://github.com/yeonjuan", "contributions": [] }, { "login": "scottohara", "name": "Scott O'Hara", - "avatar_url": "https://avatars3.githubusercontent.com/u/289327?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/289327?v=4", "profile": "https://github.com/scottohara", "contributions": [] }, { "login": "Retsam", "name": "Retsam", - "avatar_url": "https://avatars0.githubusercontent.com/u/2281166?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/2281166?v=4", "profile": "https://github.com/Retsam", "contributions": [] }, { - "login": "yeonjuan", - "name": "YeonJuan", - "avatar_url": "https://avatars3.githubusercontent.com/u/41323220?v=4", - "profile": "https://github.com/yeonjuan", + "login": "sosukesuzuki", + "name": "Sosuke Suzuki", + "avatar_url": "https://avatars.githubusercontent.com/u/14838850?v=4", + "profile": "https://github.com/sosukesuzuki", "contributions": [] }, { "login": "kaicataldo", "name": "Kai Cataldo", - "avatar_url": "https://avatars2.githubusercontent.com/u/7041728?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/7041728?v=4", "profile": "https://github.com/kaicataldo", "contributions": [] }, { "login": "Pajn", "name": "Rasmus Eneman", - "avatar_url": "https://avatars1.githubusercontent.com/u/817422?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/817422?v=4", "profile": "https://github.com/Pajn", "contributions": [] }, { "login": "mysticatea", "name": "Toru Nagashima", - "avatar_url": "https://avatars2.githubusercontent.com/u/1937871?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/1937871?v=4", "profile": "https://github.com/mysticatea", "contributions": [] }, + { + "login": "phaux", + "name": "Nikita Stefaniak", + "avatar_url": "https://avatars.githubusercontent.com/u/1270987?v=4", + "profile": "https://github.com/phaux", + "contributions": [] + }, { "login": "azz", "name": "Lucas Azzola", - "avatar_url": "https://avatars3.githubusercontent.com/u/1297597?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/1297597?v=4", "profile": "https://github.com/azz", "contributions": [] }, { "login": "dannyfritz", "name": "Danny Fritz", - "avatar_url": "https://avatars1.githubusercontent.com/u/315788?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/315788?v=4", "profile": "https://github.com/dannyfritz", "contributions": [] }, { "login": "ikatyang", "name": "Ika", - "avatar_url": "https://avatars1.githubusercontent.com/u/8341033?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/8341033?v=4", "profile": "https://github.com/ikatyang", "contributions": [] }, { "login": "macklinu", "name": "mackie", - "avatar_url": "https://avatars1.githubusercontent.com/u/2344137?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/2344137?v=4", "profile": "https://github.com/macklinu", "contributions": [] }, - { - "login": "phaux", - "name": "Nikita Stefaniak", - "avatar_url": "https://avatars1.githubusercontent.com/u/1270987?v=4", - "profile": "https://github.com/phaux", - "contributions": [] - }, { "login": "lukyth", "name": "Kanitkorn Sujautra", - "avatar_url": "https://avatars3.githubusercontent.com/u/7040242?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/7040242?v=4", "profile": "https://github.com/lukyth", "contributions": [] }, + { + "login": "cherryblossom000", + "name": "cherryblossom000", + "avatar_url": "https://avatars.githubusercontent.com/u/31467609?v=4", + "profile": "https://github.com/cherryblossom000", + "contributions": [] + }, + { + "login": "SimenB", + "name": "Simen Bekkhus", + "avatar_url": "https://avatars.githubusercontent.com/u/1404810?v=4", + "profile": "https://github.com/SimenB", + "contributions": [] + }, { "login": "anikethsaha", "name": "Anix", - "avatar_url": "https://avatars1.githubusercontent.com/u/26347874?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/26347874?v=4", "profile": "https://github.com/anikethsaha", "contributions": [] }, { "login": "octogonz", "name": "Pete Gonzalez", - "avatar_url": "https://avatars0.githubusercontent.com/u/4673363?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/4673363?v=4", "profile": "https://github.com/octogonz", "contributions": [] }, { "login": "ldrick", "name": "Ricky Lippmann", - "avatar_url": "https://avatars3.githubusercontent.com/u/3674067?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/3674067?v=4", "profile": "https://github.com/ldrick", "contributions": [] }, { - "login": "SimenB", - "name": "Simen Bekkhus", - "avatar_url": "https://avatars1.githubusercontent.com/u/1404810?v=4", - "profile": "https://github.com/SimenB", - "contributions": [] - }, - { - "login": "cherryblossom000", - "name": "cherryblossom000", - "avatar_url": "https://avatars2.githubusercontent.com/u/31467609?v=4", - "profile": "https://github.com/cherryblossom000", + "login": "susisu", + "name": "Susisu", + "avatar_url": "https://avatars.githubusercontent.com/u/2443491?v=4", + "profile": "https://github.com/susisu", "contributions": [] }, { "login": "vapurrmaid", "name": "G r e y", - "avatar_url": "https://avatars0.githubusercontent.com/u/11184711?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/11184711?v=4", "profile": "https://github.com/vapurrmaid", "contributions": [] }, { "login": "gavinbarron", "name": "Gavin Barron", - "avatar_url": "https://avatars2.githubusercontent.com/u/7122716?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/7122716?v=4", "profile": "https://github.com/gavinbarron", "contributions": [] }, { "login": "platinumazure", "name": "Kevin Partington", - "avatar_url": "https://avatars0.githubusercontent.com/u/284282?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/284282?v=4", "profile": "https://github.com/platinumazure", "contributions": [] }, { "login": "duailibe", "name": "Lucas Duailibe", - "avatar_url": "https://avatars3.githubusercontent.com/u/1574588?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/1574588?v=4", "profile": "https://github.com/duailibe", "contributions": [] }, { "login": "Validark", - "name": "Niles", - "avatar_url": "https://avatars2.githubusercontent.com/u/15217173?v=4", + "name": "Validark", + "avatar_url": "https://avatars.githubusercontent.com/u/15217173?v=4", "profile": "https://github.com/Validark", "contributions": [] }, { "login": "pablobirukov", "name": "Pavel Birukov ", - "avatar_url": "https://avatars2.githubusercontent.com/u/1861546?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/1861546?v=4", "profile": "https://github.com/pablobirukov", "contributions": [] }, { "login": "mightyiam", "name": "Shahar Dawn Or", - "avatar_url": "https://avatars2.githubusercontent.com/u/635591?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/635591?v=4", "profile": "https://github.com/mightyiam", "contributions": [] }, - { - "login": "sosukesuzuki", - "name": "Sosuke Suzuki", - "avatar_url": "https://avatars1.githubusercontent.com/u/14838850?v=4", - "profile": "https://github.com/sosukesuzuki", - "contributions": [] - }, { "login": "ulrichb", "name": "ulrichb", - "avatar_url": "https://avatars3.githubusercontent.com/u/388796?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/388796?v=4", "profile": "https://github.com/ulrichb", "contributions": [] }, + { + "login": "ddubrava", + "name": "Daniil Dubrava", + "avatar_url": "https://avatars.githubusercontent.com/u/22116465?v=4", + "profile": "https://github.com/ddubrava", + "contributions": [] + }, + { + "login": "danielnixon", + "name": "Daniel Nixon", + "avatar_url": "https://avatars.githubusercontent.com/u/6418489?v=4", + "profile": "https://github.com/danielnixon", + "contributions": [] + }, { "login": "webschik", "name": "Denys Kniazevych", - "avatar_url": "https://avatars2.githubusercontent.com/u/1665314?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/1665314?v=4", "profile": "https://github.com/webschik", "contributions": [] }, { "login": "dimitropoulos", "name": "Dimitri Mitropoulos", - "avatar_url": "https://avatars2.githubusercontent.com/u/15232461?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/15232461?v=4", "profile": "https://github.com/dimitropoulos", "contributions": [] }, { "login": "nevir", "name": "Ian MacLeod", - "avatar_url": "https://avatars1.githubusercontent.com/u/41373?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/41373?v=4", "profile": "https://github.com/nevir", "contributions": [] }, { "login": "jonathanrdelgado", "name": "Jonathan Delgado", - "avatar_url": "https://avatars2.githubusercontent.com/u/1841149?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/1841149?v=4", "profile": "https://github.com/jonathanrdelgado", "contributions": [] }, { "login": "flying-sheep", "name": "Philipp A.", - "avatar_url": "https://avatars0.githubusercontent.com/u/291575?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/291575?v=4", "profile": "https://github.com/flying-sheep", "contributions": [] }, { "login": "g-plane", "name": "Pig Fang", - "avatar_url": "https://avatars1.githubusercontent.com/u/17216317?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/17216317?v=4", "profile": "https://github.com/g-plane", "contributions": [] }, { - "login": "susisu", - "name": "Susisu", - "avatar_url": "https://avatars0.githubusercontent.com/u/2443491?v=4", - "profile": "https://github.com/susisu", + "login": "tadhgmister", + "name": "Tadhg McDonald-Jensen", + "avatar_url": "https://avatars.githubusercontent.com/u/18615763?v=4", + "profile": "https://github.com/tadhgmister", "contributions": [] }, { "login": "ThomasdenH", "name": "Thomas den Hollander", - "avatar_url": "https://avatars0.githubusercontent.com/u/3889750?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/3889750?v=4", "profile": "https://github.com/ThomasdenH", "contributions": [] }, { "login": "timkraut", "name": "Tim Kraut", - "avatar_url": "https://avatars2.githubusercontent.com/u/509669?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/509669?v=4", "profile": "https://github.com/timkraut", "contributions": [] }, + { + "login": "koooge", + "name": "koooge", + "avatar_url": "https://avatars.githubusercontent.com/u/7419215?v=4", + "profile": "https://github.com/koooge", + "contributions": [] + }, + { + "login": "thomasmichaelwallace", + "name": "thomas michael wallace", + "avatar_url": "https://avatars.githubusercontent.com/u/1954845?v=4", + "profile": "https://github.com/thomasmichaelwallace", + "contributions": [] + }, { "login": "madbence", "name": "Bence Dányi", - "avatar_url": "https://avatars2.githubusercontent.com/u/296735?v=4", + "avatar_url": "https://avatars.githubusercontent.com/u/296735?v=4", "profile": "https://github.com/madbence", "contributions": [] + }, + { + "login": "soobing", + "name": "Soobin Bak", + "avatar_url": "https://avatars.githubusercontent.com/u/16860535?v=4", + "profile": "https://github.com/soobing", + "contributions": [] } ], "contributorsPerLine": 5 diff --git a/.codecov.yml b/.codecov.yml index 750d876773d3..c9b8006f4961 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,3 +1,8 @@ +codecov: + require_ci_to_pass: no + notify: + wait_for_ci: no + coverage: status: patch: @@ -7,7 +12,7 @@ coverage: default: target: auto threshold: 2% + comment: layout: diff, flags, files require_changes: true - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06c9a254d6ae..0986c2df8f6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,6 +60,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 2 - name: echo github.ref run: echo ${{ github.ref }} @@ -142,7 +144,6 @@ jobs: - name: Publish code coverage report uses: codecov/codecov-action@v1 with: - yml: ./codecov.yml token: ${{ secrets.CODECOV_TOKEN }} flags: unittest name: codecov diff --git a/.husky/.gitignore b/.husky/.gitignore index 31354ec13899..c9cdc63b0701 100644 --- a/.husky/.gitignore +++ b/.husky/.gitignore @@ -1 +1 @@ -_ +_ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 95960d812457..7cfdbf8471aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) + + +### Bug Fixes + +* **typescript-estree:** correct issues in AST definition ([#3083](https://github.com/typescript-eslint/typescript-eslint/issues/3083)) ([509a117](https://github.com/typescript-eslint/typescript-eslint/commit/509a11749f85400a01e9fecfecd12871ce562d3d)) +* add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) +* **eslint-plugin:** [no-var-requires] report when used in type assertion ([#3074](https://github.com/typescript-eslint/typescript-eslint/issues/3074)) ([763a252](https://github.com/typescript-eslint/typescript-eslint/commit/763a2520bfea09c3b6252ea36bc3ff10b05eca6c)) +* correct test names on windows for semantic-diagnostics-enabled ([#3060](https://github.com/typescript-eslint/typescript-eslint/issues/3060)) ([885780d](https://github.com/typescript-eslint/typescript-eslint/commit/885780d4a2b07e418256b7323d76b18453c14a50)) + + + + + ## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9190a32dd518..5616c037282c 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -7,71 +7,79 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/all-contri - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - + + + + + + + + + +

James Henry


Brad Zacher


Armano


Alexander T.


Reyad Attiyat


Brad Zacher


James Henry


Armano


Oleksandr T.


Reyad Attiyat


Patricio Trevino


Gareth Jones


Nicholas C. Zakas


Jed Fox


Ben Lichtman


Patricio Trevino


Gareth Jones


Nicholas C. Zakas


Jed Fox


Josh Goldberg


Josh Goldberg


Scott O'Hara


Retsam


YeonJuan


Kai Cataldo


Ben Lichtman


YeonJuan


Scott O'Hara


Retsam


Sosuke Suzuki


Rasmus Eneman


Toru Nagashima


Lucas Azzola


Danny Fritz


Ika


Kai Cataldo


Rasmus Eneman


Toru Nagashima


Nikita Stefaniak


Lucas Azzola


mackie


Nikita Stefaniak


Kanitkorn Sujautra


Anix


Pete Gonzalez


Danny Fritz


Ika


mackie


Kanitkorn Sujautra


cherryblossom000


Ricky Lippmann


Simen Bekkhus


cherryblossom000


G r e y


Gavin Barron


Simen Bekkhus


Anix


Pete Gonzalez


Ricky Lippmann


Susisu


Kevin Partington


Lucas Duailibe


Niles


Pavel Birukov


Shahar Dawn Or


G r e y


Gavin Barron


Kevin Partington


Lucas Duailibe


Validark


Sosuke Suzuki


ulrichb


Denys Kniazevych


Dimitri Mitropoulos


Ian MacLeod


Pavel Birukov


Shahar Dawn Or


ulrichb


Daniil Dubrava


Daniel Nixon


Jonathan Delgado


Philipp A.


Pig Fang


Susisu


Thomas den Hollander


Denys Kniazevych


Dimitri Mitropoulos


Ian MacLeod


Jonathan Delgado


Philipp A.


Tim Kraut


Bence Dányi


Pig Fang


Tadhg McDonald-Jensen


Thomas den Hollander


Tim Kraut


koooge


thomas michael wallace


Bence Dányi


Soobin Bak

diff --git a/lerna.json b/lerna.json index ff66965222ec..0050e613058f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "4.15.1", + "version": "4.15.2", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index 5577478b5689..791472ff0f27 100644 --- a/packages/eslint-plugin-internal/CHANGELOG.md +++ b/packages/eslint-plugin-internal/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal + + + + + ## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 0fbf66d168e0..2b61e189358c 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-internal", - "version": "4.15.1", + "version": "4.15.2", "private": true, "main": "dist/index.js", "scripts": { @@ -14,7 +14,7 @@ }, "dependencies": { "@types/prettier": "*", - "@typescript-eslint/experimental-utils": "4.15.1", + "@typescript-eslint/experimental-utils": "4.15.2", "prettier": "*" } } diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index 9bc6b6d12719..1f434ac3c804 100644 --- a/packages/eslint-plugin-tslint/CHANGELOG.md +++ b/packages/eslint-plugin-tslint/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + ## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index 434bb7af25d1..145bcde18fa7 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-tslint", - "version": "4.15.1", + "version": "4.15.2", "main": "dist/index.js", "typings": "src/index.ts", "description": "TSLint wrapper plugin for ESLint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "4.15.1", + "@typescript-eslint/experimental-utils": "4.15.2", "lodash": "^4.17.15" }, "peerDependencies": { @@ -48,6 +48,6 @@ }, "devDependencies": { "@types/lodash": "*", - "@typescript-eslint/parser": "4.15.1" + "@typescript-eslint/parser": "4.15.2" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 0c5c7b5d1bc5..a9235398567e 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) + + +### Bug Fixes + +* **typescript-estree:** correct issues in AST definition ([#3083](https://github.com/typescript-eslint/typescript-eslint/issues/3083)) ([509a117](https://github.com/typescript-eslint/typescript-eslint/commit/509a11749f85400a01e9fecfecd12871ce562d3d)) +* add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) +* **eslint-plugin:** [no-var-requires] report when used in type assertion ([#3074](https://github.com/typescript-eslint/typescript-eslint/issues/3074)) ([763a252](https://github.com/typescript-eslint/typescript-eslint/commit/763a2520bfea09c3b6252ea36bc3ff10b05eca6c)) + + + + + ## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index d43413677504..afea64deacba 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "4.15.1", + "version": "4.15.2", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -42,8 +42,8 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "4.15.1", - "@typescript-eslint/scope-manager": "4.15.1", + "@typescript-eslint/experimental-utils": "4.15.2", + "@typescript-eslint/scope-manager": "4.15.2", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "lodash": "^4.17.15", diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index 968c8d51b54e..79709e1df1ee 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -408,10 +408,12 @@ export default util.createRule({ return cached; } - for (const statement of node.body?.body ?? []) { - if (statement.type === AST_NODE_TYPES.TSExportAssignment) { - MODULE_DECL_CACHE.set(node, true); - return true; + if (node.body && node.body.type === AST_NODE_TYPES.TSModuleBlock) { + for (const statement of node.body.body) { + if (statement.type === AST_NODE_TYPES.TSExportAssignment) { + MODULE_DECL_CACHE.set(node, true); + return true; + } } } diff --git a/packages/eslint-plugin/src/rules/no-var-requires.ts b/packages/eslint-plugin/src/rules/no-var-requires.ts index 6b958d47ec2a..26c49cc9dd2f 100644 --- a/packages/eslint-plugin/src/rules/no-var-requires.ts +++ b/packages/eslint-plugin/src/rules/no-var-requires.ts @@ -37,6 +37,7 @@ export default util.createRule({ (parent.type === AST_NODE_TYPES.VariableDeclarator || parent.type === AST_NODE_TYPES.CallExpression || parent.type === AST_NODE_TYPES.TSAsExpression || + parent.type === AST_NODE_TYPES.TSTypeAssertion || parent.type === AST_NODE_TYPES.MemberExpression) ) { context.report({ diff --git a/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts b/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts index ff4a4d1ac800..fb83da6f318b 100644 --- a/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts +++ b/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts @@ -49,6 +49,7 @@ function getGroup(node: TSESTree.TypeNode): Group { case AST_NODE_TYPES.TSSymbolKeyword: case AST_NODE_TYPES.TSThisType: case AST_NODE_TYPES.TSUnknownKeyword: + case AST_NODE_TYPES.TSIntrinsicKeyword: return Group.keyword; case AST_NODE_TYPES.TSNullKeyword: diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts index edfa8abadd20..6f3baa3fa1a1 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts @@ -100,8 +100,10 @@ class Foo { 'const x: Set = new Set();', 'const x: Set = new Set();', 'const [x] = [1];', + 'const [x, y] = [1, 2] as number[];', 'const [x, ...y] = [1, 2, 3, 4, 5];', 'const [x, ...y] = [1];', + 'const [{ ...x }] = [{ x: 1 }] as [{ x: any }];', 'function foo(x = 1) {}', 'function foo([x] = [1]) {}', 'function foo([x, ...y] = [1, 2, 3, 4, 5]) {}', @@ -109,8 +111,11 @@ class Foo { // this is not checked, because there's no annotation to compare it with 'const x = new Set();', 'const x = { y: 1 };', + 'const x = { y = 1 };', + 'const x = { y(); };', 'const x: { y: number } = { y: 1 };', 'const x = [...[1, 2, 3]];', + 'const [{ [`x${1}`]: x }] = [{ [`x`]: 1 }] as [{ [`x`]: any }];', { code: ` type Props = { a: string }; @@ -119,15 +124,23 @@ declare function Foo(props: Props): never; `, filename: 'react.tsx', }, - ` - const x: unknown = y as any; - `, - ` - const x: unknown[] = y as any[]; - `, - ` - const x: Set = y as Set; - `, + { + code: ` +declare function Foo(props: { a: string }): never; +; + `, + filename: 'react.tsx', + }, + { + code: ` +declare function Foo(props: { a: string }): never; +; + `, + filename: 'react.tsx', + }, + 'const x: unknown = y as any;', + 'const x: unknown[] = y as any[];', + 'const x: Set = y as Set;', ], invalid: [ ...batchedSingleLineTests({ @@ -238,6 +251,8 @@ const x: Set>> = new Set>>(); ['[[[[x]]]] = [[[[1 as any]]]]', 5, 6], ['[[[[x]]]] = [1 as any]', 2, 9, true], ['[{x}] = [{x: 1}] as [{x: any}]', 3, 4], + ['[{["x"]: x}] = [{["x"]: 1}] as [{["x"]: any}]', 10, 11], + ['[{[`x`]: x}] = [{[`x`]: 1}] as [{[`x`]: any}]', 10, 11], ]), { // TS treats the assignment pattern weirdly in this case diff --git a/packages/eslint-plugin/tests/rules/no-var-requires.test.ts b/packages/eslint-plugin/tests/rules/no-var-requires.test.ts index 3ae5e243154c..688b010e4178 100644 --- a/packages/eslint-plugin/tests/rules/no-var-requires.test.ts +++ b/packages/eslint-plugin/tests/rules/no-var-requires.test.ts @@ -112,6 +112,16 @@ ruleTester.run('no-var-requires', rule, { }, ], }, + { + code: "const foo = require('./foo.json');", + errors: [ + { + messageId: 'noVarReqs', + line: 1, + column: 18, + }, + ], + }, { code: "const foo: Foo = require('./foo.json').default;", errors: [ diff --git a/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts b/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts index bcf07490e61d..7dda416d6b3d 100644 --- a/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts +++ b/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts @@ -43,10 +43,13 @@ const valid = (operator: '|' | '&'): TSESLint.ValidTestCase[] => [ type T = ${operator} A ${operator} B + ${operator} intrinsic ${operator} number[] ${operator} string[] ${operator} any ${operator} string + ${operator} symbol + ${operator} this ${operator} readonly number[] ${operator} readonly string[] ${operator} 'a' diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index ce702a002ec5..572aad8c758b 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + ## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) **Note:** Version bump only for package @typescript-eslint/experimental-utils diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json index c72262784d7c..78b70d58ae43 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "4.15.1", + "version": "4.15.2", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -40,9 +40,9 @@ }, "dependencies": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.15.1", - "@typescript-eslint/types": "4.15.1", - "@typescript-eslint/typescript-estree": "4.15.1", + "@typescript-eslint/scope-manager": "4.15.2", + "@typescript-eslint/types": "4.15.2", + "@typescript-eslint/typescript-estree": "4.15.2", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 0cb454e2077b..9de839c086a4 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + ## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) **Note:** Version bump only for package @typescript-eslint/parser diff --git a/packages/parser/package.json b/packages/parser/package.json index b631312e7cee..d209f7a97e18 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "4.15.1", + "version": "4.15.2", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -44,14 +44,14 @@ "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "4.15.1", - "@typescript-eslint/types": "4.15.1", - "@typescript-eslint/typescript-estree": "4.15.1", + "@typescript-eslint/scope-manager": "4.15.2", + "@typescript-eslint/types": "4.15.2", + "@typescript-eslint/typescript-estree": "4.15.2", "debug": "^4.1.1" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/experimental-utils": "4.15.1", + "@typescript-eslint/experimental-utils": "4.15.2", "glob": "*", "typescript": "*" }, diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 843ce0033021..d362197c9737 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + ## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) **Note:** Version bump only for package @typescript-eslint/scope-manager diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 91ce04978acd..77f168939548 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "4.15.1", + "version": "4.15.2", "description": "TypeScript scope analyser for ESLint", "keywords": [ "eslint", @@ -39,12 +39,12 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "4.15.1", - "@typescript-eslint/visitor-keys": "4.15.1" + "@typescript-eslint/types": "4.15.2", + "@typescript-eslint/visitor-keys": "4.15.2" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/typescript-estree": "4.15.1", + "@typescript-eslint/typescript-estree": "4.15.2", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 8d05eacb4e1b..c5114358f80d 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) + + +### Bug Fixes + +* add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) + + + + + ## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) **Note:** Version bump only for package @typescript-eslint/shared-fixtures diff --git a/packages/shared-fixtures/fixtures/typescript/basics/intrinsic-keyword.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/intrinsic-keyword.src.ts new file mode 100644 index 000000000000..1467d1975a0d --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/basics/intrinsic-keyword.src.ts @@ -0,0 +1,4 @@ +type Uppercase = intrinsic; +type Lowercase = intrinsic; +type Capitalize = intrinsic; +type Uncapitalize = intrinsic; diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index f345d729e214..8faf060c7cd6 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,5 +1,5 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "4.15.1", + "version": "4.15.2", "private": true } diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index f054d043079f..42a5128ea057 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) + + +### Bug Fixes + +* **typescript-estree:** correct issues in AST definition ([#3083](https://github.com/typescript-eslint/typescript-eslint/issues/3083)) ([509a117](https://github.com/typescript-eslint/typescript-eslint/commit/509a11749f85400a01e9fecfecd12871ce562d3d)) +* add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) + + + + + ## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) **Note:** Version bump only for package @typescript-eslint/types diff --git a/packages/types/package.json b/packages/types/package.json index 030428330125..1c3d35f79385 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "4.15.1", + "version": "4.15.2", "description": "Types for the TypeScript-ESTree AST spec", "keywords": [ "eslint", diff --git a/packages/types/src/ast-node-types.ts b/packages/types/src/ast-node-types.ts index 97c630d94727..091e9d3bb945 100644 --- a/packages/types/src/ast-node-types.ts +++ b/packages/types/src/ast-node-types.ts @@ -118,6 +118,7 @@ enum AST_NODE_TYPES { TSInterfaceDeclaration = 'TSInterfaceDeclaration', TSInterfaceHeritage = 'TSInterfaceHeritage', TSIntersectionType = 'TSIntersectionType', + TSIntrinsicKeyword = 'TSIntrinsicKeyword', TSLiteralType = 'TSLiteralType', TSMappedType = 'TSMappedType', TSMethodSignature = 'TSMethodSignature', diff --git a/packages/types/src/ts-estree.ts b/packages/types/src/ts-estree.ts index 4dd89c962bef..e341088f2011 100644 --- a/packages/types/src/ts-estree.ts +++ b/packages/types/src/ts-estree.ts @@ -249,6 +249,7 @@ export type Node = | TSInterfaceDeclaration | TSInterfaceHeritage | TSIntersectionType + | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature @@ -427,11 +428,9 @@ export type MethodDefinition = export type Modifier = | TSAbstractKeyword | TSAsyncKeyword - | TSDeclareKeyword - | TSExportKeyword - | TSPublicKeyword | TSPrivateKeyword | TSProtectedKeyword + | TSPublicKeyword | TSReadonlyKeyword | TSStaticKeyword; export type ObjectLiteralElementLike = @@ -464,20 +463,8 @@ export type PrimaryExpression = | TemplateLiteral | ThisExpression | TSNullKeyword; -export type ProgramStatement = - | ClassDeclaration - | ExportAllDeclaration - | ExportDefaultDeclaration - | ExportNamedDeclaration - | ImportDeclaration - | Statement - | TSDeclareFunction - | TSEnumDeclaration - | TSExportAssignment - | TSImportEqualsDeclaration - | TSInterfaceDeclaration - | TSNamespaceExportDeclaration - | TSTypeAliasDeclaration; +/** TODO: re-align this with EStree spec in next major release */ +export type ProgramStatement = Statement; export type Property = PropertyComputedName | PropertyNonComputedName; export type PropertyName = PropertyNameComputed | PropertyNameNonComputed; export type PropertyNameComputed = Expression; @@ -488,16 +475,27 @@ export type PropertyNameNonComputed = export type Statement = | BlockStatement | BreakStatement + | ClassDeclaration | ContinueStatement | DebuggerStatement | DeclarationStatement | EmptyStatement + | ExportAllDeclaration + | ExportDefaultDeclaration + | ExportNamedDeclaration | ExpressionStatement | IfStatement | IterationStatement | ImportDeclaration | LabeledStatement + | TSDeclareFunction + | TSEnumDeclaration + | TSExportAssignment + | TSImportEqualsDeclaration + | TSInterfaceDeclaration | TSModuleBlock + | TSNamespaceExportDeclaration + | TSTypeAliasDeclaration | ReturnStatement | SwitchStatement | ThrowStatement @@ -544,6 +542,7 @@ export type TypeNode = | TSInferType | TSInterfaceHeritage | TSIntersectionType + | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSNamedTupleMember @@ -1077,7 +1076,7 @@ export interface JSXOpeningElement extends BaseNode { typeParameters?: TSTypeParameterInstantiation; selfClosing: boolean; name: JSXTagNameExpression; - attributes: JSXAttribute[]; + attributes: (JSXAttribute | JSXSpreadAttribute)[]; } export interface JSXOpeningFragment extends BaseNode { @@ -1168,7 +1167,7 @@ export interface ObjectPattern extends BaseNode { export interface Program extends BaseNode { type: AST_NODE_TYPES.Program; - body: ProgramStatement[]; + body: Statement[]; sourceType: 'module' | 'script'; comments?: Comment[]; tokens?: Token[]; @@ -1186,7 +1185,7 @@ export interface PropertyNonComputedName extends PropertyBase { export interface RegExpLiteral extends LiteralBase { type: AST_NODE_TYPES.Literal; - value: RegExp; + value: RegExp | null; } export interface RestElement extends BaseNode { @@ -1269,7 +1268,7 @@ export interface TryStatement extends BaseNode { type: AST_NODE_TYPES.TryStatement; block: BlockStatement; handler: CatchClause | null; - finalizer: BlockStatement; + finalizer: BlockStatement | null; } export interface TSAbstractClassPropertyComputedName @@ -1469,6 +1468,10 @@ export interface TSIntersectionType extends BaseNode { types: TypeNode[]; } +export interface TSIntrinsicKeyword extends BaseNode { + type: AST_NODE_TYPES.TSIntrinsicKeyword; +} + export interface TSLiteralType extends BaseNode { type: AST_NODE_TYPES.TSLiteralType; literal: LiteralExpression | UnaryExpression | UpdateExpression; @@ -1496,13 +1499,13 @@ export interface TSMethodSignatureNonComputedName export interface TSModuleBlock extends BaseNode { type: AST_NODE_TYPES.TSModuleBlock; - body: ProgramStatement[]; + body: Statement[]; } export interface TSModuleDeclaration extends BaseNode { type: AST_NODE_TYPES.TSModuleDeclaration; id: Identifier | Literal; - body?: TSModuleBlock; + body?: TSModuleBlock | TSModuleDeclaration; global?: boolean; declare?: boolean; modifiers?: Modifier[]; diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 71245e6fc611..ead4936db41e 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) + + +### Bug Fixes + +* **typescript-estree:** correct issues in AST definition ([#3083](https://github.com/typescript-eslint/typescript-eslint/issues/3083)) ([509a117](https://github.com/typescript-eslint/typescript-eslint/commit/509a11749f85400a01e9fecfecd12871ce562d3d)) +* add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) +* correct test names on windows for semantic-diagnostics-enabled ([#3060](https://github.com/typescript-eslint/typescript-eslint/issues/3060)) ([885780d](https://github.com/typescript-eslint/typescript-eslint/commit/885780d4a2b07e418256b7323d76b18453c14a50)) + + + + + ## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) **Note:** Version bump only for package @typescript-eslint/typescript-estree diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 968d53c7d252..73f1317acbcc 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "4.15.1", + "version": "4.15.2", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -41,8 +41,8 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "4.15.1", - "@typescript-eslint/visitor-keys": "4.15.1", + "@typescript-eslint/types": "4.15.2", + "@typescript-eslint/visitor-keys": "4.15.2", "debug": "^4.1.1", "globby": "^11.0.1", "is-glob": "^4.0.1", @@ -59,7 +59,7 @@ "@types/is-glob": "*", "@types/semver": "*", "@types/tmp": "*", - "@typescript-eslint/shared-fixtures": "4.15.1", + "@typescript-eslint/shared-fixtures": "4.15.2", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index f8819a33c9e3..762df318e6d7 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -580,13 +580,13 @@ export class Converter { if (!modifiers || !modifiers.length) { return; } + const remainingModifiers: TSESTree.Modifier[] = []; /** * Some modifiers are explicitly handled by applying them as * boolean values on the result node. As well as adding them * to the result, we remove them from the array, so that they * are not handled twice. */ - const handledModifierIndices: { [key: number]: boolean } = {}; for (let i = 0; i < modifiers.length; i++) { const modifier = modifiers[i]; switch (modifier.kind) { @@ -596,17 +596,16 @@ export class Converter { */ case SyntaxKind.ExportKeyword: case SyntaxKind.DefaultKeyword: - handledModifierIndices[i] = true; break; case SyntaxKind.ConstKeyword: (result as any).const = true; - handledModifierIndices[i] = true; break; case SyntaxKind.DeclareKeyword: result.declare = true; - handledModifierIndices[i] = true; break; default: + remainingModifiers.push(this.convertChild(modifier)); + break; } } /** @@ -614,13 +613,9 @@ export class Converter { * not been explicitly handled above, we just convert and * add the modifiers array to the result node. */ - const remainingModifiers = modifiers.filter( - (_, i) => !handledModifierIndices[i], - ); - if (!remainingModifiers || !remainingModifiers.length) { - return; + if (remainingModifiers.length) { + result.modifiers = remainingModifiers; } - result.modifiers = remainingModifiers.map(el => this.convertChild(el)); } /** @@ -1921,7 +1916,7 @@ export class Converter { // Literals case SyntaxKind.StringLiteral: { - return this.createNode(node, { + return this.createNode(node, { type: AST_NODE_TYPES.Literal, value: parent.kind === SyntaxKind.JsxAttribute @@ -1932,7 +1927,7 @@ export class Converter { } case SyntaxKind.NumericLiteral: { - return this.createNode(node, { + return this.createNode(node, { type: AST_NODE_TYPES.Literal, value: Number(node.text), raw: node.getText(), @@ -1969,7 +1964,7 @@ export class Converter { regex = null; } - return this.createNode(node, { + return this.createNode(node, { type: AST_NODE_TYPES.Literal, value: regex, raw: node.text, @@ -1981,14 +1976,14 @@ export class Converter { } case SyntaxKind.TrueKeyword: - return this.createNode(node, { + return this.createNode(node, { type: AST_NODE_TYPES.Literal, value: true, raw: 'true', }); case SyntaxKind.FalseKeyword: - return this.createNode(node, { + return this.createNode(node, { type: AST_NODE_TYPES.Literal, value: false, raw: 'false', @@ -2002,7 +1997,7 @@ export class Converter { }); } - return this.createNode(node, { + return this.createNode(node, { type: AST_NODE_TYPES.Literal, value: null, raw: 'null', @@ -2211,7 +2206,8 @@ export class Converter { case SyntaxKind.SymbolKeyword: case SyntaxKind.UnknownKeyword: case SyntaxKind.VoidKeyword: - case SyntaxKind.UndefinedKeyword: { + case SyntaxKind.UndefinedKeyword: + case SyntaxKind.IntrinsicKeyword: { return this.createNode(node, { type: AST_NODE_TYPES[`TS${SyntaxKind[node.kind]}` as AST_NODE_TYPES], }); diff --git a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts index 620539202805..2eebfc93b127 100644 --- a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts +++ b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts @@ -254,6 +254,7 @@ export interface EstreeToTsNodeTypes { [AST_NODE_TYPES.TSAnyKeyword]: ts.KeywordTypeNode; [AST_NODE_TYPES.TSBigIntKeyword]: ts.KeywordTypeNode; [AST_NODE_TYPES.TSBooleanKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSIntrinsicKeyword]: ts.KeywordTypeNode; [AST_NODE_TYPES.TSNeverKeyword]: ts.KeywordTypeNode; [AST_NODE_TYPES.TSNumberKeyword]: ts.KeywordTypeNode; [AST_NODE_TYPES.TSObjectKeyword]: ts.KeywordTypeNode; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap index 63bba828ae09..2aa60bf249ea 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap @@ -1993,6 +1993,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-without-type-annotation.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/intrinsic-keyword.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/keyof-operator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/keyword-variables.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts index 31f212261e20..3cbe87f9f552 100644 --- a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts +++ b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts @@ -10,11 +10,13 @@ import { formatSnapshotName, isJSXFileType } from '../../tools/test-utils'; */ const FIXTURES_DIR = path.join(__dirname, '../../../shared-fixtures/fixtures'); -const testFiles = glob.sync(`${FIXTURES_DIR}/**/*.src.*`); +const testFiles = glob.sync(`**/*.src.*`, { + cwd: FIXTURES_DIR, +}); describe('Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled', () => { testFiles.forEach(filename => { - const code = readFileSync(filename, 'utf8'); + const code = readFileSync(path.join(FIXTURES_DIR, filename), 'utf8'); const fileExtension = path.extname(filename); const config: parser.TSESTreeOptions = { loc: true, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/intrinsic-keyword.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/intrinsic-keyword.src.ts.shot new file mode 100644 index 000000000000..22d41df5f1a2 --- /dev/null +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/intrinsic-keyword.src.ts.shot @@ -0,0 +1,1243 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typescript basics intrinsic-keyword.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Uppercase", + "range": Array [ + 5, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 45, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 44, + ], + "type": "TSIntrinsicKeyword", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "TSStringKeyword", + }, + "default": undefined, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "S", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "range": Array [ + 15, + 31, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 14, + 32, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "Lowercase", + "range": Array [ + 51, + 60, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 46, + 91, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 81, + 90, + ], + "type": "TSIntrinsicKeyword", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 71, + 77, + ], + "type": "TSStringKeyword", + }, + "default": undefined, + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "name": "S", + "range": Array [ + 61, + 62, + ], + "type": "Identifier", + }, + "range": Array [ + 61, + 77, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 60, + 78, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "name": "Capitalize", + "range": Array [ + 97, + 107, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 92, + 138, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 3, + }, + "start": Object { + "column": 36, + "line": 3, + }, + }, + "range": Array [ + 128, + 137, + ], + "type": "TSIntrinsicKeyword", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 118, + 124, + ], + "type": "TSStringKeyword", + }, + "default": undefined, + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "name": "S", + "range": Array [ + 108, + 109, + ], + "type": "Identifier", + }, + "range": Array [ + 108, + 124, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 107, + 125, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "name": "Uncapitalize", + "range": Array [ + 144, + 156, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 48, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 139, + 187, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 4, + }, + "start": Object { + "column": 38, + "line": 4, + }, + }, + "range": Array [ + 177, + 186, + ], + "type": "TSIntrinsicKeyword", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "params": Array [ + Object { + "constraint": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "range": Array [ + 167, + 173, + ], + "type": "TSStringKeyword", + }, + "default": undefined, + "loc": Object { + "end": Object { + "column": 34, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "name": "S", + "range": Array [ + 157, + 158, + ], + "type": "Identifier", + }, + "range": Array [ + 157, + 173, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 156, + 174, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 188, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 14, + ], + "type": "Identifier", + "value": "Uppercase", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "S", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 24, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 31, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 1, + }, + "start": Object { + "column": 35, + "line": 1, + }, + }, + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + "value": "intrinsic", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 1, + }, + "start": Object { + "column": 44, + "line": 1, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 46, + 50, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 51, + 60, + ], + "type": "Identifier", + "value": "Lowercase", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 60, + 61, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 61, + 62, + ], + "type": "Identifier", + "value": "S", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 63, + 70, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 71, + 77, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 2, + }, + "start": Object { + "column": 31, + "line": 2, + }, + }, + "range": Array [ + 77, + 78, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 33, + "line": 2, + }, + }, + "range": Array [ + 79, + 80, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 44, + "line": 2, + }, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "range": Array [ + 81, + 90, + ], + "type": "Identifier", + "value": "intrinsic", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "range": Array [ + 90, + 91, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 92, + 96, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 3, + }, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "range": Array [ + 97, + 107, + ], + "type": "Identifier", + "value": "Capitalize", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 3, + }, + "start": Object { + "column": 15, + "line": 3, + }, + }, + "range": Array [ + 107, + 108, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 3, + }, + "start": Object { + "column": 16, + "line": 3, + }, + }, + "range": Array [ + 108, + 109, + ], + "type": "Identifier", + "value": "S", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 18, + "line": 3, + }, + }, + "range": Array [ + 110, + 117, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 3, + }, + "start": Object { + "column": 26, + "line": 3, + }, + }, + "range": Array [ + 118, + 124, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 3, + }, + "start": Object { + "column": 32, + "line": 3, + }, + }, + "range": Array [ + 124, + 125, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 3, + }, + "start": Object { + "column": 34, + "line": 3, + }, + }, + "range": Array [ + 126, + 127, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 45, + "line": 3, + }, + "start": Object { + "column": 36, + "line": 3, + }, + }, + "range": Array [ + 128, + 137, + ], + "type": "Identifier", + "value": "intrinsic", + }, + Object { + "loc": Object { + "end": Object { + "column": 46, + "line": 3, + }, + "start": Object { + "column": 45, + "line": 3, + }, + }, + "range": Array [ + 137, + 138, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "range": Array [ + 139, + 143, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 4, + }, + "start": Object { + "column": 5, + "line": 4, + }, + }, + "range": Array [ + 144, + 156, + ], + "type": "Identifier", + "value": "Uncapitalize", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 17, + "line": 4, + }, + }, + "range": Array [ + 156, + 157, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 18, + "line": 4, + }, + }, + "range": Array [ + 157, + 158, + ], + "type": "Identifier", + "value": "S", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 4, + }, + "start": Object { + "column": 20, + "line": 4, + }, + }, + "range": Array [ + 159, + 166, + ], + "type": "Keyword", + "value": "extends", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 4, + }, + "start": Object { + "column": 28, + "line": 4, + }, + }, + "range": Array [ + 167, + 173, + ], + "type": "Identifier", + "value": "string", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 4, + }, + "start": Object { + "column": 34, + "line": 4, + }, + }, + "range": Array [ + 173, + 174, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 4, + }, + "start": Object { + "column": 36, + "line": 4, + }, + }, + "range": Array [ + 175, + 176, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 4, + }, + "start": Object { + "column": 38, + "line": 4, + }, + }, + "range": Array [ + 177, + 186, + ], + "type": "Identifier", + "value": "intrinsic", + }, + Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 4, + }, + "start": Object { + "column": 47, + "line": 4, + }, + }, + "range": Array [ + 186, + 187, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 06e50a7b576e..ed1ff385041d 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) + + +### Bug Fixes + +* add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) + + + + + ## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) **Note:** Version bump only for package @typescript-eslint/visitor-keys diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 60414a3c55d6..e3a6c00d1a54 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "4.15.1", + "version": "4.15.2", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "keywords": [ "eslint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "4.15.1", + "@typescript-eslint/types": "4.15.2", "eslint-visitor-keys": "^2.0.0" }, "devDependencies": { diff --git a/packages/visitor-keys/src/visitor-keys.ts b/packages/visitor-keys/src/visitor-keys.ts index 68c6b806bcc6..1f2363e948ec 100644 --- a/packages/visitor-keys/src/visitor-keys.ts +++ b/packages/visitor-keys/src/visitor-keys.ts @@ -99,6 +99,7 @@ const additionalKeys: AdditionalKeys = { TSInterfaceDeclaration: ['id', 'typeParameters', 'extends', 'body'], TSInterfaceHeritage: ['expression', 'typeParameters'], TSIntersectionType: ['types'], + TSIntrinsicKeyword: [], TSLiteralType: ['literal'], TSMappedType: ['nameType', 'typeParameter', 'typeAnnotation'], TSMethodSignature: ['typeParameters', 'key', 'params', 'returnType'],