Skip to content

Commit

Permalink
chore: update prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Sep 18, 2023
1 parent 468de1d commit a68f101
Show file tree
Hide file tree
Showing 17 changed files with 75 additions and 42 deletions.
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"semi": false,
"singleQuote": true,
"useTabs": true,
"endOfLine": "lf"
"endOfLine": "lf",
"trailingComma": "es5"
}
17 changes: 15 additions & 2 deletions launcher/window.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,21 @@ body {
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
font-family:
ui-sans-serif,
system-ui,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
'Helvetica Neue',
Arial,
'Noto Sans',
sans-serif,
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol',
'Noto Color Emoji';
font-feature-settings: normal;
overflow: hidden;
background-color: #d40215;
Expand Down
2 changes: 1 addition & 1 deletion launcher/window.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
Expand Down
11 changes: 7 additions & 4 deletions lib/UI/Update.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ class UIUpdate {

// Make a request now
this.requestUpdate()
setInterval(() => {
// Do a check every day, in case this installation is being left on constantly
this.requestUpdate()
}, 24 * 60 * 60 * 1000)
setInterval(
() => {
// Do a check every day, in case this installation is being left on constantly
this.requestUpdate()
},
24 * 60 * 60 * 1000
)
}

/**
Expand Down
6 changes: 3 additions & 3 deletions module-legacy/instance_skel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ declare abstract class InstanceSkel<TConfig> {
* @param upgradeMap The feedbacks to upgrade and the properties to convert
*/
static CreateConvertToBooleanFeedbackUpgradeScript(
upgradeMap: CompanionUpgradeToBooleanFeedbackMap
upgradeMap: CompanionUpgradeToBooleanFeedbackMap,
): CompanionStaticUpgradeScript

/**
Expand All @@ -87,7 +87,7 @@ declare abstract class InstanceSkel<TConfig> {
feedback?(
feedback: CompanionFeedbackEvent,
bank: CompanionBankPNG | null,
info: CompanionFeedbackEventInfo | null
info: CompanionFeedbackEventInfo | null,
): CompanionFeedbackResult

/**
Expand Down Expand Up @@ -169,7 +169,7 @@ declare abstract class InstanceSkel<TConfig> {
* @param request partial request object from Express
*/
handleHttpRequest?(
request: CompanionInstanceHTTPRequest
request: CompanionInstanceHTTPRequest,
): CompanionInstanceHTTPResponse | Promise<CompanionInstanceHTTPResponse>

STATUS_UNKNOWN: null
Expand Down
10 changes: 5 additions & 5 deletions module-legacy/instance_skel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ function instance(system, id, config) {

self.defineConst(
'REGEX_IP',
'/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/'
'/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/',
)
self.defineConst(
'REGEX_HOSTNAME',
'/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/'
'/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/',
)
self.defineConst('REGEX_BOOLEAN', '/^(true|false|0|1)$/i')
self.defineConst(
'REGEX_PORT',
'/^([1-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-4])$/'
'/^([1-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|[1-8][0-9]{3}|9[0-8][0-9]{2}|99[0-8][0-9]|999[0-9]|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-4])$/',
)
self.defineConst('REGEX_PERCENT', '/^(100|[0-9]|[0-9][0-9])$/')
self.defineConst('REGEX_FLOAT', '/^([0-9]*\\.)?[0-9]+$/')
Expand All @@ -70,7 +70,7 @@ function instance(system, id, config) {
self.defineConst('REGEX_SIGNED_NUMBER', '/^[+-]?\\d+$/')
self.defineConst(
'REGEX_TIMECODE',
'/^(0*[0-9]|1[0-9]|2[0-4]):(0*[0-9]|[1-5][0-9]|60):(0*[0-9]|[1-5][0-9]|60):(0*[0-9]|[12][0-9]|30)$/'
'/^(0*[0-9]|1[0-9]|2[0-4]):(0*[0-9]|[1-5][0-9]|60):(0*[0-9]|[1-5][0-9]|60):(0*[0-9]|[12][0-9]|30)$/',
)
self.defineConst('CHOICES_YESNO_BOOLEAN', [
{ id: 'true', label: 'Yes' },
Expand Down Expand Up @@ -198,7 +198,7 @@ instance.prototype.addUpgradeScript = function () {
var self = this

throw new Error(
'addUpgradeScript has been removed and replaced by a new static GetUpgradeScripts flow. Check the wiki for more information'
'addUpgradeScript has been removed and replaced by a new static GetUpgradeScripts flow. Check the wiki for more information',
)
}

Expand Down
8 changes: 4 additions & 4 deletions module-legacy/instance_skel_types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export interface CompanionAction {
* The user requested to 'learn' the values for this action.
*/
learn?: (
action: CompanionActionEvent
action: CompanionActionEvent,
) => CompanionOptionValues | undefined | Promise<CompanionOptionValues | undefined>
}
export interface CompanionActionEvent {
Expand Down Expand Up @@ -223,7 +223,7 @@ export interface CompanionFeedbackBase<TRes> {
callback?: (
feedback: CompanionFeedbackEvent,
bank: CompanionBankPNG | null,
info: CompanionFeedbackEventInfo | null
info: CompanionFeedbackEventInfo | null,
) => TRes
subscribe?: (feedback: CompanionFeedbackEvent) => void
unsubscribe?: (feedback: CompanionFeedbackEvent) => void
Expand All @@ -232,7 +232,7 @@ export interface CompanionFeedbackBase<TRes> {
* The user requested to 'learn' the values for this feedback.
*/
learn?: (
feedback: CompanionFeedbackEvent
feedback: CompanionFeedbackEvent,
) => CompanionOptionValues | undefined | Promise<CompanionOptionValues | undefined>
}
export interface CompanionFeedbackBoolean extends CompanionFeedbackBase<boolean> {
Expand Down Expand Up @@ -282,7 +282,7 @@ export type CompanionStaticUpgradeScript = (
context: CompanionUpgradeContext,
config: CompanionCoreInstanceconfig & Record<string, any>,
affected_actions: CompanionMigrationAction[],
affected_feedbacks: CompanionMigrationFeedback[]
affected_feedbacks: CompanionMigrationFeedback[],
) => boolean

export interface CompanionUpgradeToBooleanFeedbackMap {
Expand Down
6 changes: 3 additions & 3 deletions module-legacy/scripts/find-system-uses.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ await Promise.all(
} else if (info.isDirectory()) {
await scanDir(fullname)
}
})
}),
)
}
await scanDir(basePath)
Expand Down Expand Up @@ -100,7 +100,7 @@ await Promise.all(
console.warn(`Failed to scan file: ${e}`)
console.log(e.stack)
}
})
}),
)

outputStr += `Found calls for: ${Array.from(usedCalls.keys()).join(', ')}\n`
Expand All @@ -112,7 +112,7 @@ await Promise.all(
}
if (usedCalls.size > 0) console.log(csvStr)
}
})
}),
)

console.log('\n\n')
Expand Down
2 changes: 1 addition & 1 deletion module-legacy/scripts/generate-manifests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ global.modulePkg = require('companion-module-${pkgJson.name}/package.json')
global.moduleFactory = require('companion-module-${pkgJson.name}')
global.moduleName = "${pkgJson.name}"
import('../../dist/index.js')
`
`,
)
}
}
Expand Down
17 changes: 10 additions & 7 deletions module-legacy/src/fakeSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export function convertInputField(input: SomeCompanionInputField): Complete<Modu

function wrapActionSubscriptionCallback<T>(
id: string,
cb: ((event: CompanionActionEvent) => T) | undefined
cb: ((event: CompanionActionEvent) => T) | undefined,
): ((action: ModuleApi.CompanionActionInfo) => T) | undefined {
if (cb) {
return (event) =>
Expand All @@ -180,7 +180,7 @@ function wrapActionSubscriptionCallback<T>(

function wrapFeedbackSubscriptionCallback<T>(
id: string,
cb: ((event: CompanionFeedbackEvent) => T) | undefined
cb: ((event: CompanionFeedbackEvent) => T) | undefined,
): ((feedback: ModuleApi.CompanionFeedbackInfo) => T) | undefined {
if (cb) {
return (event) =>
Expand All @@ -199,7 +199,10 @@ export class FakeSystem extends EventEmitter {

readonly Image = Image

constructor(public readonly parent: ModuleApi.InstanceBase<any>, moduleName: string) {
constructor(
public readonly parent: ModuleApi.InstanceBase<any>,
moduleName: string,
) {
super()

this.#rest = new ServiceRest(this, moduleName)
Expand Down Expand Up @@ -326,7 +329,7 @@ export class FakeSystem extends EventEmitter {
deviceId: event._deviceId,
page: event._page,
bank: event._bank,
}
},
)
}
}
Expand All @@ -349,7 +352,7 @@ export class FakeSystem extends EventEmitter {
// setFeedbackDefinitions: InstanceSkel<any>['setFeedbackDefinitions'] = (feedbacks) => {
setFeedbackDefinitions = (
feedbacks: Parameters<InstanceSkel<any>['setFeedbackDefinitions']>[0],
defaultHandler: any
defaultHandler: any,
) => {
const newFeedbacks: ModuleApi.CompanionFeedbackDefinitions = {}

Expand All @@ -367,7 +370,7 @@ export class FakeSystem extends EventEmitter {
options: event.options ?? {},
},
event._rawBank,
null
null,
)
} else {
return false
Expand Down Expand Up @@ -405,7 +408,7 @@ export class FakeSystem extends EventEmitter {
bank: event._bank,
width: event.image?.width ?? 72,
height: event.image?.height ?? 72,
}
},
)
} else {
return {}
Expand Down
2 changes: 1 addition & 1 deletion module-legacy/tcp.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ declare class TCPClient extends EventEmitter {
reconnect_interval?: number
/** default true */
reconnect?: boolean
}
},
)

/** Force a reconnection attempt */
Expand Down
2 changes: 1 addition & 1 deletion module-legacy/telnet.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ declare class Telnet extends EventEmitter {
reconnect_interval?: number
/** default true */
reconnect?: boolean
}
},
)

