Skip to content

Commit 09a00dc

Browse files
authored
Merge pull request #111 from nebulabroadcast/use-frames-in-video-player
Rewrite video player to use frames as base
2 parents 23f42c0 + 22c13a3 commit 09a00dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+364
-238
lines changed

frontend/eslint.config.js

Lines changed: 75 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
import js from '@eslint/js';
1+
// eslint.config.js
2+
import eslint from '@eslint/js';
23
import tseslint from 'typescript-eslint';
3-
import react from 'eslint-plugin-react';
4-
import reactHooks from 'eslint-plugin-react-hooks';
4+
import reactPlugin from 'eslint-plugin-react';
5+
import reactHooksPlugin from 'eslint-plugin-react-hooks';
56
import prettier from 'eslint-plugin-prettier';
7+
import importPlugin from 'eslint-plugin-import';
68
import globals from 'globals';
79

8-
export default [
10+
export default tseslint.config(
911
{
1012
ignores: ['node_modules', 'build', 'dist', 'eslint.config.js', 'src/pubsub.js'],
1113
},
12-
js.configs.recommended, // Base JS rules
14+
eslint.configs.recommended,
15+
...tseslint.configs.recommended,
1316
{
1417
languageOptions: {
1518
parser: tseslint.parser,
@@ -22,26 +25,79 @@ export default [
2225
...globals.node,
2326
},
2427
},
28+
29+
// React plugin configuration
2530
plugins: {
26-
'@typescript-eslint': tseslint.plugin,
27-
react: react,
28-
'react-hooks': reactHooks,
29-
prettier: prettier,
31+
react: reactPlugin,
32+
'react-hooks': reactHooksPlugin,
33+
import: importPlugin,
34+
},
35+
rules: {
36+
// React rules
37+
'react/jsx-uses-react': 'error',
38+
'react/jsx-uses-vars': 'error',
39+
'react/react-in-jsx-scope': 'off', // Not needed with React 17+
40+
'react/prop-types': 'off', // TypeScript handles prop validation
41+
'react/display-name': 'warn',
42+
'react-hooks/rules-of-hooks': 'error',
43+
'react-hooks/exhaustive-deps': 'warn',
44+
45+
'@typescript-eslint/explici/t-function-return-type': 'off',
46+
'@typescript-eslint/explicit-module-boundary-types': 'off',
47+
'@typescript-eslint/no-explicit-any': 'warn',
48+
'@typescript-eslint/no-unused-vars': [
49+
'error',
50+
{
51+
argsIgnorePattern: '^_',
52+
varsIgnorePattern: '^_',
53+
},
54+
],
55+
56+
// Import rules
57+
'import/order': [
58+
'warn',
59+
{
60+
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
61+
'newlines-between': 'always',
62+
alphabetize: { order: 'asc', caseInsensitive: true },
63+
},
64+
],
3065
},
66+
// Different settings for different file types
3167
settings: {
3268
react: {
3369
version: 'detect',
3470
},
3571
},
36-
rules: {
37-
'prettier/prettier': 'warn',
38-
'no-unused-vars': 'off', // Handled by TypeScript
39-
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
40-
'react-hooks/rules-of-hooks': 'error',
41-
'react-hooks/exhaustive-deps': 'warn',
42-
'@typescript-eslint/no-explicit-any': 'warn',
43-
'@typescript-eslint/explicit-module-boundary-types': 'off',
44-
'@typescript-eslint/consistent-type-imports': 'warn',
72+
},
73+
{
74+
// Apply to all JavaScript and TypeScript files
75+
files: ['**/*.{js,jsx,ts,tsx}'],
76+
languageOptions: {
77+
ecmaVersion: 2022,
78+
sourceType: 'module',
79+
parserOptions: {
80+
ecmaFeatures: {
81+
jsx: true,
82+
},
83+
},
4584
},
4685
},
47-
];
86+
{
87+
// TypeScript-specific rules
88+
files: ['**/*.{ts,tsx}'],
89+
languageOptions: {
90+
parser: tseslint.parser,
91+
parserOptions: {
92+
project: './tsconfig.json',
93+
},
94+
},
95+
},
96+
{
97+
// JavaScript-specific rules (for JSX files)
98+
files: ['**/*.{js,jsx}'],
99+
rules: {
100+
'@typescript-eslint/no-var-requires': 'off',
101+
},
102+
}
103+
);

frontend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dev": "vite",
88
"build": "tsc -b && vite build",
99
"preview": "vite preview",
10-
"lint": "eslint . --fix",
10+
"lint": "eslint src/**/*.{jsx,tsx,js,ts} --fix",
1111
"format": "prettier . --write",
1212
"generate": "openapi-ts"
1313
},
@@ -45,6 +45,7 @@
4545
"@vitejs/plugin-react": "^4.3.4",
4646
"eslint": "^9.20.1",
4747
"eslint-config-prettier": "^10.0.1",
48+
"eslint-plugin-import": "^2.31.0",
4849
"eslint-plugin-prettier": "^5.2.3",
4950
"eslint-plugin-react": "^7.37.4",
5051
"eslint-plugin-react-hooks": "^5.1.0",

frontend/src/actions.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import nebula from '/src/nebula';
2+
23
import { createSlice } from '@reduxjs/toolkit';
34
import { isNaN } from 'lodash';
45

@@ -33,6 +34,7 @@ const contextSlice = createSlice({
3334
},
3435

3536
reloadBrowser: (state, action) => {
37+
const _a = action;
3638
state.browserRefresh = state.browserRefresh + 1;
3739
return state;
3840
},

frontend/src/app.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import axios from 'axios';
2+
23
import nebula from '/src/nebula';
34

45
import { useState, useEffect, Suspense } from 'react';
6+
57
import { useLocalStorage } from '/src/hooks';
8+
69
import { Routes, Route, Navigate, BrowserRouter } from 'react-router-dom';
710

811
import { DialogProvider } from './hooks/useDialog';

frontend/src/components/BaseInput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import styled from 'styled-components';
2+
23
import { getTheme } from './theme';
34

45
const BaseInput = styled.input`

frontend/src/components/Button.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import clsx from 'clsx';
2+
import { forwardRef } from 'react';
13
import styled from 'styled-components';
4+
25
import { getTheme } from './theme';
3-
import { forwardRef } from 'react';
4-
import clsx from 'clsx';
56

67
const BaseButton = styled.button`
78
border: 0;

frontend/src/components/ContextMenu.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState, useEffect, useRef, useLayoutEffect } from 'react';
22
import styled from 'styled-components';
3+
34
import Button from './Button';
45

56
const ContextMenuWrapper = styled.div`

frontend/src/components/Dialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import clsx from 'clsx';
12
import { useEffect, useRef } from 'react';
23
import styled from 'styled-components';
3-
import clsx from 'clsx';
44

55
const StyledDialog = styled.dialog`
66
color: var(--color-text);

frontend/src/components/Dropdown.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import Button from './Button';
2-
import styled from 'styled-components';
31
import clsx from 'clsx';
2+
import styled from 'styled-components';
3+
4+
import Button from './Button';
45

56
const DropdownContainer = styled.div`
67
position: relative;
@@ -77,6 +78,7 @@ const DropdownOption = ({
7778
<Button
7879
label={label}
7980
icon={icon}
81+
style={style}
8082
iconStyle={hlColor ? { color: hlColor } : {}}
8183
disabled={disabled || currentValue === value}
8284
onClick={() => onClick(value)}
@@ -94,7 +96,6 @@ const Dropdown = ({
9496
contentStyle = {},
9597
value = null,
9698
disabled = false,
97-
defaultValue = null,
9899
iconOnRigth = false,
99100
}) => {
100101
if (align === 'right') contentStyle['right'] = 0;

frontend/src/components/InputColor.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useMemo } from 'react';
22
import styled from 'styled-components';
3+
34
import BaseInput from './BaseInput';
45

56
const BaseColorInput = styled(BaseInput)`

0 commit comments

Comments
 (0)