-
Notifications
You must be signed in to change notification settings - Fork 0
chore: migrate from eslint+prettier to Vite+ #8
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../node_modules/vite-plus/skills/vite-plus |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "semi": true, | ||
| "tabWidth": 2, | ||
| "trailingComma": "all", | ||
| "useTabs": true, | ||
| "printWidth": 80, | ||
| "sortPackageJson": false | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,227 @@ | ||
| { | ||
| "plugins": ["oxc", "typescript", "unicorn", "react"], | ||
| "categories": { | ||
| "correctness": "warn" | ||
| }, | ||
| "env": { | ||
| "builtin": true | ||
| }, | ||
| "ignorePatterns": [ | ||
| "**/node_modules", | ||
| "**/build", | ||
| "**/dist", | ||
| "**/public", | ||
| "packages/ecs-benchmark/**" | ||
| ], | ||
| "rules": { | ||
| "constructor-super": "error", | ||
| "for-direction": "error", | ||
| "getter-return": "error", | ||
| "no-async-promise-executor": "error", | ||
| "no-case-declarations": "error", | ||
| "no-class-assign": "error", | ||
| "no-compare-neg-zero": "error", | ||
| "no-cond-assign": "error", | ||
| "no-const-assign": "error", | ||
| "no-constant-binary-expression": "error", | ||
| "no-constant-condition": "error", | ||
| "no-control-regex": "error", | ||
| "no-debugger": "error", | ||
| "no-delete-var": "error", | ||
| "no-dupe-class-members": "error", | ||
| "no-dupe-else-if": "error", | ||
| "no-dupe-keys": "error", | ||
| "no-duplicate-case": "error", | ||
| "no-empty": "error", | ||
| "no-empty-character-class": "error", | ||
| "no-empty-pattern": "error", | ||
| "no-empty-static-block": "error", | ||
| "no-ex-assign": "error", | ||
| "no-extra-boolean-cast": "error", | ||
| "no-fallthrough": "error", | ||
| "no-func-assign": "error", | ||
| "no-global-assign": "error", | ||
| "no-import-assign": "error", | ||
| "no-invalid-regexp": "error", | ||
| "no-irregular-whitespace": "error", | ||
| "no-loss-of-precision": "error", | ||
| "no-misleading-character-class": "error", | ||
| "no-new-native-nonconstructor": "error", | ||
| "no-nonoctal-decimal-escape": "error", | ||
| "no-obj-calls": "error", | ||
| "no-prototype-builtins": "error", | ||
| "no-redeclare": "error", | ||
| "no-regex-spaces": "error", | ||
| "no-self-assign": "error", | ||
| "no-setter-return": "error", | ||
| "no-shadow-restricted-names": "error", | ||
| "no-sparse-arrays": "error", | ||
| "no-this-before-super": "error", | ||
| "no-undef": "error", | ||
| "no-unreachable": "error", | ||
| "no-unsafe-finally": "error", | ||
| "no-unsafe-negation": "error", | ||
| "no-unsafe-optional-chaining": "error", | ||
| "no-unused-labels": "error", | ||
| "no-unused-private-class-members": "error", | ||
| "no-unused-vars": "error", | ||
| "no-useless-backreference": "error", | ||
| "no-useless-catch": "error", | ||
| "no-useless-escape": "error", | ||
| "no-with": "error", | ||
| "require-yield": "error", | ||
| "use-isnan": "error", | ||
| "valid-typeof": "error", | ||
| "@typescript-eslint/ban-ts-comment": "error", | ||
| "no-array-constructor": "error", | ||
| "@typescript-eslint/no-duplicate-enum-values": "error", | ||
| "@typescript-eslint/no-empty-object-type": "error", | ||
| "@typescript-eslint/no-explicit-any": "error", | ||
| "@typescript-eslint/no-extra-non-null-assertion": "error", | ||
| "@typescript-eslint/no-misused-new": "error", | ||
| "@typescript-eslint/no-namespace": "error", | ||
| "@typescript-eslint/no-non-null-asserted-optional-chain": "error", | ||
| "@typescript-eslint/no-require-imports": "error", | ||
| "@typescript-eslint/no-this-alias": "error", | ||
| "@typescript-eslint/no-unnecessary-type-constraint": "error", | ||
| "@typescript-eslint/no-unsafe-declaration-merging": "error", | ||
| "@typescript-eslint/no-unsafe-function-type": "error", | ||
| "no-unused-expressions": "error", | ||
| "@typescript-eslint/no-wrapper-object-types": "error", | ||
| "@typescript-eslint/prefer-as-const": "error", | ||
| "@typescript-eslint/prefer-namespace-keyword": "error", | ||
| "@typescript-eslint/triple-slash-reference": "error", | ||
| "@typescript-eslint/await-thenable": "error", | ||
| "@typescript-eslint/no-array-delete": "error", | ||
| "@typescript-eslint/no-base-to-string": "error", | ||
| "@typescript-eslint/no-confusing-void-expression": "error", | ||
| "@typescript-eslint/no-deprecated": "error", | ||
| "@typescript-eslint/no-duplicate-type-constituents": "error", | ||
| "@typescript-eslint/no-dynamic-delete": "error", | ||
| "@typescript-eslint/no-extraneous-class": "error", | ||
| "@typescript-eslint/no-floating-promises": "error", | ||
| "@typescript-eslint/no-for-in-array": "error", | ||
| "@typescript-eslint/no-implied-eval": "error", | ||
| "@typescript-eslint/no-invalid-void-type": "error", | ||
| "@typescript-eslint/no-meaningless-void-operator": "error", | ||
| "@typescript-eslint/no-misused-promises": "error", | ||
| "@typescript-eslint/no-misused-spread": "error", | ||
| "@typescript-eslint/no-mixed-enums": "error", | ||
| "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error", | ||
| "@typescript-eslint/no-non-null-assertion": "error", | ||
| "@typescript-eslint/no-redundant-type-constituents": "error", | ||
| "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error", | ||
| "@typescript-eslint/no-unnecessary-condition": "error", | ||
| "@typescript-eslint/no-unnecessary-template-expression": "error", | ||
| "@typescript-eslint/no-unnecessary-type-arguments": "error", | ||
| "@typescript-eslint/no-unnecessary-type-assertion": "error", | ||
| "@typescript-eslint/no-unnecessary-type-conversion": "error", | ||
| "@typescript-eslint/no-unnecessary-type-parameters": "error", | ||
| "@typescript-eslint/no-unsafe-argument": "error", | ||
| "@typescript-eslint/no-unsafe-assignment": "error", | ||
| "@typescript-eslint/no-unsafe-call": "error", | ||
| "@typescript-eslint/no-unsafe-enum-comparison": "error", | ||
| "@typescript-eslint/no-unsafe-member-access": "error", | ||
| "@typescript-eslint/no-unsafe-return": "error", | ||
| "@typescript-eslint/no-unsafe-unary-minus": "error", | ||
| "no-useless-constructor": "error", | ||
| "@typescript-eslint/no-useless-default-assignment": "error", | ||
| "@typescript-eslint/only-throw-error": "error", | ||
| "@typescript-eslint/prefer-literal-enum-member": "error", | ||
| "@typescript-eslint/prefer-promise-reject-errors": "error", | ||
| "@typescript-eslint/prefer-reduce-type-parameter": "error", | ||
| "@typescript-eslint/prefer-return-this-type": "error", | ||
| "@typescript-eslint/related-getter-setter-pairs": "error", | ||
| "@typescript-eslint/require-await": "error", | ||
| "@typescript-eslint/restrict-plus-operands": [ | ||
| "error", | ||
| { | ||
| "allowAny": false, | ||
| "allowBoolean": false, | ||
| "allowNullish": false, | ||
| "allowNumberAndString": false, | ||
| "allowRegExp": false | ||
| } | ||
| ], | ||
| "@typescript-eslint/restrict-template-expressions": [ | ||
| "error", | ||
| { | ||
| "allowAny": false, | ||
| "allowBoolean": false, | ||
| "allowNever": false, | ||
| "allowNullish": false, | ||
| "allowNumber": true, | ||
| "allowRegExp": false | ||
| } | ||
| ], | ||
| "@typescript-eslint/return-await": [ | ||
| "error", | ||
| "error-handling-correctness-only" | ||
| ], | ||
| "@typescript-eslint/unbound-method": "error", | ||
| "@typescript-eslint/unified-signatures": "error", | ||
| "@typescript-eslint/use-unknown-in-catch-callback-variable": "error", | ||
| "@typescript-eslint/adjacent-overload-signatures": "error", | ||
| "@typescript-eslint/array-type": "off", | ||
| "@typescript-eslint/ban-tslint-comment": "error", | ||
| "@typescript-eslint/class-literal-property-style": "error", | ||
| "@typescript-eslint/consistent-generic-constructors": "error", | ||
| "@typescript-eslint/consistent-indexed-object-style": "error", | ||
| "@typescript-eslint/consistent-type-assertions": "error", | ||
| "@typescript-eslint/consistent-type-definitions": "off", | ||
| "@typescript-eslint/no-confusing-non-null-assertion": "error", | ||
| "no-empty-function": "error", | ||
| "@typescript-eslint/no-inferrable-types": "error", | ||
| "@typescript-eslint/non-nullable-type-assertion-style": "error", | ||
| "@typescript-eslint/prefer-find": "error", | ||
| "@typescript-eslint/prefer-for-of": "error", | ||
| "@typescript-eslint/prefer-function-type": "error", | ||
| "@typescript-eslint/prefer-includes": "error", | ||
| "@typescript-eslint/prefer-nullish-coalescing": "error", | ||
| "@typescript-eslint/prefer-optional-chain": "error", | ||
| "@typescript-eslint/prefer-regexp-exec": "error", | ||
| "@typescript-eslint/prefer-string-starts-ends-with": "error" | ||
| }, | ||
| "overrides": [ | ||
| { | ||
| "files": ["**/*.{js,mjs,cjs,ts,mts,cts}"], | ||
| "rules": { | ||
| "depend/ban-dependencies": "error" | ||
| }, | ||
| "jsPlugins": ["eslint-plugin-depend"], | ||
| "env": { | ||
| "browser": true | ||
| } | ||
| }, | ||
| { | ||
| "files": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"], | ||
| "rules": { | ||
| "constructor-super": "off", | ||
| "getter-return": "off", | ||
| "no-class-assign": "off", | ||
| "no-const-assign": "off", | ||
| "no-dupe-class-members": "off", | ||
| "no-dupe-keys": "off", | ||
| "no-func-assign": "off", | ||
| "no-import-assign": "off", | ||
| "no-new-native-nonconstructor": "off", | ||
| "no-obj-calls": "off", | ||
| "no-redeclare": "off", | ||
| "no-setter-return": "off", | ||
| "no-this-before-super": "off", | ||
| "no-undef": "off", | ||
| "no-unreachable": "off", | ||
| "no-unsafe-negation": "off", | ||
| "no-var": "error", | ||
| "no-with": "off", | ||
| "prefer-const": "error", | ||
| "prefer-rest-params": "error", | ||
| "prefer-spread": "error" | ||
| } | ||
| } | ||
| ], | ||
| "options": { | ||
| "typeAware": true, | ||
| "typeCheck": true | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| vp staged |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,21 @@ | ||
| { | ||
| "typescript.preferences.importModuleSpecifierEnding": "js" | ||
| "js/ts.preferences.importModuleSpecifierEnding": "js", | ||
| "editor.defaultFormatter": "oxc.oxc-vscode", | ||
| "editor.formatOnSave": true, | ||
| "editor.formatOnSaveMode": "file", | ||
| "editor.codeActionsOnSave": { | ||
| "source.fixAll.oxc": "explicit" | ||
| }, | ||
| "[typescript]": { | ||
| "editor.defaultFormatter": "oxc.oxc-vscode" | ||
| }, | ||
| "[javascript]": { | ||
| "editor.defaultFormatter": "oxc.oxc-vscode" | ||
| }, | ||
| "[typescriptreact]": { | ||
| "editor.defaultFormatter": "oxc.oxc-vscode" | ||
| }, | ||
| "[javascriptreact]": { | ||
| "editor.defaultFormatter": "oxc.oxc-vscode" | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| <!--VITE PLUS START--> | ||
|
|
||
| # Using Vite+, the Unified Toolchain for the Web | ||
|
|
||
| This project is using Vite+, a unified toolchain built on top of Vite, Rolldown, Vitest, tsdown, Oxlint, Oxfmt, and Vite Task. Vite+ wraps runtime management, package management, and frontend tooling in a single global CLI called `vp`. Vite+ is distinct from Vite, but it invokes Vite through `vp dev` and `vp build`. | ||
|
|
||
| ## Vite+ Workflow | ||
|
|
||
| `vp` is a global binary that handles the full development lifecycle. Run `vp help` to print a list of commands and `vp <command> --help` for information about a specific command. | ||
|
|
||
| ### Start | ||
|
|
||
| - create - Create a new project from a template | ||
| - migrate - Migrate an existing project to Vite+ | ||
| - config - Configure hooks and agent integration | ||
| - staged - Run linters on staged files | ||
| - install (`i`) - Install dependencies | ||
| - env - Manage Node.js versions | ||
|
|
||
| ### Develop | ||
|
|
||
| - dev - Run the development server | ||
| - check - Run format, lint, and TypeScript type checks | ||
| - lint - Lint code | ||
| - fmt - Format code | ||
| - test - Run tests | ||
|
|
||
| ### Execute | ||
|
|
||
| - run - Run monorepo tasks | ||
| - exec - Execute a command from local `node_modules/.bin` | ||
| - dlx - Execute a package binary without installing it as a dependency | ||
| - cache - Manage the task cache | ||
|
|
||
| ### Build | ||
|
|
||
| - build - Build for production | ||
| - pack - Build libraries | ||
| - preview - Preview production build | ||
|
|
||
| ### Manage Dependencies | ||
|
|
||
| Vite+ automatically detects and wraps the underlying package manager such as pnpm, npm, or Yarn through the `packageManager` field in `package.json` or package manager-specific lockfiles. | ||
|
|
||
| - add - Add packages to dependencies | ||
| - remove (`rm`, `un`, `uninstall`) - Remove packages from dependencies | ||
| - update (`up`) - Update packages to latest versions | ||
| - dedupe - Deduplicate dependencies | ||
| - outdated - Check for outdated packages | ||
| - list (`ls`) - List installed packages | ||
| - why (`explain`) - Show why a package is installed | ||
| - info (`view`, `show`) - View package information from the registry | ||
| - link (`ln`) / unlink - Manage local package links | ||
| - pm - Forward a command to the package manager | ||
|
|
||
| ### Maintain | ||
|
|
||
| - upgrade - Update `vp` itself to the latest version | ||
|
|
||
| These commands map to their corresponding tools. For example, `vp dev --port 3000` runs Vite's dev server and works the same as Vite. `vp test` runs JavaScript tests through the bundled Vitest. The version of all tools can be checked using `vp --version`. This is useful when researching documentation, features, and bugs. | ||
|
|
||
| ## Common Pitfalls | ||
|
|
||
| - **Using the package manager directly:** Do not use pnpm, npm, or Yarn directly. Vite+ can handle all package manager operations. | ||
| - **Always use Vite commands to run tools:** Don't attempt to run `vp vitest` or `vp oxlint`. They do not exist. Use `vp test` and `vp lint` instead. | ||
| - **Running scripts:** Vite+ commands take precedence over `package.json` scripts. If there is a `test` script defined in `scripts` that conflicts with the built-in `vp test` command, run it using `vp run test`. | ||
| - **Do not install Vitest, Oxlint, Oxfmt, or tsdown directly:** Vite+ wraps these tools. They must not be installed directly. You cannot upgrade these tools by installing their latest versions. Always use Vite+ commands. | ||
| - **Use Vite+ wrappers for one-off binaries:** Use `vp dlx` instead of package-manager-specific `dlx`/`npx` commands. | ||
| - **Import JavaScript modules from `vite-plus`:** Instead of importing from `vite` or `vitest`, all modules should be imported from the project's `vite-plus` dependency. For example, `import { defineConfig } from 'vite-plus';` or `import { expect, test, vi } from 'vite-plus/test';`. You must not install `vitest` to import test utilities. | ||
| - **Type-Aware Linting:** There is no need to install `oxlint-tsgolint`, `vp lint --type-aware` works out of the box. | ||
|
|
||
| ## Review Checklist for Agents | ||
|
|
||
| - [ ] Run `vp install` after pulling remote changes and before getting started. | ||
| - [ ] Run `vp check` and `vp test` to validate changes. | ||
| <!--VITE PLUS END--> |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
VS Code javascript.preferences.importModuleSpecifierEnding typescript.preferences.importModuleSpecifierEnding documentation💡 Result:
These VS Code settings control how auto-imports (IntelliSense / Quick Fix import) choose the ending of generated module specifiers (e.g. whether to drop
indexand/or include the.jsextension):javascript.preferences.importModuleSpecifierEnding(JavaScript) — valid values:"auto"(default; uses projectjsconfig),"minimal"(drop/index.js→/),"index"(keep/index),"js"(include the.jsextension). [1]typescript.preferences.importModuleSpecifierEnding(TypeScript) — same intent; docs describe:"auto","minimal"(e.g../component/index.js→./component),"index"(→./component/index),"js"(don’t shorten; include the.jsor.tsextension). [2]Example workspace/user settings:
{ "javascript.preferences.importModuleSpecifierEnding": "js", "typescript.preferences.importModuleSpecifierEnding": "js" }VS Code also lists both settings among JS/TS preferences that can be configured per-language. [3]
Sources: [1] (code.visualstudio.com) [2] (github.com) [3] (code.visualstudio.com)
Citations:
🏁 Script executed:
Repository: jakeklassen/objecs
Length of output: 85
🏁 Script executed:
Repository: jakeklassen/objecs
Length of output: 587
Use the documented JS and TS setting keys here.
VS Code documents separate
javascript.preferences.importModuleSpecifierEndingandtypescript.preferences.importModuleSpecifierEndingkeys for this preference. The combinedjs/ts.preferences.importModuleSpecifierEndingentry is not recognized and will be ignored.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents