Skip to content

Commit eb139f8

Browse files
authored
chore: update to then new eslint version #78 (#79)
1 parent 75e33c9 commit eb139f8

30 files changed

+855
-788
lines changed

.eslintrc.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
},
66
"extends": [
77
"plugin:@typescript-eslint/recommended",
8-
"plugin:@typescript-eslint/recommended-requiring-type-checking",
98
"plugin:jest/recommended",
109
"prettier/@typescript-eslint",
1110
"plugin:prettier/recommended"
@@ -41,8 +40,17 @@
4140
"@typescript-eslint/adjacent-overload-signatures": ["error"],
4241
"@typescript-eslint/ban-types": ["error"],
4342
"camelcase": "error",
44-
"@typescript-eslint/camelcase": ["error"],
45-
"@typescript-eslint/class-name-casing": ["error"],
43+
"@typescript-eslint/naming-convention": [
44+
"error",
45+
{
46+
"selector": "variable",
47+
"format": ["camelCase", "PascalCase", "UPPER_CASE"]
48+
},
49+
{
50+
"selector": "enumMember",
51+
"format": ["UPPER_CASE"]
52+
}
53+
],
4654
"@typescript-eslint/consistent-type-assertions": ["error"],
4755
"@typescript-eslint/explicit-function-return-type": ["warn"],
4856
"@typescript-eslint/member-delimiter-style": [
@@ -85,7 +93,7 @@
8593
"@typescript-eslint/prefer-for-of": "error",
8694
"@typescript-eslint/prefer-function-type": "error",
8795
"quotes": "off",
88-
"@typescript-eslint/ban-ts-ignore": "off",
96+
"@typescript-eslint/ban-ts-comment": "off",
8997
"@typescript-eslint/quotes": ["error", "backtick"],
9098
"@typescript-eslint/semi": ["error", "always"],
9199
"@typescript-eslint/unified-signatures": "error",

package.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -79,28 +79,28 @@
7979
"mutation-test": "yarn run stryker run"
8080
},
8181
"devDependencies": {
82-
"@commitlint/cli": "^8.3.5",
83-
"@commitlint/config-conventional": "^8.3.4",
84-
"@stryker-mutator/core": "^3.1.0",
85-
"@stryker-mutator/jest-runner": "^3.1.0",
86-
"@stryker-mutator/typescript": "^3.1.0",
87-
"@types/cross-spawn": "^6.0.1",
88-
"@types/jest": "^25.2.1",
82+
"@commitlint/cli": "^9.0.1",
83+
"@commitlint/config-conventional": "^9.0.1",
84+
"@stryker-mutator/core": "^3.2.4",
85+
"@stryker-mutator/jest-runner": "^3.2.4",
86+
"@stryker-mutator/typescript": "^3.2.4",
87+
"@types/cross-spawn": "^6.0.2",
88+
"@types/jest": "^25.2.3",
8989
"@types/jest-when": "^2.7.1",
90-
"@types/node": "^13.13.5",
90+
"@types/node": "^14.0.6",
9191
"@types/node-fetch": "^2.5.7",
9292
"@types/pacote": "^11.1.0",
93-
"@types/semver": "^7.1.0",
94-
"@types/shell-quote": "^1.6.1",
93+
"@types/semver": "^7.2.0",
94+
"@types/shell-quote": "^1.6.2",
9595
"@types/tmp": "^0.2.0",
9696
"@types/yargs-parser": "^15.0.0",
97-
"@typescript-eslint/eslint-plugin": "^2.31.0",
98-
"@typescript-eslint/parser": "^2.31.0",
99-
"all-contributors-cli": "^6.14.2",
100-
"cspell": "^4.0.61",
101-
"eslint": "^7.0.0",
97+
"@typescript-eslint/eslint-plugin": "^3.0.2",
98+
"@typescript-eslint/parser": "^3.0.2",
99+
"all-contributors-cli": "^6.15.0",
100+
"cspell": "^4.0.63",
101+
"eslint": "^7.1.0",
102102
"eslint-config-prettier": "^6.11.0",
103-
"eslint-plugin-jest": "^23.10.0",
103+
"eslint-plugin-jest": "^23.13.2",
104104
"eslint-plugin-prefer-arrow": "^1.2.1",
105105
"eslint-plugin-prettier": "^3.1.3",
106106
"expect": "^26.0.1",
@@ -109,36 +109,36 @@
109109
"jest": "^26.0.1",
110110
"jest-mock-extended": "^1.0.8",
111111
"jest-serial-runner": "file:./tools/jest-serial-runner",
112-
"jest-when": "^2.7.1",
113-
"lint-staged": "^10.2.2",
112+
"jest-when": "^2.7.2",
113+
"lint-staged": "^10.2.7",
114114
"mock-spawn": "^0.2.6",
115115
"node-fetch": "^2.6.0",
116-
"npm-check-updates": "^5.0.0",
116+
"npm-check-updates": "^6.0.1",
117117
"prettier": "^2.0.5",
118118
"semver": "^7.3.2",
119-
"ts-jest": "^25.5.1",
120-
"ts-node": "^8.10.1",
121-
"ts-toolbelt": "^6.7.2",
122-
"typescript": "^3.8.3"
119+
"ts-jest": "^26.0.0",
120+
"ts-node": "^8.10.2",
121+
"ts-toolbelt": "^6.9.4",
122+
"typescript": "^3.9.4"
123123
},
124124
"dependencies": {
125125
"array-flat-polyfill": "~1.0.1",
126126
"axios": "~0.19.2",
127127
"chalk": "~4.0.0",
128-
"consola": "~2.12.1",
129-
"cross-spawn": "~7.0.2",
128+
"consola": "~2.12.2",
129+
"cross-spawn": "~7.0.3",
130130
"figures": "~3.2.0",
131131
"inversify": "~5.0.1",
132-
"moment": "~2.25.3",
133-
"pacote": "~11.1.9",
132+
"moment": "~2.26.0",
133+
"pacote": "~11.1.10",
134134
"reflect-metadata": "~0.1.13",
135135
"shell-quote": "~1.7.2",
136-
"simple-git": "~2.4.0",
136+
"simple-git": "~2.5.0",
137137
"sqlite3": "~4.2.0",
138138
"tmp": "~0.2.1",
139139
"ts-type-guards": "~0.6.1",
140-
"typeorm": "~0.2.24",
141-
"yaml": "~1.9.2",
140+
"typeorm": "~0.2.25",
141+
"yaml": "~1.10.0",
142142
"yargs-parser": "~18.1.3"
143143
}
144144
}

