Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
Heliozoa committed Sep 10, 2024
1 parent 4590dc8 commit 48f4667
Show file tree
Hide file tree
Showing 19 changed files with 57 additions and 37 deletions.
10 changes: 0 additions & 10 deletions .eslintignore

This file was deleted.

13 changes: 12 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,18 @@ module.exports = {
semi: "off",
*/
},
ignorePatterns: ["webview-ui/**"],
ignorePatterns: [
"webview-ui/**",
"!.github",
"dist",
"**/node_modules",
"out",
"test-artifacts/",
"test-resources/",
"submodules/",
".vscode-test/",
"vscode.proposed.d.ts",
],
overrides: [
{
files: ["*.ts", "*.tsx"],
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"backend:start": "cd backend && npm run start",
"ci:all": "npm ci && cd backend && npm ci && cd ../webview-ui && npm ci",
"clean-local-rust-config": "cd backend && cd cli && rm -rf tmc-vscode_plugin",
"eslint": "eslint --fix . --ext .js,.ts",
"eslint-check": "eslint . --ext .js,.ts",
"eslint": "ESLINT_USE_FLAT_CONFIG=false eslint --fix . --ext .js,.ts",
"eslint-check": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .js,.ts",
"postinstall": "babel node_modules/ts-results --out-dir node_modules/ts-results --plugins=@babel/plugin-transform-modules-commonjs",
"install:all": "npm install && cd backend && npm install && cd ../webview-ui && npm install",
"lint": "eslint src --ext ts",
"lint": "ESLINT_USE_FLAT_CONFIG=false eslint src --ext ts",
"lint-check": "npm run eslint-check && npm run prettier-check",
"playwright-test": "npm run webview:build && npm run webpack && xvfb-maybe playwright test",
"playwright-test-debug": "npm run webview:build && npm run webpack && xvfb-maybe playwright test --debug",
Expand All @@ -41,7 +41,7 @@
"prettier-check": "prettier --check --ignore-path \"./src/shared/*\" --ignore-path \"./webview-ui/src/shared/*\" --ignore-path \"./.eslintignore\" \"./**/*.{html,js,json,jsx,ts,yml}\"",
"release": "./bin/publishRelease.sh",
"setup-ultimate": "git clean -X -d -f && git submodule update --init && npm run ci:all && cd backend && npm run setup",
"pretest": "cross-env NODE_ENV=development BACKEND=mockBackend npm run webpack && npm run lint",
"pretest": "cross-env NODE_ENV=development BACKEND=mockBackend npm run webpack",
"test": "node ./bin/runTests.js",
"tsc": "tsc",
"update-submodules": "git submodule foreach git pull origin master",
Expand Down Expand Up @@ -464,7 +464,7 @@
"@babel/preset-env": "^7.25.4",
"@playwright/test": "1.46.1",
"@types/chai": "^4.3.18",
"@types/chai-as-promised": "^7.1.8",
"@types/chai-as-promised": "^8.0.0",
"@types/du": "^1.0.3",
"@types/fs-extra": "^11.0.4",
"@types/lodash": "^4.17.7",
Expand Down
2 changes: 1 addition & 1 deletion src/api/tmc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as cp from "child_process";
import * as kill from "tree-kill";
import kill = require("tree-kill");

Check failure on line 2 in src/api/tmc.ts

View workflow job for this annotation

GitHub Actions / Extension tests (18.x, ubuntu-latest)

A `require()` style import is forbidden

Check failure on line 2 in src/api/tmc.ts

View workflow job for this annotation

GitHub Actions / Extension tests (18.x, macos-latest)

A `require()` style import is forbidden
import { Err, Ok, Result } from "ts-results";
import { validate } from "typia";

Expand Down
10 changes: 5 additions & 5 deletions src/config/userdata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ export class UserData {
(newExerciseId) => !courseData.exercises.find((e) => e.id === newExerciseId),
),
);
courseData.newExercises.length > 0
? Logger.info(
`Found ${courseData.newExercises.length} new exercises for ${courseData.name}`,
)
: {};
if (courseData.newExercises.length > 0) {
Logger.info(
`Found ${courseData.newExercises.length} new exercises for ${courseData.name}`,
);
}
courseData.exercises = exercises;
courseData.exercises.forEach((x) =>
x.passed ? this._passedExercises.add(x.id) : this._passedExercises.delete(x.id),
Expand Down
4 changes: 3 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,5 +213,7 @@ async function activateInner(context: vscode.ExtensionContext): Promise<void> {
}

export function deactivate(): void {
maintenanceInterval && clearInterval(maintenanceInterval);
if (maintenanceInterval) {
clearInterval(maintenanceInterval);
}
}
5 changes: 3 additions & 2 deletions src/migrate/migrateExerciseData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ async function exerciseDataFromV0toV1(
dataPath: string;
}

const dataPath = memento.get<ExtensionSettingsPartial>(UNSTABLE_EXTENSION_SETTINGS_KEY)
?.dataPath;
const dataPath = memento.get<ExtensionSettingsPartial>(
UNSTABLE_EXTENSION_SETTINGS_KEY,
)?.dataPath;
const closedExercises: { [key: string]: string[] } = {};

const exercisesToMigrate: Array<[LocalExerciseDataV0, string]> = [];
Expand Down
4 changes: 3 additions & 1 deletion src/test-integration/tmc_langs_cli.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/* eslint-disable @typescript-eslint/no-unused-expressions */

import { expect } from "chai";
import * as cp from "child_process";
import { deleteSync } from "del";
import * as fs from "fs-extra";
import { first } from "lodash";
import * as path from "path";
import * as kill from "tree-kill";
import kill = require("tree-kill");
import { Result } from "ts-results";

import TMC from "../api/tmc";
Expand Down
2 changes: 2 additions & 0 deletions src/test/api/exerciseDecorationProvider.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-expressions */

import { expect } from "chai";
import { IMock, It, Times } from "typemoq";
import * as vscode from "vscode";
Expand Down
2 changes: 2 additions & 0 deletions src/test/api/storage.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-expressions */

import { expect } from "chai";

import Storage, { ExtensionSettings, SessionState } from "../../api/storage";
Expand Down
2 changes: 2 additions & 0 deletions src/test/migrate/migrate.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-expressions */

import { expect } from "chai";
import { Ok } from "ts-results";
import { IMock } from "typemoq";
Expand Down
2 changes: 2 additions & 0 deletions src/test/migrate/migrateExerciseData.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-expressions */

import { expect } from "chai";
import { IMock, It, Times } from "typemoq";
import * as vscode from "vscode";
Expand Down
4 changes: 3 additions & 1 deletion src/test/migrate/migrateExtensionSettings.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable @typescript-eslint/no-unused-expressions */

import { expect, use } from "chai";
import * as chaiAsPromised from "chai-as-promised";
import chaiAsPromised from "chai-as-promised";
import * as tmp from "tmp";
import { IMock, It, Times } from "typemoq";
import * as vscode from "vscode";
Expand Down
2 changes: 2 additions & 0 deletions src/test/migrate/migrateSessionState.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-expressions */

import { expect } from "chai";
import * as vscode from "vscode";

Expand Down
2 changes: 2 additions & 0 deletions src/test/migrate/migrateUserData.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-expressions */

import { expect } from "chai";
import * as tmp from "tmp";
import * as vscode from "vscode";
Expand Down
2 changes: 1 addition & 1 deletion src/test/mocks/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { IMock, Mock } from "typemoq";

import UI from "../../ui/ui";

export interface UIMockValues {}
export type UIMockValues = unknown;

export function createUIMock(): [IMock<UI>, UIMockValues] {
const values: UIMockValues = {};
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/env.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ts-check

const uniq = require("lodash").uniq;
import { uniq } from "lodash";

/**@type {import("./env").Platform[]} */
const allPlatforms = [
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export async function removeOldData(oldDataObject: {
if (oldDataObject.timestamp + 10 * 60 * 1000 > Date.now()) {
try {
fs.removeSync(oldDataObject.path);
} catch (err) {
} catch (_err) {
return new Err(new Error(`Still failed to remove data from ${oldDataObject.path}`));
}
return new Ok(`Removed successfully from ${oldDataObject.path}`);
Expand Down

0 comments on commit 48f4667

Please sign in to comment.