Skip to content
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

added linter to workflows; added .ts files to linter #30

Merged
merged 1 commit into from
Aug 23, 2023
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
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ module.exports = {
}
},
rules: {
"@typescript-eslint/ban-ts-comment": "warn",
"no-async-promise-executor": "warn",
"no-void": "off",
semi: "error",
eqeqeq: "warn",
strict: "off",
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/electron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:

- name: Install deps
run: yarn install
- name: Linter
run: yarn lint
- name: Unit tests
run: yarn test:unit
- name: Build
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ jobs:

- name: Install deps
run: yarn install
- name: Lint
run: yarn lint
- name: Unit tests
run: yarn test:unit
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "eslint --fix --ext .js,.vue src",
"lint-fix": "eslint --fix --ext .js,.vue,.ts src",
"lint": "eslint --ext .js,.vue,.ts src",
"test:unit": "vue-cli-service test:unit",
"electron:build": "vue-cli-service electron:build",
"electron:serve": "vue-cli-service electron:serve",
Expand Down
144 changes: 81 additions & 63 deletions src/CardsStorage/abstract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,87 @@
import { Directory } from "@/interfaces/Directory";
import { getMethods } from "@/utils/getMethods";


export abstract class ICloudStorage {
static getMethods() {
return getMethods(class extends ICloudStorage {
getArgv(): Promise<string[]> {
throw new Error("Method not implemented.");
}
downloadAndUnpack(url: string): Promise<void> {
throw new Error("Method not implemented.");
}
getFiles(path: string): Promise<Directory | null> {
throw new Error("Method not implemented.");
}
getConfigFile(path: string): ConfigFile | Promise<ConfigFile | null> | null {
throw new Error("Method not implemented.");
}
getDefaultImage(path: string): Buffer | Promise<Uint8Array | null> | null {
throw new Error("Method not implemented.");
}
getImage(path: string, entry: string): Buffer | Promise<Uint8Array | null> | null {
throw new Error("Method not implemented.");
}
getAudio(path: string, entry: string): Buffer | Promise<Uint8Array | null> | null {
throw new Error("Method not implemented.");
}
moveToTrash(path: string): Promise<void> {
throw new Error("Method not implemented.");
}
copyToTemp(path: string): Promise<string> {
throw new Error("Method not implemented.");
}
selectImage(path: string): Promise<string | null> {
throw new Error("Method not implemented.");
}
selectAudio(path: string): Promise<string | null> {
throw new Error("Method not implemented.");
}
createImageFromText(path: string, text: string): Promise<string | null> {
throw new Error("Method not implemented.");
}
createAudioFromText(path: string, text: string, voice: string): Promise<string | null> {
throw new Error("Method not implemented.");
}
defaultToTemp(file: string): string | Promise<string> {
throw new Error("Method not implemented.");
}
saveSet(path: string, location: string, config: ConfigFile): Promise<void> {
throw new Error("Method not implemented.");
}
moveSet(file: string, location: string): Promise<string> {
throw new Error("Method not implemented.");
}
mkdir(file: string): Promise<void> {
throw new Error("Method not implemented.");
}
rmdir(file: string): Promise<void> {
throw new Error("Method not implemented.");
}
showItemInFolder(file: string): Promise<void> {
throw new Error("Method not implemented.");
}
})
}
static getMethods () {
return getMethods(class extends ICloudStorage {
getArgv (): Promise<string[]> {
throw new Error("Method not implemented.");
}

downloadAndUnpack (url: string): Promise<void> {

Check warning on line 12 in src/CardsStorage/abstract.ts

View workflow job for this annotation

GitHub Actions / build

'url' is defined but never used

Check warning on line 12 in src/CardsStorage/abstract.ts

View workflow job for this annotation

GitHub Actions / build

'url' is defined but never used
throw new Error("Method not implemented.");
}

getFiles (path: string): Promise<Directory | null> {

Check warning on line 16 in src/CardsStorage/abstract.ts

View workflow job for this annotation

GitHub Actions / build

'path' is defined but never used

Check warning on line 16 in src/CardsStorage/abstract.ts

View workflow job for this annotation

GitHub Actions / build

'path' is defined but never used
throw new Error("Method not implemented.");
}

getConfigFile (path: string): ConfigFile | Promise<ConfigFile | null> | null {

Check warning on line 20 in src/CardsStorage/abstract.ts

View workflow job for this annotation

GitHub Actions / build

'path' is defined but never used

Check warning on line 20 in src/CardsStorage/abstract.ts

View workflow job for this annotation

GitHub Actions / build

'path' is defined but never used
throw new Error("Method not implemented.");
}

getDefaultImage (path: string): Buffer | Promise<Uint8Array | null> | null {

Check warning on line 24 in src/CardsStorage/abstract.ts

View workflow job for this annotation

GitHub Actions / build

'path' is defined but never used

Check warning on line 24 in src/CardsStorage/abstract.ts

View workflow job for this annotation

GitHub Actions / build

'path' is defined but never used
throw new Error("Method not implemented.");
}

getImage (path: string, entry: string): Buffer | Promise<Uint8Array | null> | null {

Check warning on line 28 in src/CardsStorage/abstract.ts

View workflow job for this annotation

GitHub Actions / build

'path' is defined but never used

Check warning on line 28 in src/CardsStorage/abstract.ts

View workflow job for this annotation

GitHub Actions / build

'entry' is defined but never used

Check warning on line 28 in src/CardsStorage/abstract.ts

View workflow job for this annotation

GitHub Actions / build

'path' is defined but never used

Check warning on line 28 in src/CardsStorage/abstract.ts

View workflow job for this annotation

GitHub Actions / build

'entry' is defined but never used
throw new Error("Method not implemented.");
}

getAudio (path: string, entry: string): Buffer | Promise<Uint8Array | null> | null {
throw new Error("Method not implemented.");
}

moveToTrash (path: string): Promise<void> {
throw new Error("Method not implemented.");
}

copyToTemp (path: string): Promise<string> {
throw new Error("Method not implemented.");
}

selectImage (path: string): Promise<string | null> {
throw new Error("Method not implemented.");
}

selectAudio (path: string): Promise<string | null> {
throw new Error("Method not implemented.");
}

createImageFromText (path: string, text: string): Promise<string | null> {
throw new Error("Method not implemented.");
}

createAudioFromText (path: string, text: string, voice: string): Promise<string | null> {
throw new Error("Method not implemented.");
}

defaultToTemp (file: string): string | Promise<string> {
throw new Error("Method not implemented.");
}

saveSet (path: string, location: string, config: ConfigFile): Promise<void> {
throw new Error("Method not implemented.");
}

moveSet (file: string, location: string): Promise<string> {
throw new Error("Method not implemented.");
}

mkdir (file: string): Promise<void> {
throw new Error("Method not implemented.");
}

rmdir (file: string): Promise<void> {
throw new Error("Method not implemented.");
}

showItemInFolder (file: string): Promise<void> {
throw new Error("Method not implemented.");
}
});
}

abstract getFiles(path: string): Promise<(Directory | null)>;
abstract getConfigFile(path: string): ConfigFile | null | Promise<ConfigFile | null>;
abstract getDefaultImage(path: string): Buffer | null | Promise<Uint8Array | null>;
Expand All @@ -88,4 +106,4 @@
abstract showItemInFolder(file: string): Promise<void>;

abstract getArgv(): Promise<string[]>
}
}
Loading
Loading