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(vue-tsc): Hook API #2217

Merged
merged 2 commits into from
Dec 17, 2022
Merged

Conversation

johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk commented Dec 17, 2022

This PR support setting a TS Program callback script for vue-tsc in vueCompilerOptions.

Purpose

The TS program can pass to 3rd tools like ESLint to use.

For ESLint, reusing TS Program can get better performance in CI/CD and some other benefits. (See #2204)

Usage

experimentalTscProgramCallback is renamed to hooks in #2220

  • tsconfig.json
{
	"vueCompilerOptions": {
		"hooks": ["./vue-tsc-hook.js"]
	}
}
  • vue-tsc-hook.js
/**
 * @param {import('vue-tsc')._Program} program 
 */
module.exports = function (program) {
	// ...
};

@johnsoncodehk johnsoncodehk merged commit 4e8b0e4 into master Dec 17, 2022
@johnsoncodehk johnsoncodehk deleted the experimentalTscProgramCallback branch December 17, 2022 03:14
@johnsoncodehk johnsoncodehk changed the title feat(vue-tsc): experimentalTscProgramCallbacks feat(vue-tsc): vueCompilerOptions.hook Dec 18, 2022
@johnsoncodehk johnsoncodehk changed the title feat(vue-tsc): vueCompilerOptions.hook feat(vue-tsc): Hook API Dec 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant