Skip to content

Commit

Permalink
eslint import/newline-after-import
Browse files Browse the repository at this point in the history
  • Loading branch information
adrinr committed Nov 20, 2023
1 parent 92f411b commit db2c20e
Show file tree
Hide file tree
Showing 143 changed files with 159 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
],
"import/no-relative-packages": "error",
"import/export": "error",
"import/no-duplicates": "error"
"import/no-duplicates": "error",
"import/newline-after-import": "error"
},
"globals": {
"GeolocationPositionError": true
Expand Down
2 changes: 2 additions & 0 deletions packages/backend-core/src/auth/auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const _passport = require("koa-passport")
const LocalStrategy = require("passport-local").Strategy

import { getGlobalDB } from "../context"
import { Cookie } from "../constants"
import { getSessionsForUser, invalidateSessions } from "../security/sessions"
Expand All @@ -26,6 +27,7 @@ import { clearCookie, getCookie } from "../utils"
import { ssoSaveUserNoOp } from "../middleware/passport/sso/sso"

const refresh = require("passport-oauth2-refresh")

export {
auditLog,
authError,
Expand Down
1 change: 1 addition & 0 deletions packages/backend-core/src/constants/db.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { prefixed, DocumentType } from "@budibase/types"

export {
SEPARATOR,
UNICODE_MAX,
Expand Down
1 change: 1 addition & 0 deletions packages/backend-core/src/db/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { AppState, DeletedApp, getAppMetadata } from "../cache/appMetadata"
import { isDevApp, isDevAppID, getProdAppID } from "../docIds/conversions"
import { App, Database } from "@budibase/types"
import { getStartEndKeyURL } from "../docIds"

export * from "../docIds"

/**
Expand Down
1 change: 1 addition & 0 deletions packages/backend-core/src/docIds/conversions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { APP_DEV_PREFIX, APP_PREFIX } from "../constants"
import { App } from "@budibase/types"

const NO_APP_ERROR = "No app provided"

export function isDevAppID(appId?: string) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import PosthogProcessor from "./PosthogProcessor"

export default PosthogProcessor
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { testEnv } from "../../../../../tests/extra"
import PosthogProcessor from "../PosthogProcessor"
import { Event, IdentityType, Hosting } from "@budibase/types"

const tk = require("timekeeper")

import * as cache from "../../../../cache/generic"
import { CacheKey } from "../../../../cache/generic"
import * as context from "../../../../context"
Expand Down
1 change: 1 addition & 0 deletions packages/backend-core/src/features/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import env from "../environment"
import * as context from "../context"

export * from "./installation"

/**
Expand Down
1 change: 1 addition & 0 deletions packages/backend-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export * as docIds from "./docIds"
// circular dependencies
import * as context from "./context"
import * as _tenancy from "./tenancy"

export const tenancy = {
..._tenancy,
...context,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Header } from "../../constants"

const correlator = require("correlation-id")

export const setHeader = (headers: any) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Header } from "../../constants"
import { v4 as uuid } from "uuid"

const correlator = require("correlation-id")

const correlation = (ctx: any, next: any) => {
Expand Down
3 changes: 3 additions & 0 deletions packages/backend-core/src/logging/pino/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import env from "../../environment"
import { logger } from "./logger"
import { IncomingMessage } from "http"

const pino = require("koa-pino-logger")

import { Options } from "pino-http"
import { Ctx } from "@budibase/types"

const correlator = require("correlation-id")

export function pinoSettings(): Options {
Expand Down
1 change: 1 addition & 0 deletions packages/backend-core/src/middleware/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export * as local from "./passport/local"
export * as google from "./passport/sso/google"
export * as oidc from "./passport/sso/oidc"
import * as datasourceGoogle from "./passport/datasource/google"

export const datasource = {
google: datasourceGoogle,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
SaveSSOUserFunction,
GoogleInnerConfig,
} from "@budibase/types"

const GoogleStrategy = require("passport-google-oauth").OAuth2Strategy

export function buildVerifyFn(saveUserFn: SaveSSOUserFunction) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const mockStrategy = require("passport-google-oauth").OAuth2Strategy

jest.mock("../sso")
import * as _sso from "../sso"

const sso = jest.mocked(_sso)

const mockSaveUserFn = jest.fn()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const mockSaveUser = jest.fn()

jest.mock("../../../../users")
import * as _users from "../../../../users"

const users = jest.mocked(_users)

const getErrorMessage = () => {
Expand Down
1 change: 1 addition & 0 deletions packages/backend-core/src/middleware/tests/builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { structures } from "../../../tests"
import { ContextUser, ServiceType } from "@budibase/types"
import { doInAppContext } from "../../context"
import env from "../../environment"

env._set("SERVICE_TYPE", ServiceType.APPS)

const appId = "app_aaa"
Expand Down
1 change: 1 addition & 0 deletions packages/backend-core/src/objectStore/objectStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const sanitize = require("sanitize-s3-objectkey")

import AWS from "aws-sdk"
import stream, { Readable } from "stream"
import fetch from "node-fetch"
Expand Down
1 change: 1 addition & 0 deletions packages/backend-core/src/security/sessions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const redis = require("../redis/init")
const { v4: uuidv4 } = require("uuid")
const { logWarn } = require("../logging")

import env from "../environment"
import {
Session,
Expand Down
1 change: 1 addition & 0 deletions packages/backend-core/src/utils/hashing.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import env from "../environment"

export * from "../docIds/newid"
const bcrypt = env.JS_BCRYPT ? require("bcryptjs") : require("bcrypt")

Expand Down
1 change: 1 addition & 0 deletions packages/backend-core/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
TenantResolutionStrategy,
} from "@budibase/types"
import type { SetOption } from "cookies"

const jwt = require("jsonwebtoken")

const APP_PREFIX = DocumentType.APP + SEPARATOR
Expand Down
1 change: 1 addition & 0 deletions packages/backend-core/tests/core/utilities/mocks/alerts.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
jest.mock("../../../../src/logging/alerts")
import * as _alerts from "../../../../src/logging/alerts"

export const alerts = jest.mocked(_alerts)
1 change: 1 addition & 0 deletions packages/backend-core/tests/core/utilities/mocks/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
jest.mock("../../../../src/accounts")
import * as _accounts from "../../../../src/accounts"

export const accounts = jest.mocked(_accounts)

export * as date from "./date"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import Chance from "./Chance"

export const generator = new Chance()
1 change: 1 addition & 0 deletions packages/backend-core/tests/jestSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mocks.fetch.enable()
// mock all dates to 2020-01-01T00:00:00.000Z
// use tk.reset() to use real dates in individual tests
import tk from "timekeeper"

tk.freeze(mocks.date.MOCK_DATE)

if (!process.env.DEBUG) {
Expand Down
1 change: 1 addition & 0 deletions packages/bbui/src/ActionGroup/ActionGroup.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import "@spectrum-css/actiongroup/dist/index-vars.css"
export let vertical = false
export let justified = false
export let quiet = false
Expand Down
1 change: 1 addition & 0 deletions packages/bbui/src/Avatar/Avatar.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import "@spectrum-css/avatar/dist/index-vars.css"
let sizes = new Map([
["XXS", "--spectrum-alias-avatar-size-50"],
["XS", "--spectrum-alias-avatar-size-75"],
Expand Down
1 change: 1 addition & 0 deletions packages/bbui/src/ButtonGroup/ButtonGroup.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import "@spectrum-css/buttongroup/dist/index-vars.css"
export let vertical = false
export let gap = ""
Expand Down
1 change: 1 addition & 0 deletions packages/bbui/src/Divider/Divider.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import "@spectrum-css/divider/dist/index-vars.css"
export let size = "M"
export let vertical = false
Expand Down
1 change: 1 addition & 0 deletions packages/bbui/src/Modal/Content.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import Input from "../Form/Input.svelte"
let value = ""
</script>

Expand Down
1 change: 1 addition & 0 deletions packages/bbui/src/OptionSelectDnD/OptionSelectDnD.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import Icon from "../Icon/Icon.svelte"
import Popover from "../Popover/Popover.svelte"
import { onMount } from "svelte"
const flipDurationMs = 150
export let constraints
Expand Down
2 changes: 2 additions & 0 deletions packages/bbui/src/SideNavigation/Item.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script>
import { getContext } from "svelte"
const multilevel = getContext("sidenav-type")
import Badge from "../Badge/Badge.svelte"
export let href = ""
export let external = false
export let heading = ""
Expand Down
1 change: 1 addition & 0 deletions packages/bbui/src/SideNavigation/Navigation.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import { setContext } from "svelte"
import "@spectrum-css/sidenav/dist/index-vars.css"
export let multilevel = false
setContext("sidenav-type", multilevel)
</script>
Expand Down
1 change: 1 addition & 0 deletions packages/bbui/src/Table/ArrayRenderer.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import "@spectrum-css/label/dist/index-vars.css"
import Badge from "../Badge/Badge.svelte"
export let value
const displayLimit = 5
Expand Down
1 change: 1 addition & 0 deletions packages/bbui/src/Tabs/Tab.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import { getContext, onMount, createEventDispatcher } from "svelte"
import Portal from "svelte-portal"
export let title
export let icon = ""
export let id
Expand Down
1 change: 1 addition & 0 deletions packages/bbui/src/helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { helpers } from "@budibase/shared-core"

export const deepGet = helpers.deepGet

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { Button, Select, Input, Label } from "@budibase/bbui"
import { onMount, createEventDispatcher } from "svelte"
import { flags } from "stores/backend"
const dispatch = createEventDispatcher()
export let value
Expand Down
1 change: 1 addition & 0 deletions packages/builder/src/components/common/CustomSVG.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import { Helpers } from "@budibase/bbui"
export let size
export let svgHtml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import { capitalise } from "helpers"
export let value
</script>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import dayjs from "dayjs"
export let value
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { Select, Body } from "@budibase/bbui"
import { onMount } from "svelte"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
export let parameters
export let bindings
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import FlatButtonGroup from "./FlatButtonGroup.svelte"

export default FlatButtonGroup
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte"
import { getUserBindings } from "builderStore/dataBinding"
export let bindable = true
export let queryBindings = []
export let hideHeading = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import { environment } from "stores/portal"
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
import { getContext } from "svelte"
const modalContext = getContext(Context.Modal)
export let save
Expand Down
1 change: 1 addition & 0 deletions packages/builder/src/components/usage/Usage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { Body, ProgressBar, Heading, Icon, Link } from "@budibase/bbui"
import { admin, auth } from "../../stores/portal"
import { onMount } from "svelte"
export let usage
export let warnWhenFull = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { Body } from "@budibase/bbui"
import FontAwesomeIcon from "components/common/FontAwesomeIcon.svelte"
import { IntegrationTypes } from "constants/backend"
export let datasource
const getSubtitle = datasource => {
if (datasource.source === IntegrationTypes.REST) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import { redirect } from "@roxi/routify"
$redirect("../../")
</script>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import { redirect } from "@roxi/routify"
$redirect("../")
</script>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import { DetailSummary } from "@budibase/bbui"
import InfoDisplay from "./InfoDisplay.svelte"
export let componentDefinition
</script>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import { Icon } from "@budibase/bbui"
export let datasource
export let selected = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script>
import { redirect } from "@roxi/routify"

$redirect("./data")
</script>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import { Badge } from "@budibase/bbui"

export let value

$: isError = !value || value.toLowerCase() === "error"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import { BackupTrigger } from "constants/backend/backups"

export let row

$: trigger = row?.trigger || "manual"
Expand Down
Loading

0 comments on commit db2c20e

Please sign in to comment.