Skip to content

Commit c6f92d8

Browse files
committed
wip
1 parent 3bee164 commit c6f92d8

File tree

7 files changed

+59
-39
lines changed

7 files changed

+59
-39
lines changed

packages/webui/.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/webui/eslint.config.mjs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { generateEslintConfig } from '@sofie-automation/code-standard-preset/eslint/main.mjs'
2+
// import pluginYaml from 'eslint-plugin-yml'
3+
import pluginReact from 'eslint-plugin-react'
4+
import globals from 'globals'
5+
6+
const extendedRules = await generateEslintConfig({
7+
tsconfigName: 'tsconfig.eslint.json',
8+
ignores: [
9+
'public',
10+
'dist',
11+
'src/fonts',
12+
'src/meteor',
13+
// HACk
14+
// 'src/client/lib/data/mos/plugin-support.ts',
15+
],
16+
disableNodeRules:
17+
})
18+
extendedRules.push(
19+
{
20+
settings: {
21+
react: {
22+
version: 'detect',
23+
},
24+
},
25+
},
26+
pluginReact.configs.flat.recommended,
27+
pluginReact.configs.flat['jsx-runtime'],
28+
{
29+
files: ['src/**/*'],
30+
languageOptions: {
31+
globals: {
32+
...globals.browser,
33+
JSX: true,
34+
},
35+
},
36+
rules: {},
37+
},
38+
// extendedRules.push(...pluginYaml.configs['flat/recommended'], {
39+
// files: ['**/*.yaml'],
40+
41+
// rules: {
42+
// 'yml/quotes': ['error', { prefer: 'single' }],
43+
// 'yml/spaced-comment': ['error'],
44+
// 'spaced-comment': ['off'],
45+
// },
46+
// })
47+
)
48+
49+
export default extendedRules

packages/webui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
"@welldone-software/why-did-you-render": "^4.3.2",
104104
"@xmldom/xmldom": "^0.8.10",
105105
"babel-jest": "^29.7.0",
106+
"globals": "^15.14.0",
106107
"sass": "^1.83.4",
107108
"sinon": "^14.0.2",
108109
"typescript": "~5.5",

packages/webui/src/client/ui/globals/keyboardGlobals.d.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

packages/webui/src/client/ui/globals/wakeLockGlobals.d.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/webui/src/client/ui/util/useToggleExpandHelper.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import { ProtectedString } from '@sofie-automation/corelib/dist/protectedString'
1+
import { ProtectedString, unprotectString } from '@sofie-automation/corelib/dist/protectedString'
22
import { useState, useCallback } from 'react'
33

44
export function useToggleExpandHelper(): {
5-
toggleExpanded(id: ProtectedString<any> | string | number, forceState?: boolean): void
6-
isExpanded(id: ProtectedString<any> | string | number): boolean
5+
toggleExpanded: (id: ProtectedString<any> | string | number, forceState?: boolean) => void
6+
isExpanded: (id: ProtectedString<any> | string | number) => boolean
77
} {
88
const [expandedItemIds, setExpandedItemIds] = useState<Record<string, boolean>>({})
99

10-
const toggleExpanded = useCallback((id: string | number, forceState?: boolean) => {
10+
const toggleExpanded = useCallback((id0: ProtectedString<any> | string | number, forceState?: boolean) => {
11+
const id = typeof id0 !== 'number' && typeof id0 !== 'string' ? unprotectString(id0) : id0
1112
setExpandedItemIds((oldExpanded) => {
1213
// This will leak entries as layers are added and removed, but not fast enough to be a problem
1314
return {
@@ -17,7 +18,8 @@ export function useToggleExpandHelper(): {
1718
})
1819
}, [])
1920

20-
const isExpanded = (id: string | number): boolean => {
21+
const isExpanded = (id0: ProtectedString<any> | string | number): boolean => {
22+
const id = typeof id0 !== 'number' && typeof id0 !== 'string' ? unprotectString(id0) : id0
2123
return !!expandedItemIds[id]
2224
}
2325

packages/yarn.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6166,6 +6166,7 @@ __metadata:
61666166
cubic-spline: "npm:^3.0.3"
61676167
deep-extend: "npm:0.6.0"
61686168
ejson: "npm:^2.2.3"
6169+
globals: "npm:^15.14.0"
61696170
i18next: "npm:^21.10.0"
61706171
i18next-browser-languagedetector: "npm:^6.1.8"
61716172
i18next-http-backend: "npm:^1.4.5"
@@ -15207,7 +15208,7 @@ asn1@evs-broadcast/node-asn1:
1520715208
languageName: node
1520815209
linkType: hard
1520915210

15210-
"globals@npm:^15.11.0, globals@npm:^15.13.0":
15211+
"globals@npm:^15.11.0, globals@npm:^15.13.0, globals@npm:^15.14.0":
1521115212
version: 15.14.0
1521215213
resolution: "globals@npm:15.14.0"
1521315214
checksum: 10c0/039deb8648bd373b7940c15df9f96ab7508fe92b31bbd39cbd1c1a740bd26db12457aa3e5d211553b234f30e9b1db2fee3683012f543a01a6942c9062857facb

0 commit comments

Comments
 (0)