Skip to content

Commit

Permalink
Run typecheck and eslint on ./run lint (#6314)
Browse files Browse the repository at this point in the history
  • Loading branch information
somebody1234 authored May 4, 2023
1 parent b93edb0 commit 7885145
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/ide-desktop/lib/client/src/file-associations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function isFileOpenable(path: string): boolean {
* we manually start a new instance of the application and pass the file path to it (using the
* Windows-style command).
*/
export function onFileOpened(event: Event, path: string): string | void {
export function onFileOpened(event: Event, path: string): string | null {
logger.log(`Received 'open-file' event for path '${path}'.`)
if (isFileOpenable(path)) {
logger.log(`The file '${path}' is openable.`)
Expand All @@ -114,7 +114,6 @@ export function onFileOpened(event: Event, path: string): string | void {
if (!electron.app.isReady() && CLIENT_ARGUMENTS.length === 0) {
event.preventDefault()
logger.log(`Opening file '${path}'.`)
// eslint-disable-next-line no-restricted-syntax
return handleOpenFile(path)
} else {
// We need to start another copy of the application, as the first one is already running.
Expand All @@ -128,9 +127,11 @@ export function onFileOpened(event: Event, path: string): string | void {
})
// Prevent parent (this) process from waiting for the child to exit.
child.unref()
return null
}
} else {
logger.log(`The file '${path}' is not openable, ignoring the 'open-file' event.`)
return null
}
}

Expand Down
6 changes: 6 additions & 0 deletions build/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ use ide_ci::programs::git;
use ide_ci::programs::git::clean;
use ide_ci::programs::rustc;
use ide_ci::programs::Cargo;
use ide_ci::programs::Npm;
use ide_ci::programs::Npx;
use std::time::Duration;
use tempfile::tempdir;
use tokio::process::Child;
Expand Down Expand Up @@ -835,6 +837,10 @@ pub async fn main_internal(config: Option<enso_build::config::Config>) -> Result
.await?;

prettier::check(&ctx.repo_root).await?;
let js_modules_root = ctx.repo_root.join("app/ide-desktop");
Npm.cmd()?.current_dir(&js_modules_root).args(["install"]).run_ok().await?;
Npm.cmd()?.current_dir(&js_modules_root).args(["run", "typecheck"]).run_ok().await?;
Npx.cmd()?.current_dir(&js_modules_root).args(["eslint", "."]).run_ok().await?;
}
Target::Fmt => {
let prettier = prettier::write(&ctx.repo_root);
Expand Down

0 comments on commit 7885145

Please sign in to comment.