Reenable no-inner-declarations.
This commit is contained in:
parent
5749333fc7
commit
80008a0739
|
@ -39,7 +39,6 @@
|
|||
"extends": ["eslint:recommended"],
|
||||
"rules": {
|
||||
"no-unused-vars": "off",
|
||||
"no-inner-declarations": "off",
|
||||
"no-case-declarations": "off",
|
||||
"no-undef": "off",
|
||||
"no-prototype-builtins": "off",
|
||||
|
@ -57,7 +56,6 @@
|
|||
},
|
||||
"rules": {
|
||||
"no-unused-vars": "off",
|
||||
"no-inner-declarations": "off",
|
||||
"no-case-declarations": "off",
|
||||
"no-undef": "off",
|
||||
"no-prototype-builtins": "off",
|
||||
|
|
|
@ -10,6 +10,18 @@ import { formats } from "dd-trace/ext"
|
|||
|
||||
import { localFileDestination } from "../system"
|
||||
|
||||
function isPlainObject(obj: any) {
|
||||
return typeof obj === "object" && obj !== null && !(obj instanceof Error)
|
||||
}
|
||||
|
||||
function isError(obj: any) {
|
||||
return obj instanceof Error
|
||||
}
|
||||
|
||||
function isMessage(obj: any) {
|
||||
return typeof obj === "string"
|
||||
}
|
||||
|
||||
// LOGGER
|
||||
|
||||
let pinoInstance: pino.Logger | undefined
|
||||
|
@ -71,23 +83,11 @@ if (!env.DISABLE_PINO_LOGGER) {
|
|||
err?: Error
|
||||
}
|
||||
|
||||
function isPlainObject(obj: any) {
|
||||
return typeof obj === "object" && obj !== null && !(obj instanceof Error)
|
||||
}
|
||||
|
||||
function isError(obj: any) {
|
||||
return obj instanceof Error
|
||||
}
|
||||
|
||||
function isMessage(obj: any) {
|
||||
return typeof obj === "string"
|
||||
}
|
||||
|
||||
/**
|
||||
* Backwards compatibility between console logging statements
|
||||
* and pino logging requirements.
|
||||
*/
|
||||
function getLogParams(args: any[]): [MergingObject, string] {
|
||||
const getLogParams = (args: any[]): [MergingObject, string] => {
|
||||
let error = undefined
|
||||
let objects: any[] = []
|
||||
let message = ""
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module AirtableMock {
|
||||
function Airtable() {
|
||||
const Airtable = () => {
|
||||
// @ts-ignore
|
||||
this.base = jest.fn()
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ module AwsMock {
|
|||
...extra,
|
||||
})
|
||||
|
||||
function DocumentClient() {
|
||||
const DocumentClient = () => {
|
||||
// @ts-ignore
|
||||
this.put = jest.fn(response({}))
|
||||
// @ts-ignore
|
||||
|
@ -36,7 +36,7 @@ module AwsMock {
|
|||
this.delete = jest.fn(response({}))
|
||||
}
|
||||
|
||||
function S3() {
|
||||
const S3 = () => {
|
||||
// @ts-ignore
|
||||
this.listObjects = jest.fn(
|
||||
response({
|
||||
|
|
|
@ -12,7 +12,7 @@ module OracleDbMock {
|
|||
const close = jest.fn()
|
||||
|
||||
// mock connection
|
||||
function Connection() {}
|
||||
const Connection = () => {}
|
||||
Connection.prototype.execute = execute
|
||||
Connection.prototype.close = close
|
||||
|
||||
|
|
|
@ -11,8 +11,7 @@ module PgMock {
|
|||
}))
|
||||
|
||||
// constructor
|
||||
function Client() {}
|
||||
|
||||
const Client = () => {}
|
||||
Client.prototype.query = query
|
||||
Client.prototype.end = jest.fn(cb => {
|
||||
if (cb) cb()
|
||||
|
|
|
@ -717,7 +717,7 @@ export class ExternalRequest<T extends Operation> {
|
|||
|
||||
const rows = related[key]?.rows || []
|
||||
|
||||
function relationshipMatchPredicate({
|
||||
const relationshipMatchPredicate = ({
|
||||
row,
|
||||
linkPrimary,
|
||||
linkSecondary,
|
||||
|
@ -725,7 +725,7 @@ export class ExternalRequest<T extends Operation> {
|
|||
row: Row
|
||||
linkPrimary: string
|
||||
linkSecondary?: string
|
||||
}) {
|
||||
}) => {
|
||||
const matchesPrimaryLink =
|
||||
row[linkPrimary] === relationship.id ||
|
||||
row[linkPrimary] === body?.[linkPrimary]
|
||||
|
|
|
@ -120,7 +120,7 @@ const authorized =
|
|||
!!subResourceId &&
|
||||
(await sdk.permissions.getResourcePerms(subResourceId))
|
||||
|
||||
function getPermLevel(permLevel: string) {
|
||||
const getPermLevel = (permLevel: string) => {
|
||||
let result: string[] = []
|
||||
if (permissions[permLevel]) {
|
||||
result.push(permissions[permLevel].role)
|
||||
|
|
Loading…
Reference in New Issue