fix(nuxt): move to @typescript-eslint/typescript-estree (#21664)

This commit is contained in:
c-schwan 2023-06-20 23:01:31 +02:00 committed by GitHub
parent 0eb69be137
commit 5460873161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 45 deletions

View File

@ -58,6 +58,7 @@
"@nuxt/telemetry": "^2.2.0", "@nuxt/telemetry": "^2.2.0",
"@nuxt/ui-templates": "^1.2.0", "@nuxt/ui-templates": "^1.2.0",
"@nuxt/vite-builder": "workspace:../vite", "@nuxt/vite-builder": "workspace:../vite",
"@typescript-eslint/typescript-estree": "^5.60.0",
"@unhead/ssr": "^1.1.27", "@unhead/ssr": "^1.1.27",
"@unhead/vue": "^1.1.27", "@unhead/vue": "^1.1.27",
"@vue/shared": "^3.3.4", "@vue/shared": "^3.3.4",
@ -89,7 +90,6 @@
"prompts": "^2.4.2", "prompts": "^2.4.2",
"scule": "^1.0.0", "scule": "^1.0.0",
"strip-literal": "^1.0.1", "strip-literal": "^1.0.1",
"typescript-estree": "^18.1.0",
"ufo": "^1.1.2", "ufo": "^1.1.2",
"ultrahtml": "^1.2.0", "ultrahtml": "^1.2.0",
"uncrypto": "^0.1.3", "uncrypto": "^0.1.3",

View File

@ -1,7 +1,7 @@
import type { CallExpression, Property, SpreadElement } from 'estree' import type { CallExpression, Property, SpreadElement } from 'estree'
import type { Node } from 'estree-walker' import type { Node } from 'estree-walker'
import { walk } from 'estree-walker' import { walk } from 'estree-walker'
import { parse } from 'typescript-estree' import { parse } from '@typescript-eslint/typescript-estree'
import { defu } from 'defu' import { defu } from 'defu'
import { findExports } from 'mlly' import { findExports } from 'mlly'
import type { Nuxt } from '@nuxt/schema' import type { Nuxt } from '@nuxt/schema'
@ -129,7 +129,7 @@ export const RemovePluginMetadataPlugin = (nuxt: Nuxt) => createUnplugin(() => {
let wrapped = false let wrapped = false
try { try {
walk(parse(code) as Node, { walk(parse(code, { range: true }) as Node, {
enter (_node) { enter (_node) {
if (_node.type === 'ExportDefaultDeclaration' && (_node.declaration.type === 'FunctionDeclaration' || _node.declaration.type === 'ArrowFunctionExpression')) { if (_node.type === 'ExportDefaultDeclaration' && (_node.declaration.type === 'FunctionDeclaration' || _node.declaration.type === 'ArrowFunctionExpression')) {
if ('params' in _node.declaration && _node.declaration.params.length > 1) { if ('params' in _node.declaration && _node.declaration.params.length > 1) {

View File

@ -340,6 +340,9 @@ importers:
'@types/node': '@types/node':
specifier: ^14.18.0 || >=16.10.0 specifier: ^14.18.0 || >=16.10.0
version: 18.16.18 version: 18.16.18
'@typescript-eslint/typescript-estree':
specifier: ^5.60.0
version: 5.60.0(typescript@5.0.4)
'@unhead/ssr': '@unhead/ssr':
specifier: ^1.1.27 specifier: ^1.1.27
version: 1.1.27 version: 1.1.27
@ -433,9 +436,6 @@ importers:
strip-literal: strip-literal:
specifier: ^1.0.1 specifier: ^1.0.1
version: 1.0.1 version: 1.0.1
typescript-estree:
specifier: ^18.1.0
version: 18.1.0(typescript@5.0.4)
ufo: ufo:
specifier: ^1.1.2 specifier: ^1.1.2
version: 1.1.2 version: 1.1.2
@ -2606,6 +2606,11 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true dev: true
/@typescript-eslint/types@5.60.0:
resolution: {integrity: sha512-ascOuoCpNZBccFVNJRSC6rPq4EmJ2NkuoKnd6LDNyAQmdDnziAtxbCGWCbefG1CNzmDvd05zO36AmB7H8RzKPA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: false
/@typescript-eslint/typescript-estree@5.54.1(typescript@5.0.4): /@typescript-eslint/typescript-estree@5.54.1(typescript@5.0.4):
resolution: {integrity: sha512-bjK5t+S6ffHnVwA0qRPTZrxKSaFYocwFIkZx5k7pvWfsB1I57pO/0M0Skatzzw1sCkjJ83AfGTL0oFIFiDX3bg==} resolution: {integrity: sha512-bjK5t+S6ffHnVwA0qRPTZrxKSaFYocwFIkZx5k7pvWfsB1I57pO/0M0Skatzzw1sCkjJ83AfGTL0oFIFiDX3bg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@ -2627,6 +2632,27 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@typescript-eslint/typescript-estree@5.60.0(typescript@5.0.4):
resolution: {integrity: sha512-R43thAuwarC99SnvrBmh26tc7F6sPa2B3evkXp/8q954kYL6Ro56AwASYWtEEi+4j09GbiNAHqYwNNZuNlARGQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@typescript-eslint/types': 5.60.0
'@typescript-eslint/visitor-keys': 5.60.0
debug: 4.3.4
globby: 11.1.0
is-glob: 4.0.3
semver: 7.5.2
tsutils: 3.21.0(typescript@5.0.4)
typescript: 5.0.4
transitivePeerDependencies:
- supports-color
dev: false
/@typescript-eslint/utils@5.54.1(eslint@8.43.0)(typescript@5.0.4): /@typescript-eslint/utils@5.54.1(eslint@8.43.0)(typescript@5.0.4):
resolution: {integrity: sha512-IY5dyQM8XD1zfDe5X8jegX6r2EVU5o/WJnLu/znLPWCBF7KNGC+adacXnt5jEYS9JixDcoccI6CvE4RCjHMzCQ==} resolution: {integrity: sha512-IY5dyQM8XD1zfDe5X8jegX6r2EVU5o/WJnLu/znLPWCBF7KNGC+adacXnt5jEYS9JixDcoccI6CvE4RCjHMzCQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@ -2655,6 +2681,14 @@ packages:
eslint-visitor-keys: 3.4.1 eslint-visitor-keys: 3.4.1
dev: true dev: true
/@typescript-eslint/visitor-keys@5.60.0:
resolution: {integrity: sha512-wm9Uz71SbCyhUKgcaPRauBdTegUyY/ZWl8gLwD/i/ybJqscrrdVSFImpvUz16BLPChIeKBK5Fa9s6KDQjsjyWw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
'@typescript-eslint/types': 5.60.0
eslint-visitor-keys: 3.4.1
dev: false
/@unhead/dom@1.1.27: /@unhead/dom@1.1.27:
resolution: {integrity: sha512-sUrzpKIVvFp8TFx1mgp5t0k5ts1+KmgjMgRRuvRTZMBMVeGQRLSuL3uo34iwuFmKxeI6BXT5lVBk5H02c1XdGg==} resolution: {integrity: sha512-sUrzpKIVvFp8TFx1mgp5t0k5ts1+KmgjMgRRuvRTZMBMVeGQRLSuL3uo34iwuFmKxeI6BXT5lVBk5H02c1XdGg==}
dependencies: dependencies:
@ -3247,7 +3281,6 @@ packages:
/array-union@2.1.0: /array-union@2.1.0:
resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}
engines: {node: '>=8'} engines: {node: '>=8'}
dev: true
/array.prototype.flat@1.3.1: /array.prototype.flat@1.3.1:
resolution: {integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==} resolution: {integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==}
@ -5308,18 +5341,6 @@ packages:
ignore: 5.2.4 ignore: 5.2.4
merge2: 1.4.1 merge2: 1.4.1
slash: 3.0.0 slash: 3.0.0
dev: true
/globby@13.1.4:
resolution: {integrity: sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
dir-glob: 3.0.1
fast-glob: 3.2.12
ignore: 5.2.4
merge2: 1.4.1
slash: 4.0.0
dev: true
/globby@13.2.0: /globby@13.2.0:
resolution: {integrity: sha512-jWsQfayf13NvqKUIL3Ta+CIqMnvlaIDFveWE/dpOZ9+3AMEJozsxDvKA02zync9UuvOM8rOXzsD5GqKP4OnWPQ==} resolution: {integrity: sha512-jWsQfayf13NvqKUIL3Ta+CIqMnvlaIDFveWE/dpOZ9+3AMEJozsxDvKA02zync9UuvOM8rOXzsD5GqKP4OnWPQ==}
@ -6170,10 +6191,6 @@ packages:
resolution: {integrity: sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==} resolution: {integrity: sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==}
dev: false dev: false
/lodash.unescape@4.0.1:
resolution: {integrity: sha512-DhhGRshNS1aX6s5YdBE3njCCouPgnG29ebyHvImlZzXZf2SHgt+J08DHgytTPnpywNbO1Y8mNUFyQuIDBq2JZg==}
dev: false
/lodash.union@4.6.0: /lodash.union@4.6.0:
resolution: {integrity: sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==} resolution: {integrity: sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==}
@ -6436,7 +6453,7 @@ packages:
defu: 6.1.2 defu: 6.1.2
esbuild: 0.17.19 esbuild: 0.17.19
fs-extra: 11.1.1 fs-extra: 11.1.1
globby: 13.1.4 globby: 13.2.0
jiti: 1.18.2 jiti: 1.18.2
mlly: 1.3.0 mlly: 1.3.0
mri: 1.2.0 mri: 1.2.0
@ -7826,11 +7843,6 @@ packages:
/scule@1.0.0: /scule@1.0.0:
resolution: {integrity: sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==} resolution: {integrity: sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==}
/semver@5.5.0:
resolution: {integrity: sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==}
hasBin: true
dev: false
/semver@5.7.1: /semver@5.7.1:
resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==}
hasBin: true hasBin: true
@ -7940,7 +7952,6 @@ packages:
/slash@3.0.0: /slash@3.0.0:
resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
engines: {node: '>=8'} engines: {node: '>=8'}
dev: true
/slash@4.0.0: /slash@4.0.0:
resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==}
@ -8346,7 +8357,6 @@ packages:
/tslib@1.14.1: /tslib@1.14.1:
resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
dev: true
/tslib@2.5.0: /tslib@2.5.0:
resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==}
@ -8359,7 +8369,6 @@ packages:
dependencies: dependencies:
tslib: 1.14.1 tslib: 1.14.1
typescript: 5.0.4 typescript: 5.0.4
dev: true
/tunnel@0.0.6: /tunnel@0.0.6:
resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==} resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==}
@ -8412,18 +8421,6 @@ packages:
is-typed-array: 1.1.10 is-typed-array: 1.1.10
dev: true dev: true
/typescript-estree@18.1.0(typescript@5.0.4):
resolution: {integrity: sha512-LvvwoTuPgMO5UyckFXZeNI+m1UH1bkgAXEaHDEtkmxugtlMKM3mzyvSQUdnQ/FhifwaLuoAsNPqTGLrJI/UUaQ==}
engines: {node: '>=6.14.0'}
deprecated: This package was moved to @typescript-eslint/typescript-estree, please install the latest version from there instead
peerDependencies:
typescript: '*'
dependencies:
lodash.unescape: 4.0.1
semver: 5.5.0
typescript: 5.0.4
dev: false
/typescript@5.0.4: /typescript@5.0.4:
resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==}
engines: {node: '>=12.20'} engines: {node: '>=12.20'}
@ -8463,7 +8460,7 @@ packages:
consola: 3.1.0 consola: 3.1.0
defu: 6.1.2 defu: 6.1.2
esbuild: 0.17.19 esbuild: 0.17.19
globby: 13.1.4 globby: 13.2.0
hookable: 5.5.3 hookable: 5.5.3
jiti: 1.18.2 jiti: 1.18.2
magic-string: 0.30.0 magic-string: 0.30.0