chore: configure project wide linter (#577)

* chore(lint): configure project-wide linter

* chore(lint): improve linting in files

* chore(lint): hide warnings in CI
This commit is contained in:
Carlos Valente
2023-11-07 22:30:39 +01:00
committed by GitHub
parent 943dd19c09
commit 2c47d90f34
38 changed files with 138 additions and 171 deletions
-5
View File
@@ -3,11 +3,6 @@
"browser": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
+2 -1
View File
@@ -6,7 +6,8 @@
"private": true,
"description": "shared typings for ontime",
"scripts": {
"cleanup": "rm -rf .turbo && rm -rf node_modules"
"cleanup": "rm -rf .turbo && rm -rf node_modules",
"lint": "eslint ."
},
"keywords": [],
"author": "",
@@ -2,4 +2,4 @@ export type Alias = {
enabled: boolean;
alias: string;
pathAndParams: string;
}
};
@@ -9,5 +9,4 @@ export type UserFields = {
user7: string;
user8: string;
user9: string;
}
};
@@ -6,4 +6,4 @@ export type ViewSettings = {
warningThreshold: number;
dangerColor: string;
dangerThreshold: number;
}
};
@@ -23,5 +23,5 @@ export enum LogOrigin {
Rx = 'RX',
Server = 'SERVER',
Tx = 'TX',
User = 'USER'
User = 'USER',
}
@@ -6,4 +6,4 @@ export type Message = {
export type TimerMessage = Message & {
timerBlink: boolean;
timerBlackout: boolean;
}
};
+1 -14
View File
@@ -3,27 +3,14 @@
"browser": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"plugins": [
"simple-import-sort",
"prettier"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
"simple-import-sort"
],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"rules": {
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
"simple-import-sort/exports": "error",
"simple-import-sort/imports": "error"
}
+1 -1
View File
@@ -5,7 +5,7 @@
"private": true,
"description": "shared logic for ontime",
"scripts": {
"lint": "eslint .",
"lint": "eslint . --quiet",
"test": "vitest",
"test:pipeline": "vitest run",
"cleanup": "rm -rf .turbo && rm -rf node_modules"
+1
View File
@@ -17,6 +17,7 @@ export function getIncrement(input: string): string {
const match = regex.exec(input);
if (match) {
// If a number is found, extract the non-numeric prefix, integer part, and decimal part
// eslint-disable-next-line prefer-const -- some items in the destructuring are modified
let [, prefix, integerPart, decimalPart] = match;
if (decimalPart) {