-
Notifications
You must be signed in to change notification settings - Fork 2.6k
refactor: migrate from CRA to Vite and improve testing #636
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,56 @@ | ||
| { | ||
| "root": true, | ||
| "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], | ||
| "parser": "@typescript-eslint/parser", | ||
| "parserOptions": { | ||
| "ecmaVersion": 6, | ||
| "sourceType": "module" | ||
| "ecmaVersion": 2021, | ||
| "sourceType": "module", | ||
| "project": "./tsconfig.json" | ||
| }, | ||
| "plugins": ["@typescript-eslint"], | ||
| "rules": { | ||
| "@typescript-eslint/naming-convention": [ | ||
| "@typescript-eslint/naming-convention": ["warn"], | ||
| "@typescript-eslint/no-explicit-any": "off", | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "warn", | ||
| { | ||
| "selector": "import", | ||
| "format": ["camelCase", "PascalCase"] | ||
| "argsIgnorePattern": "^_", | ||
| "varsIgnorePattern": "^_", | ||
| "caughtErrorsIgnorePattern": "^_" | ||
| } | ||
| ], | ||
| "@typescript-eslint/semi": "off", | ||
| "eqeqeq": "warn", | ||
| "@typescript-eslint/explicit-function-return-type": [ | ||
| "warn", | ||
| { | ||
| "allowExpressions": true, | ||
| "allowTypedFunctionExpressions": true | ||
| } | ||
| ], | ||
| "@typescript-eslint/explicit-member-accessibility": [ | ||
| "warn", | ||
| { | ||
| "accessibility": "explicit" | ||
| } | ||
| ], | ||
| "@typescript-eslint/no-non-null-assertion": "warn", | ||
| "no-throw-literal": "warn", | ||
| "semi": "off", | ||
| "react-hooks/exhaustive-deps": "off" | ||
| "semi": ["off", "always"], | ||
| "quotes": ["warn", "double", { "avoidEscape": true }], | ||
| "@typescript-eslint/ban-types": "off", | ||
| "@typescript-eslint/no-var-requires": "warn", | ||
| "no-extra-semi": "warn", | ||
| "prefer-const": "warn", | ||
| "no-mixed-spaces-and-tabs": "warn", | ||
| "no-case-declarations": "warn", | ||
| "no-useless-escape": "warn", | ||
| "require-yield": "warn", | ||
| "no-empty": "warn", | ||
| "no-control-regex": "warn", | ||
| "@typescript-eslint/ban-ts-comment": "warn" | ||
| }, | ||
| "env": { | ||
| "node": true, | ||
| "es2021": true | ||
| }, | ||
| "ignorePatterns": ["out", "dist", "**/*.d.ts"] | ||
| "ignorePatterns": ["dist/**", "out/**", "webview-ui/**", "**/*.js"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -212,7 +212,7 @@ | |
| "compile": "npm run check-types && npm run lint && node esbuild.js", | ||
| "compile-tests": "tsc -p . --outDir out", | ||
| "install:all": "npm install && cd webview-ui && npm install", | ||
| "lint": "eslint src --ext ts && npm run lint --prefix webview-ui", | ||
| "lint": "eslint src --ext ts --quiet && npm run lint --prefix webview-ui", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seem to be a ton of warnings, so I can see why we'd add
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@cte i agree with you about this, but if i do that it will has a ton of change in this PR, this pr i want to just setting it up, and another PR to fix the eslint warning & error |
||
| "package": "npm run build:webview && npm run check-types && npm run lint && node esbuild.js --production", | ||
| "pretest": "npm run compile-tests && npm run compile && npm run lint", | ||
| "start:webview": "cd webview-ui && npm run start", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "root": true, | ||
| "extends": [ | ||
| "eslint:recommended", | ||
| "plugin:react/recommended", | ||
| "plugin:@typescript-eslint/recommended", | ||
| "plugin:react-hooks/recommended" | ||
| ], | ||
| "parser": "@typescript-eslint/parser", | ||
| "plugins": ["react", "@typescript-eslint", "react-hooks"], | ||
| "rules": { | ||
| "react/react-in-jsx-scope": "off", | ||
| "@typescript-eslint/explicit-module-boundary-types": "off", | ||
| "@typescript-eslint/no-explicit-any": "warn", | ||
| "react/display-name": "warn", | ||
| "no-case-declarations": "warn", | ||
| "react/no-unescaped-entities": "warn", | ||
| "react/jsx-key": "warn", | ||
| "no-extra-semi": "warn", | ||
| "@typescript-eslint/no-var-requires": "warn", | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "warn", | ||
| { | ||
| "argsIgnorePattern": "^_", | ||
| "varsIgnorePattern": "^_", | ||
| "caughtErrorsIgnorePattern": "^_" | ||
| } | ||
| ] | ||
| }, | ||
| "settings": { | ||
| "react": { | ||
| "version": "detect" | ||
| } | ||
| }, | ||
| "env": { | ||
| "browser": true, | ||
| "es2021": true, | ||
| "node": true | ||
| } | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Roo Code</title> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/index.tsx"></script> | ||
| </body> | ||
| </html> |
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.
I don't have strong opinions about which linter rules we want enabled, but in this branch there are 51 problems when you run
npm run lint. We should probably add alintjob or step to https://github.com/RooVetGit/Roo-Code/blob/main/.github/workflows/code-qa.yml.Uh oh!
There was an error while loading. Please reload this page.
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.
@mrubens @cte Should we add to code-qa.yml it into another pr your or in this pr ?
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.
I can take care of it as a follow-up.