chore: add copyrights header and lint rules (#418)
Signed-off-by: Remi Cattiau <remi@cattiau.com>
This commit is contained in:
parent
db4be6b1da
commit
80d987c1f6
|
@ -14,6 +14,9 @@
|
|||
"node": true,
|
||||
"mocha": true
|
||||
},
|
||||
"plugins": [
|
||||
"header"
|
||||
],
|
||||
"rules": {
|
||||
"no-var": "error",
|
||||
"standard/no-callback-literal": "off",
|
||||
|
@ -31,6 +34,7 @@
|
|||
"valid-jsdoc": "warn",
|
||||
"semi": ["error", "always"],
|
||||
"quotes": ["error", "double", { "allowTemplateLiterals": true }],
|
||||
"@typescript-eslint/no-explicit-any": "off"
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"header/header": [2, "block", ["", " Copyright 2021 The CloudEvents Authors"," SPDX-License-Identifier: Apache-2.0", ""], 2]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
// cucumber.js
|
||||
let common = [
|
||||
"--require-module ts-node/register", // Load TypeScript module
|
||||
|
|
|
@ -3185,6 +3185,12 @@
|
|||
"regexpp": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"eslint-plugin-header": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz",
|
||||
"integrity": "sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==",
|
||||
"dev": true
|
||||
},
|
||||
"eslint-plugin-import": {
|
||||
"version": "2.22.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz",
|
||||
|
|
58
package.json
58
package.json
|
@ -42,7 +42,62 @@
|
|||
},
|
||||
{
|
||||
"name": "Lance Ball",
|
||||
"email": "lball@redhat.com"
|
||||
"email": "lball@redhat.com",
|
||||
"url": "https://github.com/lance"
|
||||
},
|
||||
{
|
||||
"name": "Lucas Holmquist",
|
||||
"email": "lholmqui@redhat.com",
|
||||
"url": "https://github.com/lholmquist"
|
||||
},
|
||||
{
|
||||
"name": "Grant Timmerman",
|
||||
"url": "https://github.com/grant"
|
||||
},
|
||||
{
|
||||
"name": "Daniel Bevenius",
|
||||
"email": "daniel.bevenius@gmail.com",
|
||||
"url": "https://github.com/danbev"
|
||||
},
|
||||
{
|
||||
"name": "Helio Frota",
|
||||
"url": "https://github.com/helio-frota"
|
||||
},
|
||||
{
|
||||
"name": "Doug Davis",
|
||||
"email": "dug@us.ibm.com",
|
||||
"url": "https://github.com/duglin"
|
||||
},
|
||||
{
|
||||
"name": "Remi Cattiau",
|
||||
"email": "rcattiau@gmail.com",
|
||||
"url": "https://github.com/loopingz"
|
||||
},
|
||||
{
|
||||
"name": "Michele Angioni",
|
||||
"url": "https://github.com/micheleangioni"
|
||||
},
|
||||
{
|
||||
"name": "Ali Ok",
|
||||
"email": "aliok@redhat.com",
|
||||
"url": "https://github.com/aliok"
|
||||
},
|
||||
{
|
||||
"name": "Philip Hayes",
|
||||
"url": "https://github.com/deewhyweb"
|
||||
},
|
||||
{
|
||||
"name": "Jingwen Peng",
|
||||
"url": "https://github.com/pengsrc"
|
||||
},
|
||||
{
|
||||
"name": "Sidharth Vinod",
|
||||
"email": "sidharthv96@gmail.com",
|
||||
"url": "https://github.com/sidharthv96"
|
||||
},
|
||||
{
|
||||
"name": "Matej Vasek",
|
||||
"url": "https://github.com/matejvasek"
|
||||
}
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
|
@ -74,6 +129,7 @@
|
|||
"eslint": "^7.3.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-config-standard": "^14.1.1",
|
||||
"eslint-plugin-header": "^3.1.1",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-prettier": "^3.1.4",
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
const CONSTANTS = Object.freeze({
|
||||
CHARSET_DEFAULT: "utf-8",
|
||||
EXTENSIONS_PREFIX: "ce-",
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { Emitter } from "..";
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* The object interface for CloudEvents 1.0.
|
||||
* @see https://github.com/cloudevents/spec/blob/v1.0/spec.md
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
export const schemaV1 = {
|
||||
$ref: "#/definitions/event",
|
||||
definitions: {
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import Ajv from "ajv";
|
||||
import { ValidationError, isBase64 } from "./validation";
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { ErrorObject } from "ajv";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { CloudEvent, Version } from "./event/cloudevent";
|
||||
import { ValidationError } from "./event/validation";
|
||||
import { CloudEventV03, CloudEventV03Attributes, CloudEventV1, CloudEventV1Attributes } from "./event/interfaces";
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { PassThroughParser, DateParser, MappedParser } from "../../parsers";
|
||||
import { CloudEvent } from "../..";
|
||||
import { Headers } from "../";
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { CloudEvent, CloudEventV03, CloudEventV1, CONSTANTS, Mode, Version } from "../..";
|
||||
import { Message, Headers } from "..";
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { IncomingHttpHeaders } from "http";
|
||||
import { CloudEvent } from "..";
|
||||
import { binary, deserialize, structured, isEvent } from "./http";
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import CONSTANTS from "./constants";
|
||||
import { isString, isDefinedOrThrow, isStringOrObjectOrThrow, ValidationError } from "./event/validation";
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { CloudEvent } from "../event/cloudevent";
|
||||
import { HTTP, Message, Mode } from "../message";
|
||||
import { EventEmitter } from "events";
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { Message, Options } from "../..";
|
||||
import axios from "axios";
|
||||
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* An enum representing the transport protocols for an event
|
||||
*/
|
||||
|
||||
export const enum Protocol {
|
||||
HTTPBinary,
|
||||
HTTPStructured,
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
||||
|
||||
import { assert } from "chai";
|
||||
import { Given, When, Then, World } from "cucumber";
|
||||
import { Message, Headers, HTTP } from "../../src";
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { expect } from "chai";
|
||||
import { CONSTANTS } from "../../src";
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import "mocha";
|
||||
import { expect } from "chai";
|
||||
import nock from "nock";
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import "mocha";
|
||||
|
||||
import { emitterFor, HTTP, Mode, Message, Emitter } from "../../src";
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import "mocha";
|
||||
import { expect } from "chai";
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import "mocha";
|
||||
import { expect } from "chai";
|
||||
import { CloudEvent, Version } from "../../src";
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import "mocha";
|
||||
import { expect } from "chai";
|
||||
import { CloudEvent, Version, ValidationError, Mode } from "../../src";
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import "mocha";
|
||||
import { expect } from "chai";
|
||||
import { CloudEvent, Version, ValidationError } from "../../src";
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/*
|
||||
Copyright 2021 The CloudEvents Authors
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import "mocha";
|
||||
import { expect } from "chai";
|
||||
import { isStringOrThrow, equalsOrThrow, isBase64, asData } from "../../src/event/validation";
|
||||
|
|
Loading…
Reference in New Issue