Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Jul 7, 2024
1 parent 4225a16 commit d7bf421
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 21 deletions.
22 changes: 11 additions & 11 deletions src/index.d.ts → index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import accepts = require('accepts');
import { AsyncLocalStorage } from 'async_hooks';
import { EventEmitter } from 'events'
import { EventEmitter } from 'events';
import { Readable } from 'stream';
import { Socket } from 'net';
import { IncomingMessage, ServerResponse } from 'http';
Expand Down Expand Up @@ -65,10 +65,10 @@ declare module 'egg' {
export interface EggHttpClient extends EventEmitter {
request<T = any>(url: HttpClientRequestURL): Promise<HttpClientResponseOld<T> | HttpClientResponse<T>>;
request<T = any>(url: HttpClientRequestURL, options: RequestOptionsOld | HttpClientRequestOptions):
Promise<HttpClientResponseOld<T> | HttpClientResponse<T>>;
Promise<HttpClientResponseOld<T> | HttpClientResponse<T>>;
curl<T = any>(url: HttpClientRequestURL): Promise<HttpClientResponseOld<T> | HttpClientResponse<T>>;
curl<T = any>(url: HttpClientRequestURL, options: RequestOptionsOld | HttpClientRequestOptions):
Promise<HttpClientResponseOld<T> | HttpClientResponse<T>>;
Promise<HttpClientResponseOld<T> | HttpClientResponse<T>>;
}

interface EggHttpConstructor {
Expand Down Expand Up @@ -723,13 +723,13 @@ declare module 'egg' {

/**
* Get current execute ctx async local storage
* @returns {AsyncLocalStorage} localStorage - store current execute Context
* @return {AsyncLocalStorage} localStorage - store current execute Context
*/
get ctxStorage(): AsyncLocalStorage<Context>;

/**
* Get current execute ctx, maybe undefined
* @returns {Context} ctx - current execute Context
* @return {Context} ctx - current execute Context
*/
get currentContext(): Context;
}
Expand Down Expand Up @@ -1001,7 +1001,7 @@ declare module 'egg' {
* // get other fields
* console.log(stream.fields);
* ```
* @method Context#getFileStream
* @function Context#getFileStream
* @param {Object} options
* @return {ReadStream} stream
* @since 1.0.0
Expand Down Expand Up @@ -1052,7 +1052,7 @@ declare module 'egg' {
export interface IHelper extends PlainObject, BaseContextClass {
/**
* Generate URL path(without host) for route. Takes the route name and a map of named params.
* @method Helper#pathFor
* @function Helper#pathFor
* @param {String} name - Router Name
* @param {Object} params - Other params
*
Expand All @@ -1068,7 +1068,7 @@ declare module 'egg' {

/**
* Generate full URL(with host) for route. Takes the route name and a map of named params.
* @method Helper#urlFor
* @function Helper#urlFor
* @param {String} name - Router name
* @param {Object} params - Other params
* @example
Expand Down Expand Up @@ -1153,7 +1153,7 @@ declare module 'egg' {
ignoreWarning?: boolean;
}

export function start(options?: StartOptions): Promise<Application>
export function start(options?: StartOptions): Promise<Application>;

/**
* Powerful Partial, Support adding ? modifier to a mapped property in deep level
Expand All @@ -1165,8 +1165,8 @@ declare module 'egg' {
*/
export type PowerPartial<T> = {
[U in keyof T]?: T[U] extends object
? PowerPartial<T[U]>
: T[U]
? PowerPartial<T[U]>
: T[U]
};

// send data can be number|string|boolean|object but not Set|Map
Expand Down
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,17 @@
"sdk-base": "^4.2.1",
"spy": "^1.0.0",
"supertest": "^6.2.4",
"tsd": "^0.31.1",
"tshy": "^1.18.0",
"tshy-after": "^1.1.1",
"typescript": "5",
"umi": "^3.5.36"
"typescript": "5"
},
"scripts": {
"lint": "eslint app config lib test *.js",
"tsd": "tsd",
"pretest": "npm run lint -- --fix && npm run tsd",
"lint": "eslint src test --ext .ts",
"pretest": "npm run lint -- --fix",
"test": "egg-bin test",
"test:changed": "egg-bin test --changed",
"cov": "egg-bin cov --timeout 100000",
"preci": "npm run lint && npm run tsd",
"preci": "npm run lint",
"ci": "npm run cov && npm run prepublishOnly && attw --pack",
"prepublishOnly": "tshy && tshy-after",
"site:dev": "cross-env NODE_OPTIONS=--openssl-legacy-provider APP_ROOT=./site dumi dev",
Expand Down
2 changes: 1 addition & 1 deletion src/config/config.local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default () => {
},
},
} satisfies Partial<EggAppConfig>;
}
};
2 changes: 1 addition & 1 deletion src/config/config.unittest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default () => {
buffer: false,
},
} satisfies Partial<EggAppConfig>;
}
};
2 changes: 1 addition & 1 deletion src/lib/egg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export class EggApplication extends EggCore {
* See https://github.com/node-modules/urllib#api-doc for more details.
*
* @param {String} url request url address.
* @param {Object} opts
* @param {Object} options
* - method {String} - Request method, defaults to GET. Could be GET, POST, DELETE or PUT. Alias 'type'.
* - data {Object} - Data to be sent. Will be stringify automatically.
* - dataType {String} - String - Type of response data. Could be `text` or `json`.
Expand Down

0 comments on commit d7bf421

Please sign in to comment.