Migrate vue-components package to TS#2805
Open
yihao03 wants to merge 2 commits intoMarkBind:masterfrom
Open
Conversation
- Add TypeScript type annotations to all migrated files: * Wrap Vue Options API components with defineComponent for proper type inference * Convert directives (Closeable, Float) to ES6 exports with proper types * Add comprehensive type safety to utilities (utils, urls, pubsub, dropdown, submenu) * Fix NodeList.ts with proper type handling and linting compliance * Add 'this: any' parameters to QuizQuestionMixin for dynamic property access - Configure build tools for TypeScript: * Install and configure @babel/preset-typescript * Update babel.config.js with TypeScript preset * Configure Jest with ts-jest for test transformation - Configure ESLint for TypeScript + Vue: * Add packages/vue-components/tsconfig.lint.json for ESLint * Update root .eslintrc.js to include vue-components tsconfig in project array * Configure vue-components/.eslintrc.js with vue-eslint-parser and TypeScript support * Add .eslintignore to exclude coverage and config files from linting * Configure import resolver to handle .ts file resolution * Add overrides for .js files to not require TypeScript project - Fix all linting errors without disabling rules: * Fix 83 linting errors in NodeList.ts (bitwise operators, parameter reassignments, for-in loops) * Fix 32 linting errors in utils.ts (nested ternaries, line length, typeof checks) * Reorder function declarations to fix no-use-before-define errors * Add inline eslint-disable only for unavoidable legacy patterns (lodash checks where lodash isn't available) * Replace ~arr.indexOf(x) with arr.indexOf(x) !== -1 * Replace for-in loops with Object.keys().forEach() * Fix parameter reassignments by using local variables * Break up nested ternaries into if-else statements * Use Number.isNaN instead of isNaN - Configure Vue-specific TypeScript settings: * Set strict: false for incremental migration * Disable noImplicitAny and noImplicitThis for Vue Options API compatibility * Configure jsx: 'preserve' for Vue template compilation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request?
Overview of changes:
Migrate the
packages/vue-componentsJavaScript files to TypeScript.Anything you'd like to highlight/discuss:
This migration is done as part of the effort to migrate the entire codebase to TypeScript and ES6
It is done primarily using OpenCode with Claude Sonnet 4.5 to experiment PR #2804: Adding ai agent's effectiveness.
Testing instructions:
Run the existing test suite to ensure all tests pass successfully.
Serve or build some websites to make sure everything works as expected.
Proposed commit message: (wrap lines at 72 characters)
Migrate vue-components to TypeScript
Checklist: ☑️
Reviewer checklist:
Indicate the SEMVER impact of the PR:
At the end of the review, please label the PR with the appropriate label:
r.Major,r.Minor,r.Patch.Breaking change release note preparation (if applicable):