chore: update eslint and prettier dependencies
There were some minor changes that resulted in a few code style changes, but not much. Signed-off-by: Lance Ball <lball@redhat.com>
This commit is contained in:
parent
b5100566c6
commit
0207db04f8
12
.eslintrc
12
.eslintrc
|
|
@ -5,9 +5,8 @@
|
|||
"sourceType": "module"
|
||||
},
|
||||
"extends": [
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier/@typescript-eslint",
|
||||
"plugin:prettier/recommended"
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:@typescript-eslint/recommended"
|
||||
],
|
||||
"env": {
|
||||
"es6": true,
|
||||
|
|
@ -25,9 +24,6 @@
|
|||
"arrow-body-style": ["error", "as-needed"],
|
||||
"prefer-template": "error",
|
||||
"max-len": ["warn", { "code": 120 }],
|
||||
"no-unused-vars": ["warn", {
|
||||
"argsIgnorePattern": "^_$|^e$|^reject$|^resolve$"
|
||||
}],
|
||||
"no-console": ["error", {
|
||||
"allow": ["warn", "error"]
|
||||
}],
|
||||
|
|
@ -35,6 +31,8 @@
|
|||
"semi": ["error", "always"],
|
||||
"quotes": ["error", "double", { "allowTemplateLiterals": true }],
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"header/header": [2, "block", ["", " Copyright 2021 The CloudEvents Authors"," SPDX-License-Identifier: Apache-2.0", ""], 2]
|
||||
"header/header": [2, "block", ["", " Copyright 2021 The CloudEvents Authors"," SPDX-License-Identifier: Apache-2.0", ""], 2],
|
||||
"no-unused-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": ["error"]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
19
package.json
19
package.json
|
|
@ -118,21 +118,22 @@
|
|||
"@types/node": "^14.14.10",
|
||||
"@types/superagent": "^4.1.10",
|
||||
"@types/uuid": "^8.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^3.4.0",
|
||||
"@typescript-eslint/parser": "^3.4.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.29.0",
|
||||
"@typescript-eslint/parser": "^4.29.0",
|
||||
"axios": "^0.21.1",
|
||||
"chai": "~4.2.0",
|
||||
"cucumber": "^6.0.5",
|
||||
"cucumber-pretty": "^6.0.0",
|
||||
"cucumber-tsflow": "^3.2.0",
|
||||
"downtotemp": "^0.1.2",
|
||||
"eslint": "^7.3.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-config-standard": "^14.1.1",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-config-standard": "^16.0.3",
|
||||
"eslint-plugin-header": "^3.1.1",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint-plugin-import": "^2.23.4",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-prettier": "^3.1.4",
|
||||
"eslint-plugin-prettier": "^3.4.0",
|
||||
"eslint-plugin-promise": "^5.1.0",
|
||||
"got": "^11.7.0",
|
||||
"http-parser-js": "^0.5.2",
|
||||
"mocha": "~8.2.0",
|
||||
|
|
@ -145,8 +146,8 @@
|
|||
"remark-preset-lint-recommended": "^5.0.0",
|
||||
"superagent": "^6.1.0",
|
||||
"ts-node": "^8.10.2",
|
||||
"typedoc": "^0.20.24",
|
||||
"typescript": "^3.8.3",
|
||||
"typedoc": "^0.21.5",
|
||||
"typescript": "^4.3.5",
|
||||
"webpack": "^5.1.1",
|
||||
"webpack-cli": "^4.0.0"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -70,10 +70,10 @@ export class CloudEvent implements CloudEventV1, CloudEventV03 {
|
|||
delete properties.time;
|
||||
|
||||
this.type = properties.type;
|
||||
delete properties.type;
|
||||
delete (properties as any).type;
|
||||
|
||||
this.source = properties.source;
|
||||
delete properties.source;
|
||||
delete (properties as any).source;
|
||||
|
||||
this.specversion = (properties.specversion as Version) || Version.V1;
|
||||
delete properties.specversion;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ export class ValidationError extends TypeError {
|
|||
|
||||
export const isString = (v: unknown): boolean => typeof v === "string";
|
||||
export const isObject = (v: unknown): boolean => typeof v === "object";
|
||||
export const isDefined = (v: unknown): boolean => v && typeof v !== "undefined";
|
||||
export const isDefined = (v: unknown): boolean => v !== null && typeof v !== "undefined";
|
||||
|
||||
export const isBoolean = (v: unknown): boolean => typeof v === "boolean";
|
||||
export const isInteger = (v: unknown): boolean => Number.isInteger(v as number);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ export interface TransportFunction {
|
|||
(message: Message, options?: Options): Promise<unknown>;
|
||||
}
|
||||
|
||||
const emitterDefaults = { binding: HTTP, mode: Mode.BINARY };
|
||||
const emitterDefaults: Options = { binding: HTTP, mode: Mode.BINARY };
|
||||
/**
|
||||
* Creates and returns an {@linkcode EmitterFunction} using the supplied
|
||||
* {@linkcode TransportFunction}. The returned {@linkcode EmitterFunction}
|
||||
|
|
@ -55,7 +55,7 @@ export function emitterFor(fn: TransportFunction, options = emitterDefaults): Em
|
|||
if (!fn) {
|
||||
throw new TypeError("A TransportFunction is required");
|
||||
}
|
||||
const { binding, mode } = { ...emitterDefaults, ...options };
|
||||
const { binding, mode }: any = { ...emitterDefaults, ...options };
|
||||
return function emit(event: CloudEvent, opts?: Options): Promise<unknown> {
|
||||
opts = opts || {};
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ function superagentEmitter(message: Message, options?: Options): Promise<unknown
|
|||
|
||||
function gotEmitter(message: Message, options?: Options): Promise<unknown> {
|
||||
return Promise.resolve(
|
||||
got.post(sink, { headers: message.headers, body: message.body as string, ...((options as unknown) as Options) }),
|
||||
got.post(sink, { headers: message.headers, body: message.body as string, ...(options as Options) }),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -90,9 +90,6 @@ describe("emitterFor() defaults", () => {
|
|||
expect(body.id).to.equal("1234");
|
||||
return Promise.resolve();
|
||||
}
|
||||
// Ignore the next line to ensure that HTTP transport is still the default.
|
||||
// Otherwise, tslint would complain that the param did not have `binding: <val>`
|
||||
/* @ts-ignore */
|
||||
const emitter = emitterFor(transport, { mode: Mode.STRUCTURED });
|
||||
emitter(
|
||||
new CloudEvent({
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ describe("CloudEvents Spec v0.3", () => {
|
|||
describe("'id'", () => {
|
||||
it("should throw an error when trying to remove", () => {
|
||||
expect(() => {
|
||||
delete cloudevent.id;
|
||||
delete (cloudevent as any).id;
|
||||
}).to.throw(TypeError);
|
||||
});
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ describe("CloudEvents Spec v0.3", () => {
|
|||
describe("'source'", () => {
|
||||
it("should throw an error when trying to remove", () => {
|
||||
expect(() => {
|
||||
delete cloudevent.source;
|
||||
delete (cloudevent as any).source;
|
||||
}).to.throw(TypeError);
|
||||
});
|
||||
});
|
||||
|
|
@ -111,7 +111,7 @@ describe("CloudEvents Spec v0.3", () => {
|
|||
describe("'specversion'", () => {
|
||||
it("should throw an error when trying to remove", () => {
|
||||
expect(() => {
|
||||
delete cloudevent.specversion;
|
||||
delete (cloudevent as any).specversion;
|
||||
}).to.throw(TypeError);
|
||||
});
|
||||
});
|
||||
|
|
@ -119,7 +119,7 @@ describe("CloudEvents Spec v0.3", () => {
|
|||
describe("'type'", () => {
|
||||
it("should throw an error when trying to remove", () => {
|
||||
expect(() => {
|
||||
delete cloudevent.type;
|
||||
delete (cloudevent as any).type;
|
||||
}).to.throw(TypeError);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ describe("CloudEvents Spec v1.0", () => {
|
|||
describe("'id'", () => {
|
||||
it("should throw an error when trying to remove", () => {
|
||||
expect(() => {
|
||||
delete cloudevent.id;
|
||||
delete (cloudevent as any).id;
|
||||
}).to.throw(TypeError);
|
||||
});
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ describe("CloudEvents Spec v1.0", () => {
|
|||
describe("'source'", () => {
|
||||
it("should throw an error when trying to remove", () => {
|
||||
expect(() => {
|
||||
delete cloudevent.source;
|
||||
delete (cloudevent as any).source;
|
||||
}).to.throw(TypeError);
|
||||
});
|
||||
});
|
||||
|
|
@ -126,7 +126,7 @@ describe("CloudEvents Spec v1.0", () => {
|
|||
describe("'specversion'", () => {
|
||||
it("should throw an error when trying to remove", () => {
|
||||
expect(() => {
|
||||
delete cloudevent.specversion;
|
||||
delete (cloudevent as any).specversion;
|
||||
}).to.throw(TypeError);
|
||||
});
|
||||
});
|
||||
|
|
@ -134,7 +134,7 @@ describe("CloudEvents Spec v1.0", () => {
|
|||
describe("'type'", () => {
|
||||
it("should throw an error when trying to remove", () => {
|
||||
expect(() => {
|
||||
delete cloudevent.type;
|
||||
delete (cloudevent as any).type;
|
||||
}).to.throw(TypeError);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue