Skip to content

Commit

Permalink
Revert "fix some eslint errors"
Browse files Browse the repository at this point in the history
This reverts commits 090cbc0, f01186f and 95bae90.
  • Loading branch information
robbcocco committed Feb 3, 2025
1 parent 95bae90 commit 3a1f321
Show file tree
Hide file tree
Showing 116 changed files with 4,608 additions and 4,612 deletions.
39 changes: 19 additions & 20 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import pagopa from "@pagopa/eslint-config";

export default [
...pagopa,
{
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/naming-convention": "off",
"no-invalid-this": "off",
"prefer-arrow/prefer-arrow-functions": "off",
...pagopa,
{
rules: {
"prefer-arrow/prefer-arrow-functions": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"no-invalid-this": "off",
}
},
},
{
ignores: [
"node_modules",
"generated",
"dist",
"**/__tests__/*",
"**/__mocks__/*",
"Dangerfile.*",
"*.d.ts",
],
},
];
{
ignores: [
"node_modules",
"generated",
"**/__tests__/*",
"**/__mocks__/*",
"Dangerfile.*",
"*.d.ts"
],
},
];
115 changes: 56 additions & 59 deletions src/@types/bwip-js/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,97 +1,94 @@
declare module "bwip-js" {
export interface IFontLib {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
getpaths: (arg0: any, arg1: any, arg2: number, arg3: number) => any;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
lookup: (arg0: any) => any;
getpaths: (arg0: any, arg1: any, arg2: number, arg3: number) => any;
}

export const FontLib: IFontLib;

export function fixupOptions(opts: ToBufferOptions): void;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function render(opts: ToBufferOptions, drawing: any): string;

export function toBuffer(
opts: ToBufferOptions,
callback: (err: Error | string, png: Buffer) => void,
callback: (err: string | Error, png: Buffer) => void
): void;

interface ToBufferOptions {
addontextfont?: string;
addontextsize?: number;

addontextxoffset?: number;
addontextyoffset?: number;

alttext?: boolean;
backgroundcolor?: string;

barcolor?: string;
bcid: string;
boraderbottom?: number;

bordercolor?: string;

borderleft?: number;
borderright?: number;
bordertop?: number;
borderwidth?: number;
guardheight?: number;
guardleftpos?: number;
text: string;

guardleftypos?: number;
guardrightpos?: number;
parse?: boolean;
parsefunc?: boolean;

guardrightypos?: number;
guardwhitespace?: boolean;
guardwidth?: number;
height?: number;
width?: number;

includecheck?: boolean;
includecheckintext?: boolean;
includetext?: boolean;
inkspread?: number;
scaleX?: number;
scaleY?: number;
scale?: number;

inkspreadh?: number;
inkspreadv?: number;
monochrome?: boolean;
paddingbottom?: number;
rotate?: "N" | "R" | "L" | "I";

paddingwidth?: number;
paddingheight?: number;
paddingleft?: number;

paddingright?: number;
paddingtop?: number;
paddingwidth?: number;
parse?: boolean;
paddingbottom?: number;

parsefunc?: boolean;
rotate?: "I" | "L" | "N" | "R";
scale?: number;
scaleX?: number;
monochrome?: boolean;
alttext?: boolean;

scaleY?: number;
showborder?: boolean;
sizelimit?: number;
text: string;
textcolor?: string;
includetext?: boolean;
textfont?: string;
textgaps?: number;

textsize?: number;
textgaps?: number;

textxalign?:
| "center"
| "justify"
| "left"
| "offleft"
| "left"
| "center"
| "right"
| "offright"
| "right";
| "justify";
textyalign?: "below" | "center" | "above";
textxoffset?: number;

textyalign?: "above" | "below" | "center";
textyoffset?: number;
width?: number;

showborder?: boolean;
borderwidth?: number;
borderleft?: number;
borderright?: number;
bordertop?: number;
boraderbottom?: number;

barcolor?: string;
backgroundcolor?: string;
bordercolor?: string;
textcolor?: string;

addontextxoffset?: number;
addontextyoffset?: number;
addontextfont?: string;
addontextsize?: number;

guardwhitespace?: boolean;
guardwidth?: number;
guardheight?: number;
guardleftpos?: number;
guardrightpos?: number;
guardleftypos?: number;
guardrightypos?: number;

sizelimit?: number;

includecheck?: boolean;
includecheckintext?: boolean;

inkspread?: number;
inkspreadh?: number;
inkspreadv?: number;
}
}
12 changes: 5 additions & 7 deletions src/@types/passport-auth-token/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@
declare module "passport-auth-token";

