Skip to content

Commit

Permalink
chore: upgrade dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-oles committed Aug 8, 2021
1 parent 59a1b29 commit 6ffbbed
Show file tree
Hide file tree
Showing 25 changed files with 2,809 additions and 2,144 deletions.
34 changes: 17 additions & 17 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['plugin:node/recommended', 'plugin:prettier/recommended'],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module'
},
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:node/recommended',
'prettier',
],
settings: {
node: {
tryExtensions: ['.js', '.json', '.ts', '.d.ts']
}
tryExtensions: ['.js', '.json', '.ts', '.d.ts'],
},
},
overrides: [
{
files: ['*.ts'],
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint'
],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'node/no-unsupported-features/es-syntax': 'off'
}
'node/no-unsupported-features/es-syntax': 'off',
},
},
{
files: ['*.spec.ts'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'node/no-missing-import': 'off'
}
}
]
'node/no-missing-import': 'off',
},
},
],
};
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

commitlint --edit "$1"
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

lint-staged && yarn build && yarn test:unit
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

## Installation

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

* 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.
* 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.
Expand Down
73 changes: 34 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,8 @@
"test:e2e": "npm pack && cross-env jest --config=test/e2e/jest.config.js --ci -i -b",
"precommit": "cross-env lint-staged && yarn build && yarn test:unit",
"commit": "cross-env git-cz",
"semantic-release": "semantic-release"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged && yarn build && yarn test:unit",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
"semantic-release": "semantic-release",
"prepare": "husky install"
},
"commitlint": {
"extends": [
Expand Down Expand Up @@ -77,48 +72,48 @@
"webpack": "^5.11.0"
},
"devDependencies": {
"@commitlint/config-conventional": "^11.0.0",
"@commitlint/config-conventional": "^13.1.0",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/exec": "^5.0.0",
"@semantic-release/github": "^7.1.1",
"@semantic-release/npm": "^7.0.6",
"@semantic-release/release-notes-generator": "^9.0.1",
"@types/babel__code-frame": "^7.0.2",
"@semantic-release/github": "^7.2.3",
"@semantic-release/npm": "^7.1.3",
"@semantic-release/release-notes-generator": "^9.0.3",
"@types/babel__code-frame": "^7.0.3",
"@types/cross-spawn": "^6.0.2",
"@types/fs-extra": "^9.0.2",
"@types/jest": "^26.0.14",
"@types/fs-extra": "^9.0.12",
"@types/jest": "^26.0.24",
"@types/json-schema": "^7.0.9",
"@types/minimatch": "^3.0.1",
"@types/mock-fs": "^4.13.0",
"@types/node": "^14.11.10",
"@types/rimraf": "^3.0.0",
"@types/semver": "^7.3.4",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"commitlint": "^11.0.0",
"cross-env": "^7.0.2",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.13.0",
"@types/minimatch": "^3.0.5",
"@types/mock-fs": "^4.13.1",
"@types/node": "^16.4.13",
"@types/rimraf": "^3.0.1",
"@types/semver": "^7.3.8",
"@typescript-eslint/eslint-plugin": "^4.29.0",
"@typescript-eslint/parser": "^4.29.0",
"commitlint": "^13.1.0",
"cross-env": "^7.0.3",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"git-cz": "^4.7.1",
"husky": "^4.3.0",
"jest": "^26.5.3",
"jest-circus": "^26.5.3",
"jest-environment-node": "^26.5.2",
"eslint-plugin-prettier": "^3.4.0",
"git-cz": "^4.7.6",
"husky": "^7.0.0",
"jest": "^27.0.6",
"jest-circus": "^27.0.6",
"jest-environment-node": "^27.0.6",
"karton": "^0.4.1",
"lint-staged": "^10.4.2",
"mock-fs": "^4.13.0",
"prettier": "^2.1.2",
"lint-staged": "^11.1.2",
"mock-fs": "^5.0.0",
"prettier": "^2.3.2",
"rimraf": "^3.0.2",
"semantic-release": "^17.2.1",
"semantic-release": "^17.4.4",
"strip-ansi": "^6.0.0",
"ts-jest": "^26.4.1",
"typescript": "^3.8.3",
"webpack": "^5.11.0"
"ts-jest": "^27.0.4",
"typescript": "^4.3.5",
"webpack": "^5.49.0"
},
"engines": {
"node": ">=12",
"node": ">=12.13.0",
"yarn": ">=1.0.0"
}
}
36 changes: 30 additions & 6 deletions src/formatter/FormatterConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
import { createFormatter } from './FormatterFactory';
import { FormatterOptions } from './FormatterOptions';
import { CodeframeFormatterOptions, FormatterOptions } from './FormatterOptions';
import { Formatter } from './Formatter';
import { createBasicFormatter } from './BasicFormatter';
import { createCodeFrameFormatter } from './CodeFrameFormatter';

type FormatterConfiguration = Formatter;

function createFormatterConfiguration(options: FormatterOptions | undefined) {
return createFormatter(
options ? (typeof options === 'object' ? options.type || 'codeframe' : options) : 'codeframe',
options && typeof options === 'object' ? options.options || {} : {}
function createFormatterConfiguration(
options: FormatterOptions | undefined
): FormatterConfiguration {
if (typeof options === 'function') {
return options;
}

const type = options
? typeof options === 'object'
? options.type || 'codeframe'
: options
: 'codeframe';

if (!type || type === 'basic') {
return createBasicFormatter();
}

if (type === 'codeframe') {
const configuration =
options && typeof options === 'object'
? (options as CodeframeFormatterOptions).options || {}
: {};
return createCodeFrameFormatter(configuration);
}

throw new Error(
`Unknown "${type}" formatter. Available types are: "basic", "codeframe" or a custom function.`
);
}

Expand Down
52 changes: 0 additions & 52 deletions src/formatter/FormatterFactory.ts

This file was deleted.

23 changes: 17 additions & 6 deletions src/formatter/FormatterOptions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
import { ComplexFormatterOptions, FormatterType } from './FormatterFactory';
import { Formatter } from './Formatter';
import { BabelCodeFrameOptions } from './types/babel__code-frame';

type ComplexFormatterPreferences<T extends FormatterType = FormatterType> = {
type: T;
options?: ComplexFormatterOptions<T>;
type FormatterType = 'basic' | 'codeframe';

type BasicFormatterOptions = {
type: 'basic';
};
type CodeframeFormatterOptions = {
type: 'codeframe';
options?: BabelCodeFrameOptions;
};
type FormatterOptions = FormatterType | ComplexFormatterPreferences;
type FormatterOptions =
| undefined
| FormatterType
| BasicFormatterOptions
| CodeframeFormatterOptions
| Formatter;

export { FormatterOptions };
export { FormatterOptions, FormatterType, BasicFormatterOptions, CodeframeFormatterOptions };
1 change: 0 additions & 1 deletion src/formatter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ export * from './Formatter';
export * from './BasicFormatter';
export * from './CodeFrameFormatter';
export * from './WebpackFormatter';
export * from './FormatterFactory';
export * from './FormatterOptions';
export * from './FormatterConfiguration';
1 change: 1 addition & 0 deletions src/hooks/tapStartToConnectAndRunReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ function tapStartToConnectAndRunReporter(
const previousReportPromise = state.reportPromise;
state.reportPromise = ForkTsCheckerWebpackPlugin.pool.submit(
(done) =>
// eslint-disable-next-line no-async-promise-executor
new Promise(async (resolve) => {
change = await hooks.start.promise(change, compilation);

Expand Down
2 changes: 1 addition & 1 deletion src/reporter/AggregatedReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function createAggregatedReporter<TReporter extends Reporter>(reporter: TReporte
let resolvePending: () => void;
pendingPromise = new Promise((resolve) => {
resolvePending = () => {
resolve();
resolve(undefined);
pendingPromise = undefined;
};
});
Expand Down
2 changes: 2 additions & 0 deletions src/reporter/reporter-rpc/ReporterRpcClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ interface ReporterRpcClient extends Reporter {
disconnect: () => Promise<void>;
}

// suppressing because it will be removed anyway
// eslint-disable-next-line @typescript-eslint/ban-types
function createReporterRpcClient<TConfiguration extends object>(
channel: RpcMessageChannel,
configuration: TConfiguration
Expand Down
2 changes: 2 additions & 0 deletions src/reporter/reporter-rpc/ReporterRpcProcedure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { FilesChange } from '../FilesChange';
import { Issue } from '../../issue';
import { FilesMatch } from '../FilesMatch';

// suppressing because it will be removed anyway
// eslint-disable-next-line @typescript-eslint/ban-types
const configure: RpcProcedure<object, void> = 'configure';
const getReport: RpcProcedure<{ change: FilesChange; watching: boolean }, void> = 'getReport';
const getDependencies: RpcProcedure<void, FilesMatch> = 'getDependencies';
Expand Down
2 changes: 2 additions & 0 deletions src/reporter/reporter-rpc/ReporterRpcService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ interface ReporterRpcService {
close: () => Promise<void>;
}

// suppressing because it will be removed anyway
// eslint-disable-next-line @typescript-eslint/ban-types
function registerReporterRpcService<TConfiguration extends object>(
servicePort: RpcMessagePort,
reporterFactory: (configuration: TConfiguration) => Reporter
Expand Down
8 changes: 8 additions & 0 deletions src/rpc/RpcMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ function createRpcReturn<TProcedure extends RpcProcedure>(
return createRpcMessage(procedure, index, 'return', payload);
}

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

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

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

function isRpcThrowMessage<
// suppressing as it will be removed anyway
// eslint-disable-next-line @typescript-eslint/no-unused-vars
TType extends string = string,
TProcedure extends RpcProcedure = RpcProcedure
>(candidate: unknown): candidate is RpcThrow<TProcedure> {
Expand Down
7 changes: 6 additions & 1 deletion src/rpc/RpcProcedure.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
// eslint-disable-next-line @typescript-eslint/no-empty-interface
// suppressing as it will be removed anyway
// eslint-disable-next-line @typescript-eslint/no-empty-interface,@typescript-eslint/no-unused-vars
interface RpcProcedure<TPayload = unknown, TResult = unknown> extends String {}

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

// suppressing as it will be removed anyway
// eslint-disable-next-line @typescript-eslint/no-unused-vars
type RpcProcedureResult<TProcedure> = TProcedure extends RpcProcedure<infer TPayload, infer TResult>
? TResult
: never;
Expand Down
Loading

0 comments on commit 6ffbbed

Please sign in to comment.