Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 42 additions & 10 deletions .eslintrc.json
Copy link
Collaborator

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 a lint job or step to https://github.com/RooVetGit/Roo-Code/blob/main/.github/workflows/code-qa.yml.

Copy link
Contributor Author

@samhvw8 samhvw8 Jan 30, 2025

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 ?

Copy link
Collaborator

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.

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"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Collaborator

@cte cte Jan 30, 2025

Choose a reason for hiding this comment

The 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 --quiet, but ideally we should treat everything as an error and fix or disable the current warnings (not urgent; I can take care of it as a follow-up).

Copy link
Contributor Author

@samhvw8 samhvw8 Jan 30, 2025

Choose a reason for hiding this comment

The 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 --quiet, but ideally we should treat everything as an error and fix or disable the current warnings.

@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",
Expand Down
12 changes: 3 additions & 9 deletions src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,15 +409,9 @@ export class ClineProvider implements vscode.WebviewViewProvider {
// then convert it to a uri we can use in the webview.

// The CSS file from the React build output
const stylesUri = getUri(webview, this.context.extensionUri, [
"webview-ui",
"build",
"static",
"css",
"main.css",
])
const stylesUri = getUri(webview, this.context.extensionUri, ["webview-ui", "build", "assets", "index.css"])
// The JS file from the React build output
const scriptUri = getUri(webview, this.context.extensionUri, ["webview-ui", "build", "static", "js", "main.js"])
const scriptUri = getUri(webview, this.context.extensionUri, ["webview-ui", "build", "assets", "index.js"])

// The codicon font from the React build output
// https://github.com/microsoft/vscode-extension-samples/blob/main/webview-codicons-sample/src/extension.ts
Expand Down Expand Up @@ -2180,7 +2174,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
this.getGlobalState("autoApprovalEnabled") as Promise<boolean | undefined>,
this.customModesManager.getCustomModes(),
this.getGlobalState("experiments") as Promise<Record<ExperimentId, boolean> | undefined>,
this.getSecret("unboundApiKey") as Promise<string | undefined>,
this.getSecret("unboundApiKey") as Promise<string | undefined>,
this.getGlobalState("unboundModelId") as Promise<string | undefined>,
])

Expand Down
40 changes: 40 additions & 0 deletions webview-ui/.eslintrc.json
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
}
}
22 changes: 0 additions & 22 deletions webview-ui/config-overrides.js

This file was deleted.

12 changes: 12 additions & 0 deletions webview-ui/index.html
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>
Loading