Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8ba75f8

Browse files
committed
migration to typescript-eslint 3.0
1 parent 6cb401d commit 8ba75f8

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

‎.eslintrc.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ module.exports = {
3737

3838
"@typescript-eslint/await-thenable": "warn",
3939
"@typescript-eslint/array-type": ["warn", { default: "generic" }],
40-
"@typescript-eslint/camelcase": "warn",
41-
"@typescript-eslint/class-name-casing": "warn", // to allow the initial underscore
40+
"@typescript-eslint/naming-convention": [
41+
"warn",
42+
{ "selector": "default", "format": ["camelCase", "UPPER_CASE", "PascalCase"], "leadingUnderscore": "allow" },
43+
{ "selector": "typeLike", "format": ["PascalCase"], "leadingUnderscore": "allow" },
44+
],
4245
"@typescript-eslint/restrict-plus-operands": ["warn", { "checkCompoundAssignments": true }],
4346
"@typescript-eslint/no-non-null-assertion": "warn", // NOTE: pay attention to it because it may cause unexpected behavior
4447
"@typescript-eslint/no-throw-literal": "warn",
@@ -61,6 +64,7 @@ module.exports = {
6164
"@typescript-eslint/prefer-ts-expect-error": "warn",
6265

6366
"@typescript-eslint/indent": "off",
67+
"@typescript-eslint/explicit-module-boundary-types": "off",
6468
"@typescript-eslint/explicit-function-return-type": "off",
6569
"@typescript-eslint/explicit-member-accessibility": "off",
6670
"@typescript-eslint/no-explicit-any": "off",

‎src/ExtensionCodec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export type ExtensionEncoderType<ContextType> = (input: unknown, context: Contex
1313

1414
// immutable interfce to ExtensionCodec
1515
export type ExtensionCodecType<ContextType> = {
16+
// eslint-disable-next-line @typescript-eslint/naming-convention
1617
__brand?: ContextType;
1718
tryToEncode(object: unknown, context: ContextType): ExtData | null;
1819
decode(data: Uint8Array, extType: number, context: ContextType): unknown;
@@ -23,6 +24,7 @@ export class ExtensionCodec<ContextType = undefined> implements ExtensionCodecTy
2324

2425
// ensures ExtensionCodecType<X> matches ExtensionCodec<X>
2526
// this will make type errors a lot more clear
27+
// eslint-disable-next-line @typescript-eslint/naming-convention
2628
__brand?: ContextType;
2729

2830
// built-in extensions

‎src/context.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable @typescript-eslint/ban-types */
2+
13
export type SplitTypes<T, U> = U extends T ? U : Exclude<T, U>;
24
export type SplitUndefined<T> = SplitTypes<T, undefined>;
35

‎src/utils/stream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// See https://streams.spec.whatwg.org/ for details
77
export type ReadableStreamLike<T> = AsyncIterable<T> | ReadableStream<T>;
88

9-
export function isAsyncIterable<T>(object: object): object is AsyncIterable<T> {
9+
export function isAsyncIterable<T>(object: ReadableStreamLike<T>): object is AsyncIterable<T> {
1010
return (object as any)[Symbol.asyncIterator] != null;
1111
}
1212

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /