Skip to content
Snippets Groups Projects
Commit d814e8b1 authored by Valentin Perrelle's avatar Valentin Perrelle
Browse files

[ivette] lint: update the set of rules according to the current discussions

parent 484bed41
No related branches found
No related tags found
No related merge requests found
...@@ -40,17 +40,15 @@ module.exports = { ...@@ -40,17 +40,15 @@ module.exports = {
"lines-between-class-members": [ "lines-between-class-members": [
"error", "always", { "exceptAfterSingleLine": true } "error", "always", { "exceptAfterSingleLine": true }
], ],
// Disallow the use of var in favor of let and const
"no-var": "error",
// Force curly brackets on newline if some item is // Force curly brackets on newline if some item is
"object-curly-newline": ["error", { "multiline": true }], "object-curly-newline": ["error", { "multiline": true }],
// Allow infinite loops but disallow constant if-then-else
"no-constant-condition": ["error", { "checkLoops": false }],
// --- Safety rules --- // --- Safety rules ---
// Be more strict on usage of useMemo and useRef // Be more strict on usage of useMemo and useRef
"react-hooks/exhaustive-deps": "error", "react-hooks/exhaustive-deps": "error",
// Forbid shadowing concerning variables
"no-shadow": "off",
// Requires '+' to be applied on 2 numbers or 2 strings only // Requires '+' to be applied on 2 numbers or 2 strings only
"@typescript-eslint/restrict-plus-operands": "error", "@typescript-eslint/restrict-plus-operands": "error",
// Only use type safe comparison === as == between distinct type is not so obvious // Only use type safe comparison === as == between distinct type is not so obvious
...@@ -64,12 +62,7 @@ module.exports = { ...@@ -64,12 +62,7 @@ module.exports = {
"varsIgnorePattern": "^_", "varsIgnorePattern": "^_",
"argsIgnorePattern": "^_" } "argsIgnorePattern": "^_" }
], ],
// Disallow the use of var in favor of let and const
// --- Laxism --- "no-var": "error",
// Allow type any until we have types for every external library
"@typescript-eslint/no-explicit-any": "off",
// Actually, allow any function without return type for now
"@typescript-eslint/explicit-function-return-type": "off",
} }
}; };
{
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-function-return-type": "off"
}
}
\ No newline at end of file
...@@ -453,6 +453,7 @@ export function eObject<A>(fp: EProps<A>): Encoder<A> { ...@@ -453,6 +453,7 @@ export function eObject<A>(fp: EProps<A>): Encoder<A> {
} }
// Intentionnaly internal and only declared // Intentionnaly internal and only declared
// eslint-disable-next-line @typescript-eslint/no-unused-vars
declare const tag: unique symbol; declare const tag: unique symbol;
/** Phantom type. */ /** Phantom type. */
......
{
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-function-return-type": "off"
}
}
\ No newline at end of file
...@@ -98,15 +98,15 @@ export type Evaluation = Values.evaluation; ...@@ -98,15 +98,15 @@ export type Evaluation = Values.evaluation;
const emptyEvaluation: Values.evaluation = { const emptyEvaluation: Values.evaluation = {
value: '', value: '',
alarms: [], alarms: [],
pointed_vars: [], pointedVars: [],
}; };
export interface EvaValues { export interface EvaValues {
errors?: string; errors?: string;
v_before: Evaluation; vBefore: Evaluation;
v_after?: Evaluation; vAfter?: Evaluation;
v_then?: Evaluation; vThen?: Evaluation;
v_else?: Evaluation; vElse?: Evaluation;
size: Size; size: Size;
} }
...@@ -166,7 +166,7 @@ export class ValueCache { ...@@ -166,7 +166,7 @@ export class ValueCache {
const cache = this.vcache; const cache = this.vcache;
const cached = cache.get(key); const cached = cache.get(key);
if (cached) return cached; if (cached) return cached;
const newValue: EvaValues = { v_before: emptyEvaluation, size: EMPTY }; const newValue: EvaValues = { vBefore: emptyEvaluation, size: EMPTY };
if (callstack !== undefined && fct === undefined) if (callstack !== undefined && fct === undefined)
return newValue; return newValue;
// callstack !== undefined ==> fct !== undefined) // callstack !== undefined ==> fct !== undefined)
...@@ -175,7 +175,7 @@ export class ValueCache { ...@@ -175,7 +175,7 @@ export class ValueCache {
.send(Values.getValues, { target: marker, callstack }) .send(Values.getValues, { target: marker, callstack })
.then((r) => { .then((r) => {
newValue.errors = undefined; newValue.errors = undefined;
if (r.v_before) newValue.v_before = r.v_before; if (r.vBefore) newValue.vBefore = r.v_before;
newValue.v_after = r.v_after; newValue.v_after = r.v_after;
newValue.v_then = r.v_then; newValue.v_then = r.v_then;
newValue.v_else = r.v_else; newValue.v_else = r.v_else;
......
{
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-function-return-type": "off"
}
}
\ No newline at end of file
{
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-function-return-type": "off"
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment