Skip to content

Commit

Permalink
chore(deps): bump @typescript-eslint/eslint-plugin to v6
Browse files Browse the repository at this point in the history
  • Loading branch information
yifanwww committed Sep 5, 2023
1 parent e22d7c5 commit a72a87f
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 81 deletions.
4 changes: 2 additions & 2 deletions packages/app-common/src/apis/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type IpcRendererListener<PrototypeFn extends UnknownFn> = (

// For Defining APIs

export type IpcRendererInvokerAPI<PrototypeFn extends UnknownFn> = {
export interface IpcRendererInvokerAPI<PrototypeFn extends UnknownFn> {
main: IpcMainHandler<PrototypeFn>;
renderer: IpcRendererInvoker<PrototypeFn>;
};
}
4 changes: 1 addition & 3 deletions packages/app-main/src/main/apis/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import type { IpcMainHandler } from '@ter/app-common/apis/types';
import type { AnyFn } from '@ter/app-common/types';
import { ipcMain } from 'electron';

interface Handlers<Handler> {
[windowId: string]: Handler;
}
type Handlers<Handler> = Record<string, Handler>;

export class HandlerRegister<Handler extends IpcMainHandler<AnyFn>> {
private readonly _channel: string;
Expand Down
8 changes: 2 additions & 6 deletions packages/app-renderer/src/utils/redux/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ export type ThunkFn<ReturnType, State, ThunkArgs extends unknown[]> = (

// -------------------------------------------------------------------------------------------------- DispatchingActions

export interface ReduxActions {
readonly [key: string]: ActionCreator;
}
export type ReduxActions = Readonly<Record<string, ActionCreator>>;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type ActionCreator = ActionCreatorWithPayload<any> | ActionCreatorWithoutPayload;
Expand All @@ -41,9 +39,7 @@ export type DispatchingActions<TActions extends ReduxActions> = {

// --------------------------------------------------------------------------------------------------- DispatchingThunks

export interface ReduxThunks {
readonly [key: string]: (...args: never[]) => ReduxThunkAction<unknown, never>;
}
export type ReduxThunks = Readonly<Record<string, (...args: never[]) => ReduxThunkAction<unknown, never>>>;

// prettier-ignore
export type DispatchingThunks<TThunks extends ReduxThunks> = {
Expand Down
26 changes: 16 additions & 10 deletions packages/eslint-config/.eslintrc.basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ module.exports = {
},
extends: [
'airbnb-base',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
// TODO: may enable this configuration set in the future
// 'plugin:@typescript-eslint/strict',
'plugin:@typescript-eslint/recommended-type-checked',
// TODO: may extends stricter rule configurations in the future
// 'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'prettier',
'prettier/prettier',
'plugin:jest/recommended',
Expand Down Expand Up @@ -121,7 +121,16 @@ module.exports = {
// This rule is disabled by `eslint-config-prettier`, enable it here for better eslint error information.
// https://github.com/prettier/eslint-config-prettier/#max-len
// https://eslint.org/docs/latest/rules/max-len
'max-len': ['error', { code: 120, ignoreUrls: true }],
'max-len': [
'error',
{
code: 120,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],

// https://eslint.org/docs/latest/rules/no-await-in-loop
'no-await-in-loop': 'off',
Expand Down Expand Up @@ -255,9 +264,6 @@ module.exports = {
// https://typescript-eslint.io/rules/no-empty-interface
'@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }],

// https://typescript-eslint.io/rules/no-floating-promises
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],

// https://typescript-eslint.io/rules/no-loop-func
'@typescript-eslint/no-loop-func': 'error',

Expand All @@ -283,11 +289,11 @@ module.exports = {
// https://typescript-eslint.io/rules/restrict-template-expressions
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowNumber: true, allowBoolean: true, allowAny: false, allowNullish: true, allowRegExp: true },
{ allowAny: false, allowBoolean: true, allowNullish: true, allowNumber: true, allowRegExp: true },
],

// https://typescript-eslint.io/rules/return-await
'@typescript-eslint/return-await': ['error', 'in-try-catch'],
'@typescript-eslint/return-await': 'error',

// -------------------- Eslint-Plugin-Import Rules --------------------

Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-config/.eslintrc.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ module.exports = {
extends: [
'airbnb',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
// TODO: may enable this configuration set in the future
// 'plugin:@typescript-eslint/strict',
'plugin:@typescript-eslint/recommended-type-checked',
// TODO: may extends stricter rule configurations in the future
// 'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'prettier',
'prettier/prettier',
'plugin:jest/recommended',
Expand Down
6 changes: 3 additions & 3 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"format": "prettier --write \"**/*.{cjs,css,html,js,jsx,mjs,json,less,scss,ts,tsx,yaml,yml}\""
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/src/webpack/webpack.main.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const factory: ConfigurationFactory = (env, argv) => {

cache: {
type: 'filesystem',
version: createEnvironmentHash({ NODE_ENV: process.env.NODE_ENV || 'development' }),
version: createEnvironmentHash({ NODE_ENV: process.env.NODE_ENV ?? 'development' }),
cacheDirectory: appMainPaths.webpackCache,
store: 'pack',
buildDependencies: {
Expand Down
Loading

0 comments on commit a72a87f

Please sign in to comment.