Skip to content
Snippets Groups Projects
Commit 00c43c40 authored by michael.minelli's avatar michael.minelli
Browse files

Merge branch 'typescript_eslint' into v3.1.0

parents 8b2fac12 256b7ea4
Branches
Tags
No related merge requests found
Showing
with 1165 additions and 34 deletions
dist
node_modules
.gitlab-ci
\ No newline at end of file
{
"root" : true,
"parser" : "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
]
}
\ No newline at end of file
stages: stages:
- code_quality
- test - test
- build - build
- pkg_and_sign - pkg_and_sign
......
code_quality:lint:
stage: code_quality
tags:
- code_quality
image: node:latest
script:
- cd "${PROJECT_FOLDER}"
- npm install
- npm run lint
Subproject commit 4d703a2dd39ec0c2b71bbbbda8900588c4e360bd Subproject commit ffc5d65f9f0f0e825688177425e526131aa84631
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EslintConfiguration">
<option name="fix-on-save" value="true" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JSHintConfiguration" version="2.13.6" use-config-file="false">
<option asi="false" />
<option bitwise="true" />
<option boss="false" />
<option browser="true" />
<option browserify="false" />
<option camelcase="false" />
<option couch="false" />
<option curly="true" />
<option debug="false" />
<option devel="false" />
<option dojo="false" />
<option elision="false" />
<option enforceall="false" />
<option eqeqeq="true" />
<option eqnull="false" />
<option es3="false" />
<option es5="false" />
<option esnext="false" />
<option evil="false" />
<option expr="false" />
<option forin="true" />
<option freeze="false" />
<option funcscope="false" />
<option futurehostile="false" />
<option gcl="false" />
<option globalstrict="false" />
<option immed="false" />
<option iterator="false" />
<option jasmine="false" />
<option jquery="false" />
<option lastsemic="false" />
<option latedef="false" />
<option laxbreak="false" />
<option laxcomma="false" />
<option loopfunc="false" />
<option maxerr="50" />
<option mocha="false" />
<option module="false" />
<option mootools="false" />
<option moz="false" />
<option multistr="false" />
<option newcap="false" />
<option noarg="true" />
<option nocomma="false" />
<option node="true" />
<option noempty="true" />
<option nomen="false" />
<option nonbsp="false" />
<option nonew="true" />
<option nonstandard="false" />
<option notypeof="false" />
<option noyield="false" />
<option onevar="false" />
<option passfail="false" />
<option phantom="false" />
<option plusplus="false" />
<option proto="false" />
<option prototypejs="false" />
<option qunit="false" />
<option quotmark="false" />
<option rhino="false" />
<option scripturl="false" />
<option shadow="false" />
<option shelljs="false" />
<option singleGroups="false" />
<option smarttabs="false" />
<option strict="true" />
<option sub="false" />
<option supernew="false" />
<option trailing="false" />
<option typed="false" />
<option undef="true" />
<option unused="false" />
<option validthis="false" />
<option varstmt="false" />
<option white="false" />
<option withstmt="false" />
<option worker="false" />
<option wsh="false" />
<option yui="false" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
...@@ -26,9 +26,10 @@ ...@@ -26,9 +26,10 @@
}, },
"scripts" : { "scripts" : {
"dotenv:build": "npx dotenv-vault local build", "dotenv:build": "npx dotenv-vault local build",
"lint" : "npx eslint .",
"genversion" : "npx genversion -s -e src/config/Version.ts", "genversion" : "npx genversion -s -e src/config/Version.ts",
"build" : "npm run genversion; npx tsc", "build" : "npm run genversion; npx tsc",
"start:dev" : "npm run genversion; npx ts-node src/app.ts", "start:dev" : "npm run genversion; npm run lint; npx ts-node src/app.ts",
"test" : "echo \"Error: no test specified\" && exit 1" "test" : "echo \"Error: no test specified\" && exit 1"
}, },
"dependencies" : { "dependencies" : {
...@@ -58,6 +59,8 @@ ...@@ -58,6 +59,8 @@
"@types/node" : "^18.17.2", "@types/node" : "^18.17.2",
"@types/openurl" : "^1.0.1", "@types/openurl" : "^1.0.1",
"@types/tar-stream" : "^2.2.2", "@types/tar-stream" : "^2.2.2",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser" : "^6.10.0",
"dotenv-vault" : "^1.25.0", "dotenv-vault" : "^1.25.0",
"genversion" : "^3.1.1", "genversion" : "^3.1.1",
"pkg" : "^5.8.1", "pkg" : "^5.8.1",
......
// Read from the .env file // Read from the .env file
// ATTENTION : This lines MUST be the first of this file (except for the path import) // ATTENTION : These lines MUST be the first of this file (except for the path import)
const path = require('node:path'); import path = require('node:path');
const myEnv = require('dotenv').config({ import myEnv = require('dotenv');
import dotenvExpand = require('dotenv-expand');
dotenvExpand.expand(myEnv.config({
path : path.join(__dirname, '../.env'), path : path.join(__dirname, '../.env'),
DOTENV_KEY: 'dotenv://:key_fc323d8e0a02349342f1c6a119bb38495958ce3a43a87d19a3f674b7e2896dcb@dotenv.local/vault/.env.vault?environment=development' DOTENV_KEY: 'dotenv://:key_fc323d8e0a02349342f1c6a119bb38495958ce3a43a87d19a3f674b7e2896dcb@dotenv.local/vault/.env.vault?environment=development'
}); }));
require('dotenv-expand').expand(myEnv);
require('./shared/helpers/TypeScriptExtensions'); // ATTENTION : This line MUST be the second of this file require('./shared/helpers/TypeScriptExtensions'); // ATTENTION : This line MUST be the second of this file
...@@ -15,4 +19,5 @@ import HttpManager from './managers/HttpManager'; ...@@ -15,4 +19,5 @@ import HttpManager from './managers/HttpManager';
HttpManager.registerAxiosInterceptor(); HttpManager.registerAxiosInterceptor();
new CommanderApp(); new CommanderApp();
\ No newline at end of file
...@@ -10,13 +10,13 @@ abstract class CommanderCommand { ...@@ -10,13 +10,13 @@ abstract class CommanderCommand {
this.defineCommand(); this.defineCommand();
this.defineSubCommands(); this.defineSubCommands();
}; }
protected abstract defineCommand(): void; protected abstract defineCommand(): void;
protected defineSubCommands() {} protected defineSubCommands() {}
protected abstract commandAction(...args: Array<any>): Promise<void>; protected abstract commandAction(...args: Array<unknown>): Promise<void>;
} }
......
...@@ -20,7 +20,7 @@ class AssignmentCommand extends CommanderCommand { ...@@ -20,7 +20,7 @@ class AssignmentCommand extends CommanderCommand {
AssignmentUnpublishCommand.registerOnCommand(this.command); AssignmentUnpublishCommand.registerOnCommand(this.command);
} }
protected async commandAction(options: any): Promise<void> { } protected async commandAction(): Promise<void> { }
} }
......
import CommanderCommand from '../../CommanderCommand'; import CommanderCommand from '../../CommanderCommand';
import Config from '../../../config/Config'; import Config from '../../../config/Config';
import ora from 'ora'; import ora from 'ora';
import util from 'util';
import { exec } from 'child_process';
import chalk from 'chalk'; import chalk from 'chalk';
import AssignmentValidator from '../../../sharedByClients/helpers/Dojo/AssignmentValidator'; import AssignmentValidator from '../../../sharedByClients/helpers/Dojo/AssignmentValidator';
import ClientsSharedAssignmentHelper from '../../../sharedByClients/helpers/Dojo/ClientsSharedAssignmentHelper'; import ClientsSharedAssignmentHelper from '../../../sharedByClients/helpers/Dojo/ClientsSharedAssignmentHelper';
const execAsync = util.promisify(exec);
class AssignmentCheckCommand extends CommanderCommand { class AssignmentCheckCommand extends CommanderCommand {
protected commandName: string = 'check'; protected commandName: string = 'check';
...@@ -76,13 +71,13 @@ class AssignmentCheckCommand extends CommanderCommand { ...@@ -76,13 +71,13 @@ class AssignmentCheckCommand extends CommanderCommand {
} }
}); });
assignmentValidator.events.on('finished', (success: boolean, exitCode: number) => { assignmentValidator.events.on('finished', (success: boolean) => {
success ? resolve() : reject(); success ? resolve() : reject();
}); });
assignmentValidator.run(true); assignmentValidator.run(true);
}); });
} catch ( error ) { } } catch ( error ) { /* empty */ }
ClientsSharedAssignmentHelper.displayExecutionResults(assignmentValidator, `The assignment is ready to be pushed.`, { ClientsSharedAssignmentHelper.displayExecutionResults(assignmentValidator, `The assignment is ready to be pushed.`, {
INFO : chalk.bold, INFO : chalk.bold,
......
...@@ -22,7 +22,7 @@ class AssignmentCreateCommand extends CommanderCommand { ...@@ -22,7 +22,7 @@ class AssignmentCreateCommand extends CommanderCommand {
.action(this.commandAction.bind(this)); .action(this.commandAction.bind(this));
} }
protected async commandAction(options: any): Promise<void> { protected async commandAction(options: { name: string, template?: string, members_id?: Array<number>, members_username?: Array<string> }): Promise<void> {
let members!: Array<GitlabUser> | false; let members!: Array<GitlabUser> | false;
let templateIdOrNamespace: string | null = null; let templateIdOrNamespace: string | null = null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment