Skip to content

Commit 6e64142

Browse files
committed
Update eslint
1 parent 450c940 commit 6e64142

File tree

6 files changed

+48
-40
lines changed

6 files changed

+48
-40
lines changed

.eslintrc.js

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,36 @@
11
module.exports = {
2-
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
3-
parserOptions: {
4-
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
5-
sourceType: "module" // Allows for the use of imports
6-
},
7-
extends: [
8-
"plugin:@typescript-eslint/recommended",
9-
"plugin:jsdoc/recommended",
10-
],
11-
rules: {
12-
"curly": ["error", "multi-or-nest"],
13-
"brace-style": ["error", "1tbs"],
14-
15-
"jsdoc/require-jsdoc": ["error", { require: { "MethodDefinition": true } }],
16-
"jsdoc/require-param-type": 0,
17-
"jsdoc/require-returns": 0,
18-
"jsdoc/require-returns-type": 0,
19-
20-
// I use them rarely but they are understandable and commented. They simplify the code.
21-
"@typescript-eslint/no-non-null-assertion": 0,
22-
"@typescript-eslint/no-non-null-asserted-optional-chain": 0,
23-
24-
// Ignore args starting with an underscore.
25-
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
26-
}
27-
};
28-
2+
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
3+
parserOptions: {
4+
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
5+
sourceType: "module" // Allows for the use of imports
6+
},
7+
extends: [
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:jsdoc/recommended",
10+
],
11+
rules: {
12+
"curly": ["error", "multi-or-nest"],
13+
"brace-style": ["error", "1tbs"],
14+
"quotes": ["error", "single"],
15+
16+
"comma-dangle": ["error", {
17+
"arrays": "always-multiline",
18+
"objects": "always-multiline",
19+
"imports": "always-multiline",
20+
"exports": "always-multiline",
21+
"functions": "always-multiline"
22+
}],
23+
24+
"jsdoc/require-jsdoc": ["error", { require: { "MethodDefinition": true } }],
25+
"jsdoc/require-param-type": 0,
26+
"jsdoc/require-returns": 0,
27+
"jsdoc/require-returns-type": 0,
28+
29+
// I use them rarely but they are understandable and commented. They simplify the code.
30+
"@typescript-eslint/no-non-null-assertion": 0,
31+
"@typescript-eslint/no-non-null-asserted-optional-chain": 0,
32+
33+
// Ignore args starting with an underscore.
34+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
35+
}
36+
};

src/dom.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { ParticipantResult } from "brackets-model";
2-
import { rankingHeader } from "./helpers";
3-
import { abbreviations } from "./lang";
4-
import { Connection, FinalType, Placement, Ranking } from "./types";
1+
import { ParticipantResult } from 'brackets-model';
2+
import { rankingHeader } from './helpers';
3+
import { abbreviations } from './lang';
4+
import { Connection, FinalType, Placement, Ranking } from './types';
55

66
/**
77
* Creates the title of the viewer.

src/helpers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Match, ParticipantResult } from "brackets-model";
2-
import { headers } from "./lang";
3-
import { RankingHeader, Ranking, RankingFormula, RankingItem, RankingMap } from "./types";
1+
import { Match, ParticipantResult } from 'brackets-model';
2+
import { headers } from './lang';
3+
import { RankingHeader, Ranking, RankingFormula, RankingItem, RankingMap } from './types';
44

55
/**
66
* Splits an array based on values of a given key of the objects of the array.

src/lang.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Status } from "brackets-model";
2-
import { isMajorRound } from "./helpers";
3-
import { FinalType, OriginHint, RankingHeaders } from "./types";
1+
import { Status } from 'brackets-model';
2+
import { isMajorRound } from './helpers';
3+
import { FinalType, OriginHint, RankingHeaders } from './types';
44

55
/**
66
* Returns an origin hint function based on rounds information.

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export class BracketsViewer {
166166
if (!upperBracket) throw Error('Upper bracket not found.');
167167

168168
const winnerWb = matches[0].opponent1;
169-
const finalsToDisplay = (winnerWb && winnerWb.id != null && winnerWb.result != "win") ? 2 : 1;
169+
const finalsToDisplay = (winnerWb && winnerWb.id != null && winnerWb.result != 'win') ? 2 : 1;
170170
const finalMatches = matches.slice(0, finalsToDisplay);
171171

172172
const roundCount = matches.length;

src/types.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Stage, Match, MatchGame, Participant } from "brackets-model";
2-
import { BracketsViewer } from "./main";
1+
import { Stage, Match, MatchGame, Participant } from 'brackets-model';
2+
import { BracketsViewer } from './main';
33

44
declare global {
55
interface Window {

0 commit comments

Comments
 (0)