interface IVerifyOptions {
readonly headerFields: readonly string[];
readonly optional: boolean;
readonly params: boolean;
readonly tokenFields: ReadonlyArray<string>;
readonly headerFields: ReadonlyArray<string>;
readonly passReqToCallback: boolean;
readonly tokenFields: readonly string[];
readonly params: boolean;
readonly optional: boolean;
}

type VerifyFunction = (
token: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
done: (error: any, user?: any, options?: IVerifyOptions) => void,
done: (error: any, user?: any, options?: IVerifyOptions) => void
) => void;

// eslint-disable-next-line @typescript-eslint/no-extraneous-class
declare class Strategy {
constructor(verify: VerifyFunction);
}
60 changes: 31 additions & 29 deletions src/@types/passport-http-custom-bearer/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,61 @@
*/

declare module "passport-http-custom-bearer" {
import passport = require("passport");
import express = require("express");
import koa = require("koa");
import passport = require("passport");

interface IStrategyOptions {
bodyName?: string;
headerName?: string;
passReqToCallback?: boolean | undefined;
queryName?: string;
scope?: string | Array<string> | undefined;
realm?: string | undefined;
scope?: string | string[] | undefined;
passReqToCallback?: boolean | undefined;
}
interface IVerifyOptions {
message?: string | undefined;
scope: string | string[];
scope: string | Array<string>;
}

type VerifyFunction = (
token: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
done: (error: any, user?: any, options?: IVerifyOptions | string) => void,
) => void;
interface VerifyFunction {
(
token: string,
done: (error: any, user?: any, options?: IVerifyOptions | string) => void
): void;
}

interface IKoaContextContainer {
ctx: koa.Context;
}
type KoaPassportExpressRequestMock = IKoaContextContainer &
Partial<express.Request>;

type VerifyFunctionWithRequest = (
req: express.Request,
token: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
done: (error: any, user?: any, options?: IVerifyOptions | string) => void,
) => void;
type VerifyFunctionWithContext = (
req: KoaPassportExpressRequestMock,
token: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
done: (error: any, user?: any, options?: IVerifyOptions | string) => void,
) => void;
type KoaPassportExpressRequestMock = Partial<express.Request> &
IKoaContextContainer;

interface VerifyFunctionWithRequest {
(
req: express.Request,
token: string,
done: (error: any, user?: any, options?: IVerifyOptions | string) => void
): void;
}
interface VerifyFunctionWithContext {
(
req: KoaPassportExpressRequestMock,
token: string,
done: (error: any, user?: any, options?: IVerifyOptions | string) => void
): void;
}

type VerifyFunctions =
| VerifyFunction
| VerifyFunctionWithContext
| VerifyFunctionWithRequest;
| VerifyFunctionWithRequest
| VerifyFunctionWithContext;

class Strategy<T extends VerifyFunctions> implements passport.Strategy {
name: string;
constructor(verify: VerifyFunction);

constructor(options: IStrategyOptions, verify: T);
// eslint-disable-next-line @typescript-eslint/ban-types

name: string;
authenticate(req: express.Request, options?: Object): void;
}
}
4 changes: 2 additions & 2 deletions src/__tests__/lollipop-consumer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const lollipopConsumerApp = express();
lollipopConsumerApp.use(
bodyParser.json({
verify: (_req, res: express.Response, buf, _encoding: BufferEncoding) => {

// eslint-disable-next-line functional/immutable-data
res.locals.body = buf;
},
})
Expand Down Expand Up @@ -123,7 +123,7 @@ describe("lollipopSign", () => {
buf,
_encoding: BufferEncoding
) => {

// eslint-disable-next-line functional/immutable-data
res.locals.body = buf;
},
})
Expand Down
Loading

0 comments on commit 3a1f321

Please sign in to comment.