Skip to content

Commit e0f9eea

Browse files
authored
Use the webview-ui linter during npm run lint (RooCodeInc#3938)
The webview-ui has an existing eslint config, but it was not being run as part of `npm run lint` command. Start running the webview specific linter (the top level linter doesn't run on tsx files, and webview linter has react specific checks). Fix lint errors in slash-commands file.
1 parent f10a829 commit e0f9eea

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
"watch-tests": "tsc -p . -w --outDir out",
280280
"pretest": "npm run compile-tests && npm run compile && npm run compile-standalone && npm run lint",
281281
"check-types": "npm run protos && tsc --noEmit",
282-
"lint": "eslint src --ext ts && eslint webview-ui/src --ext ts",
282+
"lint": "eslint src --ext ts && eslint webview-ui/src --ext ts && cd webview-ui && npm run lint",
283283
"format": "prettier . --check",
284284
"format:fix": "prettier . --write",
285285
"test": "npm-run-all test:unit test:integration",

webview-ui/src/utils/slash-commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ export function getWorkflowCommands(
7575

7676
// Regex for detecting slash commands in text
7777
// currently doesn't allow whitespace inside of the filename
78-
export const slashCommandRegex = /\/([a-zA-Z0-9_\.-]+)(\s|$)/
78+
export const slashCommandRegex = /\/([a-zA-Z0-9_.-]+)(\s|$)/
7979
export const slashCommandRegexGlobal = new RegExp(slashCommandRegex.source, "g")
80-
export const slashCommandDeleteRegex = /^\s*\/([a-zA-Z0-9_\.-]+)$/
80+
export const slashCommandDeleteRegex = /^\s*\/([a-zA-Z0-9_.-]+)$/
8181

8282
/**
8383
* Removes a slash command at the cursor position

0 commit comments

Comments
 (0)