/** Force a reconnection attempt */
Expand Down
2 changes: 1 addition & 1 deletion module-legacy/udp.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare class UDPSocket extends EventEmitter {
bind_port?: number
/** default: 0.0.0.0 */
bind_ip?: string
}
},
)

/** Attempt to add membership to a multicast address */
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"jest": "^29.7.0",
"jsdoc": "^4.0.2",
"octokit": "^2.1.0",
"prettier": "^2.8.8",
"prettier": "^3.0.3",
"tar": "^6.2.0",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
Expand Down
2 changes: 1 addition & 1 deletion webui/public/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
17 changes: 15 additions & 2 deletions webui/src/scss/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@ body {
-o-tab-size: 4;
tab-size: 4;
// font-family: 'Roboto', sans-serif;
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
font-family:
ui-sans-serif,
system-ui,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
'Helvetica Neue',
Arial,
'Noto Sans',
sans-serif,
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol',
'Noto Color Emoji';
font-feature-settings: normal;
min-width: 400px;
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4608,10 +4608,10 @@ prebuild-install@^7.1.1:
tar-fs "^2.0.0"
tunnel-agent "^0.6.0"

prettier@^2.8.8:
version "2.8.8"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
prettier@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643"
integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==

pretty-format@^29.7.0:
version "29.7.0"
Expand Down

0 comments on commit a68f101

Please sign in to comment.