Reenable no-inner-declarations.

This commit is contained in:
Sam Rose 2024-03-19 11:29:19 +00:00
parent 5749333fc7
commit 80008a0739
No known key found for this signature in database
8 changed files with 21 additions and 24 deletions

View File

@ -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",

View File

@ -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 = ""

View File

@ -1,5 +1,5 @@
module AirtableMock {
function Airtable() {
const Airtable = () => {
// @ts-ignore
this.base = jest.fn()
}

View File

@ -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({

View File

@ -12,7 +12,7 @@ module OracleDbMock {
const close = jest.fn()
// mock connection
function Connection() {}
const Connection = () => {}
Connection.prototype.execute = execute
Connection.prototype.close = close

View File

@ -11,8 +11,7 @@ module PgMock {
}))
// constructor
function Client() {}
const Client = () => {}
Client.prototype.query = query
Client.prototype.end = jest.fn(cb => {
if (cb) cb()

View File

@ -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]

View File

@ -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)