Skip to content

Commit

Permalink
refactor(apps): refactored to fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lexasq committed Jul 2, 2024
1 parent 6ef7219 commit 990a594
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
},
"rules": {
"semi": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/semi": [
"error"
],
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/src/app/components/file-upload/simple-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class SimpleDemoComponent {
disableMultipart: true, // 'DisableMultipart' must be 'true' for formatDataFunction to be called.
formatDataFunctionIsAsync: true,
formatDataFunction: async item => {
return new Promise((resolve, reject) => {
return new Promise((resolve, ) => {
resolve({
name: item._file.name,
length: item._file.size,
Expand Down
1 change: 1 addition & 0 deletions apps/demo/src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ declare const PR:any;
// declare const global:any;
// eslint-disable-next-line @typescript-eslint/prefer-namespace-keyword
declare module jasmine {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Matchers<T> {
toHaveCssClass(expected: any): boolean;
}
Expand Down
8 changes: 4 additions & 4 deletions libs/ng2-file-upload/file-upload/file-uploader.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,21 +344,21 @@ export class FileUploader {
};
xhr.onload = () => {
const headers = this._parseHeaders(xhr.getAllResponseHeaders());
const response = this._transformResponse(xhr.response, headers);
const response = this._transformResponse(xhr.response);
const gist = this._isSuccessCode(xhr.status) ? 'Success' : 'Error';
const method = `_on${gist}Item`;
(this as any)[ method ](item, response, xhr.status, headers);
this._onCompleteItem(item, response, xhr.status, headers);
};
xhr.onerror = () => {
const headers = this._parseHeaders(xhr.getAllResponseHeaders());
const response = this._transformResponse(xhr.response, headers);
const response = this._transformResponse(xhr.response);
this._onErrorItem(item, response, xhr.status, headers);
this._onCompleteItem(item, response, xhr.status, headers);
};
xhr.onabort = () => {
const headers = this._parseHeaders(xhr.getAllResponseHeaders());
const response = this._transformResponse(xhr.response, headers);
const response = this._transformResponse(xhr.response);
this._onCancelItem(item, response, xhr.status, headers);
this._onCompleteItem(item, response, xhr.status, headers);
};
Expand Down Expand Up @@ -446,7 +446,7 @@ export class FileUploader {
return (status >= 200 && status < 300) || status === 304;
}

protected _transformResponse(response: string, headers: ParsedResponseHeaders): string {
protected _transformResponse(response: string): string {
return response;
}

Expand Down

0 comments on commit 990a594

Please sign in to comment.