Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lint): add type-aware rules #12497

Open
wants to merge 27 commits into
base: minor
Choose a base branch
from

Conversation

johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk commented Dec 3, 2024

Exploration move to tsslint to use type-aware rules in a high-performance manner.

I tested all type-aware rules of typescript-eslint and added the ones with no friction from Vue core:

Copy link

github-actions bot commented Dec 3, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 101 kB (-1 B) 38.1 kB (-2 B) 34.3 kB (-2 B)
vue.global.prod.js 159 kB (-1 B) 57.9 kB (-1 B) 51.5 kB (-117 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.7 kB (-496 B) 18.4 kB (-68 B) 16.8 kB (-64 B)
createApp 55.1 kB (-601 B) 21.4 kB (-83 B) 19.5 kB (-70 B)
createSSRApp 59.2 kB (-601 B) 23.1 kB (-79 B) 21 kB (-62 B)
defineCustomElement 59.9 kB (-631 B) 23 kB (-75 B) 20.9 kB (-60 B)
overall 69.1 kB (-691 B) 26.5 kB (-96 B) 24.1 kB (-64 B)

Copy link

pkg-pr-new bot commented Dec 3, 2024

Open in Stackblitz

@vue/compiler-core

npm i https://pkg.pr.new/@vue/compiler-core@12497

@vue/compiler-ssr

npm i https://pkg.pr.new/@vue/compiler-ssr@12497

@vue/compiler-dom

npm i https://pkg.pr.new/@vue/compiler-dom@12497

@vue/compiler-sfc

npm i https://pkg.pr.new/@vue/compiler-sfc@12497

@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@12497

@vue/runtime-core

npm i https://pkg.pr.new/@vue/runtime-core@12497

@vue/runtime-dom

npm i https://pkg.pr.new/@vue/runtime-dom@12497

@vue/server-renderer

npm i https://pkg.pr.new/@vue/server-renderer@12497

@vue/shared

npm i https://pkg.pr.new/@vue/shared@12497

vue

npm i https://pkg.pr.new/vue@12497

@vue/compat

npm i https://pkg.pr.new/@vue/compat@12497

commit: f82ef98

@johnsoncodehk johnsoncodehk changed the title test(lint): use tsslint feat(lint): add type-aware rules Dec 4, 2024
@johnsoncodehk johnsoncodehk changed the base branch from main to minor December 4, 2024 12:52
@edison1105 edison1105 added ready to merge The PR is ready to be merged. 🧹 p1-chore Priority 1: this doesn't change code behavior. labels Dec 5, 2024
@edison1105 edison1105 changed the base branch from minor to main December 8, 2024 11:57
@edison1105 edison1105 changed the base branch from main to minor December 8, 2024 11:57
@johnsoncodehk johnsoncodehk changed the base branch from minor to main December 8, 2024 15:42
@johnsoncodehk johnsoncodehk changed the base branch from main to minor December 8, 2024 15:42
Copy link

netlify bot commented Dec 8, 2024

Deploy Preview for vue-sfc-playground failed. Why did it fail? →

Name Link
🔨 Latest commit 2c7404b
🔍 Latest deploy log https://app.netlify.com/sites/vue-sfc-playground/deploys/6755bf19ac9a3d0008d0f667

@@ -159,7 +158,7 @@ export const transformFor: NodeTransform = createStructuralDirectiveTransform(
: isTemplate &&
node.children.length === 1 &&
isSlotOutlet(node.children[0])
? (node.children[0] as SlotOutletNode) // api-extractor somehow fails to infer this
? node.children[0] // api-extractor somehow fails to infer this
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this comment referring to the now removed assertion?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what this comment means. This comment was added in b685805, I reset to that commit and confirmed that the type of children[0] is not SlotOutletNode, so I think this comment may be not related to the removed assertion.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 p1-chore Priority 1: this doesn't change code behavior. ready to merge The PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants