Skip to content

Commit a8e4811

Browse files
committed
style: Fix lint
Signed-off-by: Richie Bendall <[email protected]>
1 parent cee0a94 commit a8e4811

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ deploy:
3333

3434
- provider: pages
3535
skip_cleanup: true
36-
github_commit: "Published documentation [skip ci]"
36+
github_commit: "chore: Published documentation [skip ci]"
3737
github_token: $github_token
3838
name: "ROS Bot"
3939

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"build": "yarn js && yarn docs",
2323
"js": "microbundle --target node --format es,cjs --external http,https,stream,zlib,cheerio,content-type,iconv-lite",
2424
"docs": "typedoc --out ./docs --mode file --target ES6 --ignoreCompilerErrors ./src",
25-
"lint": "eslint src/*"
25+
"lint": "eslint src/**/*"
2626
},
2727
"dependencies": {
2828
"cheerio": "^1.0.0-rc.3",

src/lib/convert-body.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import getCharSet from "../utils/getCharSet"
1+
import getCharSet from "../utils/get-charset"
22
import { decode as convert } from "iconv-lite"
33
import { load as $ } from "cheerio"
44

@@ -24,7 +24,7 @@ export function convertBody(buffer: Buffer, headers?: Headers): string {
2424
charset = getCharSet(
2525
$(res)("meta[charset]").attr("charset") || // HTML5
2626
$(res)("meta[http-equiv][content]").attr("content") || // HTML4
27-
$(res.replace(/<\?(.*)\?>/im, "<$1>"), { xmlMode: true }).root().find("xml").attr("encoding") // XML
27+
$(res.replace(/<\?(.*)\?>/im, "<$1>"), { xmlMode: true }).root().find("xml").attr("encoding"), // XML
2828
)
2929
}
3030

@@ -35,6 +35,6 @@ export function convertBody(buffer: Buffer, headers?: Headers): string {
3535
// Turn raw buffers into a single utf-8 buffer
3636
return convert(
3737
buffer,
38-
charset || "utf-8"
38+
charset || "utf-8",
3939
)
4040
}
File renamed without changes.

src/utils/is.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const NAME = Symbol.toStringTag;
1+
const NAME = Symbol.toStringTag
22

33
/**
44
* Check if `obj` is a URLSearchParams object
@@ -8,19 +8,19 @@ const NAME = Symbol.toStringTag;
88
*/
99
export function isURLSearchParams(obj: any): obj is URLSearchParams {
1010
return (
11-
typeof obj === 'object' &&
12-
typeof obj.append === 'function' &&
13-
typeof obj.delete === 'function' &&
14-
typeof obj.get === 'function' &&
15-
typeof obj.getAll === 'function' &&
16-
typeof obj.has === 'function' &&
17-
typeof obj.set === 'function' &&
18-
typeof obj.sort === 'function' &&
19-
obj[NAME] === 'URLSearchParams'
20-
);
11+
typeof obj === "object" &&
12+
typeof obj.append === "function" &&
13+
typeof obj.delete === "function" &&
14+
typeof obj.get === "function" &&
15+
typeof obj.getAll === "function" &&
16+
typeof obj.has === "function" &&
17+
typeof obj.set === "function" &&
18+
typeof obj.sort === "function" &&
19+
obj[NAME] === "URLSearchParams"
20+
)
2121
}
2222

23-
interface FetchBlob extends Blob {
23+
declare interface FetchBlob extends Blob {
2424
arrayBuffer: Function,
2525
type: string,
2626
stream: Function,
@@ -34,13 +34,13 @@ interface FetchBlob extends Blob {
3434
*/
3535
export function isBlob(obj: any): obj is FetchBlob {
3636
return (
37-
typeof obj === 'object' &&
38-
typeof obj.arrayBuffer === 'function' &&
39-
typeof obj.type === 'string' &&
40-
typeof obj.stream === 'function' &&
41-
typeof obj.constructor === 'function' &&
37+
typeof obj === "object" &&
38+
typeof obj.arrayBuffer === "function" &&
39+
typeof obj.type === "string" &&
40+
typeof obj.stream === "function" &&
41+
typeof obj.constructor === "function" &&
4242
/^(Blob|File)$/.test(obj[NAME])
43-
);
43+
)
4444
}
4545

4646
/**
@@ -50,9 +50,9 @@ export function isBlob(obj: any): obj is FetchBlob {
5050
*/
5151
export function isAbortSignal(obj: any): obj is AbortSignal {
5252
return (
53-
typeof obj === 'object' &&
54-
obj[NAME] === 'AbortSignal'
55-
);
53+
typeof obj === "object" &&
54+
obj[NAME] === "AbortSignal"
55+
)
5656
}
5757

5858
/**
@@ -61,15 +61,15 @@ export function isAbortSignal(obj: any): obj is AbortSignal {
6161
* @param obj The object to check.
6262
*/
6363
export function isArrayBuffer(obj: any): obj is ArrayBuffer {
64-
return obj[NAME] === 'ArrayBuffer';
64+
return obj[NAME] === "ArrayBuffer"
6565
}
6666

67-
interface AbortError extends Error {
67+
declare class AbortError extends Error {
6868
name: "AbortError";
69-
[Symbol.toStringTag]: "AbortError"
69+
[Symbol.toStringTag]: "AbortError";
7070
constructor(message: string);
7171
type: string;
72-
message: string;
72+
message: string
7373
}
7474

7575
/**
@@ -78,5 +78,5 @@ interface AbortError extends Error {
7878
* @param obj The object to check.
7979
*/
8080
export function isAbortError(obj: any): obj is AbortError {
81-
return obj[NAME] === 'AbortError';
81+
return obj[NAME] === "AbortError"
8282
}

0 commit comments

Comments
 (0)