Skip to content

Commit 6ffbbed

Browse files
committed
chore: upgrade dev dependencies
1 parent 59a1b29 commit 6ffbbed

25 files changed

+2809
-2144
lines changed

.eslintrc.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
module.exports = {
2+
root: true,
23
parser: '@typescript-eslint/parser',
3-
extends: ['plugin:node/recommended', 'plugin:prettier/recommended'],
4-
parserOptions: {
5-
ecmaVersion: 2018,
6-
sourceType: 'module'
7-
},
4+
plugins: ['@typescript-eslint'],
5+
extends: [
6+
'eslint:recommended',
7+
'plugin:@typescript-eslint/recommended',
8+
'plugin:node/recommended',
9+
'prettier',
10+
],
811
settings: {
912
node: {
10-
tryExtensions: ['.js', '.json', '.ts', '.d.ts']
11-
}
13+
tryExtensions: ['.js', '.json', '.ts', '.d.ts'],
14+
},
1215
},
1316
overrides: [
1417
{
1518
files: ['*.ts'],
16-
extends: [
17-
'plugin:@typescript-eslint/recommended',
18-
'prettier/@typescript-eslint'
19-
],
2019
rules: {
2120
'@typescript-eslint/explicit-function-return-type': 'off',
21+
'@typescript-eslint/explicit-module-boundary-types': 'off',
2222
'@typescript-eslint/no-use-before-define': 'off',
23-
'node/no-unsupported-features/es-syntax': 'off'
24-
}
23+
'node/no-unsupported-features/es-syntax': 'off',
24+
},
2525
},
2626
{
2727
files: ['*.spec.ts'],
2828
rules: {
2929
'@typescript-eslint/no-var-requires': 'off',
30-
'node/no-missing-import': 'off'
31-
}
32-
}
33-
]
30+
'node/no-missing-import': 'off',
31+
},
32+
},
33+
],
3434
};

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
commitlint --edit "$1"

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
lint-staged && yarn build && yarn test:unit

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
## Installation
2323

24-
This plugin requires minimum **Node.js 12+**, **Webpack ^5.11.0**, **TypeScript ^3.6.0**
24+
This plugin requires **Node.js >=12.13.0+**, **Webpack ^5.11.0**, **TypeScript ^3.6.0**
2525

2626
* If you depend on **TypeScript 2.1 - 2.6.2**, please use [version 4](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/tree/v4.1.4) of the plugin.
2727
* If you depend on **Webpack 4**, **TypeScript 2.7 - 3.5.3** or **ESLint** feature, please use [version 6](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/tree/v6.2.6) of the plugin.

package.json

+34-39
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,8 @@
3838
"test:e2e": "npm pack && cross-env jest --config=test/e2e/jest.config.js --ci -i -b",
3939
"precommit": "cross-env lint-staged && yarn build && yarn test:unit",
4040
"commit": "cross-env git-cz",
41-
"semantic-release": "semantic-release"
42-
},
43-
"husky": {
44-
"hooks": {
45-
"pre-commit": "lint-staged && yarn build && yarn test:unit",
46-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
47-
}
41+
"semantic-release": "semantic-release",
42+
"prepare": "husky install"
4843
},
4944
"commitlint": {
5045
"extends": [
@@ -77,48 +72,48 @@
7772
"webpack": "^5.11.0"
7873
},
7974
"devDependencies": {
80-
"@commitlint/config-conventional": "^11.0.0",
75+
"@commitlint/config-conventional": "^13.1.0",
8176
"@semantic-release/commit-analyzer": "^8.0.1",
8277
"@semantic-release/exec": "^5.0.0",
83-
"@semantic-release/github": "^7.1.1",
84-
"@semantic-release/npm": "^7.0.6",
85-
"@semantic-release/release-notes-generator": "^9.0.1",
86-
"@types/babel__code-frame": "^7.0.2",
78+
"@semantic-release/github": "^7.2.3",
79+
"@semantic-release/npm": "^7.1.3",
80+
"@semantic-release/release-notes-generator": "^9.0.3",
81+
"@types/babel__code-frame": "^7.0.3",
8782
"@types/cross-spawn": "^6.0.2",
88-
"@types/fs-extra": "^9.0.2",
89-
"@types/jest": "^26.0.14",
83+
"@types/fs-extra": "^9.0.12",
84+
"@types/jest": "^26.0.24",
9085
"@types/json-schema": "^7.0.9",
91-
"@types/minimatch": "^3.0.1",
92-
"@types/mock-fs": "^4.13.0",
93-
"@types/node": "^14.11.10",
94-
"@types/rimraf": "^3.0.0",
95-
"@types/semver": "^7.3.4",
96-
"@typescript-eslint/eslint-plugin": "^2.27.0",
97-
"@typescript-eslint/parser": "^2.27.0",
98-
"commitlint": "^11.0.0",
99-
"cross-env": "^7.0.2",
100-
"eslint": "^6.8.0",
101-
"eslint-config-prettier": "^6.13.0",
86+
"@types/minimatch": "^3.0.5",
87+
"@types/mock-fs": "^4.13.1",
88+
"@types/node": "^16.4.13",
89+
"@types/rimraf": "^3.0.1",
90+
"@types/semver": "^7.3.8",
91+
"@typescript-eslint/eslint-plugin": "^4.29.0",
92+
"@typescript-eslint/parser": "^4.29.0",
93+
"commitlint": "^13.1.0",
94+
"cross-env": "^7.0.3",
95+
"eslint": "^7.32.0",
96+
"eslint-config-prettier": "^8.3.0",
10297
"eslint-plugin-node": "^11.1.0",
103-
"eslint-plugin-prettier": "^3.1.4",
104-
"git-cz": "^4.7.1",
105-
"husky": "^4.3.0",
106-
"jest": "^26.5.3",
107-
"jest-circus": "^26.5.3",
108-
"jest-environment-node": "^26.5.2",
98+
"eslint-plugin-prettier": "^3.4.0",
99+
"git-cz": "^4.7.6",
100+
"husky": "^7.0.0",
101+
"jest": "^27.0.6",
102+
"jest-circus": "^27.0.6",
103+
"jest-environment-node": "^27.0.6",
109104
"karton": "^0.4.1",
110-
"lint-staged": "^10.4.2",
111-
"mock-fs": "^4.13.0",
112-
"prettier": "^2.1.2",
105+
"lint-staged": "^11.1.2",
106+
"mock-fs": "^5.0.0",
107+
"prettier": "^2.3.2",
113108
"rimraf": "^3.0.2",
114-
"semantic-release": "^17.2.1",
109+
"semantic-release": "^17.4.4",
115110
"strip-ansi": "^6.0.0",
116-
"ts-jest": "^26.4.1",
117-
"typescript": "^3.8.3",
118-
"webpack": "^5.11.0"
111+
"ts-jest": "^27.0.4",
112+
"typescript": "^4.3.5",
113+
"webpack": "^5.49.0"
119114
},
120115
"engines": {
121-
"node": ">=12",
116+
"node": ">=12.13.0",
122117
"yarn": ">=1.0.0"
123118
}
124119
}

src/formatter/FormatterConfiguration.ts

+30-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,37 @@
1-
import { createFormatter } from './FormatterFactory';
2-
import { FormatterOptions } from './FormatterOptions';
1+
import { CodeframeFormatterOptions, FormatterOptions } from './FormatterOptions';
32
import { Formatter } from './Formatter';
3+
import { createBasicFormatter } from './BasicFormatter';
4+
import { createCodeFrameFormatter } from './CodeFrameFormatter';
45

56
type FormatterConfiguration = Formatter;
67

7-
function createFormatterConfiguration(options: FormatterOptions | undefined) {
8-
return createFormatter(
9-
options ? (typeof options === 'object' ? options.type || 'codeframe' : options) : 'codeframe',
10-
options && typeof options === 'object' ? options.options || {} : {}
8+
function createFormatterConfiguration(
9+
options: FormatterOptions | undefined
10+
): FormatterConfiguration {
11+
if (typeof options === 'function') {
12+
return options;
13+
}
14+
15+
const type = options
16+
? typeof options === 'object'
17+
? options.type || 'codeframe'
18+
: options
19+
: 'codeframe';
20+
21+
if (!type || type === 'basic') {
22+
return createBasicFormatter();
23+
}
24+
25+
if (type === 'codeframe') {
26+
const configuration =
27+
options && typeof options === 'object'
28+
? (options as CodeframeFormatterOptions).options || {}
29+
: {};
30+
return createCodeFrameFormatter(configuration);
31+
}
32+
33+
throw new Error(
34+
`Unknown "${type}" formatter. Available types are: "basic", "codeframe" or a custom function.`
1135
);
1236
}
1337

src/formatter/FormatterFactory.ts

-52
This file was deleted.

src/formatter/FormatterOptions.ts

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1-
import { ComplexFormatterOptions, FormatterType } from './FormatterFactory';
1+
import { Formatter } from './Formatter';
2+
import { BabelCodeFrameOptions } from './types/babel__code-frame';
23

3-
type ComplexFormatterPreferences<T extends FormatterType = FormatterType> = {
4-
type: T;
5-
options?: ComplexFormatterOptions<T>;
4+
type FormatterType = 'basic' | 'codeframe';
5+
6+
type BasicFormatterOptions = {
7+
type: 'basic';
8+
};
9+
type CodeframeFormatterOptions = {
10+
type: 'codeframe';
11+
options?: BabelCodeFrameOptions;
612
};
7-
type FormatterOptions = FormatterType | ComplexFormatterPreferences;
13+
type FormatterOptions =
14+
| undefined
15+
| FormatterType
16+
| BasicFormatterOptions
17+
| CodeframeFormatterOptions
18+
| Formatter;
819

9-
export { FormatterOptions };
20+
export { FormatterOptions, FormatterType, BasicFormatterOptions, CodeframeFormatterOptions };

src/formatter/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ export * from './Formatter';
22
export * from './BasicFormatter';
33
export * from './CodeFrameFormatter';
44
export * from './WebpackFormatter';
5-
export * from './FormatterFactory';
65
export * from './FormatterOptions';
76
export * from './FormatterConfiguration';

src/hooks/tapStartToConnectAndRunReporter.ts

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ function tapStartToConnectAndRunReporter(
7979
const previousReportPromise = state.reportPromise;
8080
state.reportPromise = ForkTsCheckerWebpackPlugin.pool.submit(
8181
(done) =>
82+
// eslint-disable-next-line no-async-promise-executor
8283
new Promise(async (resolve) => {
8384
change = await hooks.start.promise(change, compilation);
8485

src/reporter/AggregatedReporter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function createAggregatedReporter<TReporter extends Reporter>(reporter: TReporte
1717
let resolvePending: () => void;
1818
pendingPromise = new Promise((resolve) => {
1919
resolvePending = () => {
20-
resolve();
20+
resolve(undefined);
2121
pendingPromise = undefined;
2222
};
2323
});

src/reporter/reporter-rpc/ReporterRpcClient.ts

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ interface ReporterRpcClient extends Reporter {
1616
disconnect: () => Promise<void>;
1717
}
1818

19+
// suppressing because it will be removed anyway
20+
// eslint-disable-next-line @typescript-eslint/ban-types
1921
function createReporterRpcClient<TConfiguration extends object>(
2022
channel: RpcMessageChannel,
2123
configuration: TConfiguration

src/reporter/reporter-rpc/ReporterRpcProcedure.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { FilesChange } from '../FilesChange';
33
import { Issue } from '../../issue';
44
import { FilesMatch } from '../FilesMatch';
55

6+
// suppressing because it will be removed anyway
7+
// eslint-disable-next-line @typescript-eslint/ban-types
68
const configure: RpcProcedure<object, void> = 'configure';
79
const getReport: RpcProcedure<{ change: FilesChange; watching: boolean }, void> = 'getReport';
810
const getDependencies: RpcProcedure<void, FilesMatch> = 'getDependencies';

src/reporter/reporter-rpc/ReporterRpcService.ts

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ interface ReporterRpcService {
1515
close: () => Promise<void>;
1616
}
1717

18+
// suppressing because it will be removed anyway
19+
// eslint-disable-next-line @typescript-eslint/ban-types
1820
function registerReporterRpcService<TConfiguration extends object>(
1921
servicePort: RpcMessagePort,
2022
reporterFactory: (configuration: TConfiguration) => Reporter

src/rpc/RpcMessage.ts

+8
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ function createRpcReturn<TProcedure extends RpcProcedure>(
6565
return createRpcMessage(procedure, index, 'return', payload);
6666
}
6767

68+
// suppressing as it will be removed anyway
69+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6870
function createRpcThrow<TProcedure extends RpcProcedure, TError = Error>(
6971
procedure: TProcedure,
7072
index: number,
@@ -81,20 +83,26 @@ function isRpcMessage<
8183
}
8284

8385
function isRpcCallMessage<
86+
// suppressing as it will be removed anyway
87+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
8488
TType extends string = string,
8589
TProcedure extends RpcProcedure = RpcProcedure
8690
>(candidate: unknown): candidate is RpcCall<TProcedure> {
8791
return isRpcMessage(candidate) && candidate.type === 'call';
8892
}
8993

9094
function isRpcReturnMessage<
95+
// suppressing as it will be removed anyway
96+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
9197
TType extends string = string,
9298
TProcedure extends RpcProcedure = RpcProcedure
9399
>(candidate: unknown): candidate is RpcReturn<TProcedure> {
94100
return isRpcMessage(candidate) && candidate.type === 'return';
95101
}
96102

97103
function isRpcThrowMessage<
104+
// suppressing as it will be removed anyway
105+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
98106
TType extends string = string,
99107
TProcedure extends RpcProcedure = RpcProcedure
100108
>(candidate: unknown): candidate is RpcThrow<TProcedure> {

src/rpc/RpcProcedure.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
1+
// suppressing as it will be removed anyway
2+
// eslint-disable-next-line @typescript-eslint/no-empty-interface,@typescript-eslint/no-unused-vars
23
interface RpcProcedure<TPayload = unknown, TResult = unknown> extends String {}
34

45
type RpcProcedurePayload<TProcedure> = TProcedure extends RpcProcedure<
56
infer TPayload,
7+
// suppressing as it will be removed anyway
8+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
69
infer TResult
710
>
811
? TPayload
912
: never;
1013

14+
// suppressing as it will be removed anyway
15+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1116
type RpcProcedureResult<TProcedure> = TProcedure extends RpcProcedure<infer TPayload, infer TResult>
1217
? TResult
1318
: never;

0 commit comments

Comments
 (0)