src/db/migrations/1587992024382-autoGeneratedMigration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { MigrationInterface, QueryRunner } from 'typeorm';
22

3-
// eslint-disable-next-line @typescript-eslint/class-name-casing
3+
/* eslint-disable @typescript-eslint/naming-convention */
44
export class autoGeneratedMigration1587992024382 implements MigrationInterface {
55
name = `autoGeneratedMigration1587992024382`;
66

src/resolvers/ciResolver/impl/resolvers/githubActions/githubActionsConfigParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const isMatrixNode = (value: unknown, node: INode): value is StringOrNumber[] =>
6060
);
6161
};
6262

63-
const isIncludeMatrixNode = (value: unknown, node: INode): value is object[] => {
63+
const isIncludeMatrixNode = (value: unknown, node: INode): value is Record<string, unknown>[] => {
6464
const { parent, key } = node;
6565
return (
6666
parent.isNonRootNode &&

src/utils/logger/impl/jsonLogReporter.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ export class JsonLogReporter extends BasicReporter implements ConsolaReporter {
1313
}
1414

1515
public log(logObj: ConsolaLogObject): void {
16-
// TODO fix that after consola typings are fixed
17-
// @ts-ignore
18-
const message = this.formatArgs(logObj.args);
16+
const message = this.formatArgs(logObj.args || []);
1917
this.stream.write(
2018
`${JSON.stringify({
2119
message,

src/utils/logger/impl/logLevel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const logLevelMap = {
88
[LogLevel.INFO]: ConsolaLogLevel.Info,
99
[LogLevel.DEBUG]: ConsolaLogLevel.Debug,
1010
[LogLevel.TRACE]: ConsolaLogLevel.Trace,
11-
[LogLevel.SILENT]: -ConsolaLogLevel.Silent, // Hack until the issue in conosla is fixed. Need to also give restrictive type to object
12-
[LogLevel.VERBOSE]: ConsolaLogLevel.Silent, // Hack until the issue in conosla is fixed. Need to also give restrictive type to object
11+
[LogLevel.SILENT]: ConsolaLogLevel.Silent,
12+
[LogLevel.VERBOSE]: ConsolaLogLevel.Verbose,
1313
};
1414

1515
export const getConoslaLogLevel = (level: LogLevel): ConsolaLogLevel => logLevelMap[level];

src/utils/logger/impl/logReporter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
2-
ConsolaLogObject,
32
ConsolaReporter,
43
ConsolaReporterArgs,
4+
ConsolaReporterLogObject,
55
FancyReporter,
66
FancyReporterOptions,
77
LogLevel,
@@ -58,15 +58,15 @@ export class LogReporter extends FancyReporter implements ConsolaReporter {
5858
this.level = options.level;
5959
}
6060

61-
public log(logObj: ConsolaLogObject, args: ConsolaReporterArgs): void {
61+
public log(logObj: ConsolaReporterLogObject, args: ConsolaReporterArgs): void {
6262
// TODO fix that once consola typings are fixed
6363
if (logObj.level! > this.level) {
6464
return;
6565
}
6666
super.log(logObj, args);
6767
}
6868

69-
protected formatType(logObj: ConsolaLogObject): string {
69+
protected formatType(logObj: ConsolaReporterLogObject): string {
7070
const typeColor =
7171
(logObj.type && TYPE_COLOR_MAP[logObj.type]) ||
7272
(isNumber(logObj.level) && LEVEL_COLOR_MAP[logObj.level]) ||

src/utils/logger/impl/logger.ts

Whitespace-only changes.

src/utils/logger/impl/loggerFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import { FS, TYPES } from '../../../container/nodeModulesContainer';
1313
import Process = NodeJS.Process;
1414

1515
const fileStreamOptions = {
16-
encoding: `utf8`,
16+
encoding: `utf-8`,
1717
flags: `w`,
18-
};
18+
} as const;
1919

2020
@injectable()
2121
export class LoggerFactory extends ILoggerFactory {

test/common/inMemoryDb.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Connection, createConnection } from 'typeorm';
22

3+
// eslint-disable-next-line @typescript-eslint/ban-types
34
export const getInMemoryDb = async (entity: Function): Promise<Connection> => {
45
return createConnection({
56
name: Math.random().toString(36).substring(7),

0 commit comments

Comments
 (0)