Skip to content

Commit ec23e44

Browse files
committed
update package-lock.json and linter rules, ignore unused observer var
1 parent 968a6b8 commit ec23e44

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

app/components/OptimizedLoopVideo.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export default function OptimizedLoopVideo({ src, className }: VideoHTMLAttribut
1616
videoRef.current.onload = () => console.log("Video Loaded")
1717
videoRef.current.onplay = () => console.log("Video is playing");
1818

19-
const intersectionObserver = new IntersectionObserver((entries, observer) => {
19+
const intersectionObserver = new IntersectionObserver((entries, _) => {
2020
entries.forEach(video => {
2121
if (video.isIntersecting) {
22-
for (var source in video.target.children) {
23-
var videoSource = video.target.children[source] as HTMLVideoElement;
22+
for (const source in video.target.children) {
23+
const videoSource = video.target.children[source] as HTMLVideoElement;
2424
if (typeof videoSource.tagName === "string" && videoSource.tagName === "SOURCE") {
2525
videoSource.src = videoSource.dataset.src as string;
2626
}

eslint.config.mjs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@ const compat = new FlatCompat({
1111

1212
const eslintConfig = [{
1313
ignores: ["node_modules/**", ".next/**", "out/**", "build/**", "next-env.d.ts"]
14-
}, ...compat.extends("next/core-web-vitals", "next/typescript")];
14+
}, ...compat.extends("next/core-web-vitals", "next/typescript"),
15+
{
16+
rules: {
17+
"@typescript-eslint/no-unused-vars": [
18+
"warn",
19+
{
20+
"args": "all",
21+
"argsIgnorePattern": "^_",
22+
"caughtErrors": "all",
23+
"caughtErrorsIgnorePattern": "^_",
24+
"destructuredArrayIgnorePattern": "^_",
25+
"varsIgnorePattern": "^_",
26+
"ignoreRestSiblings": true
27+
}
28+
]
29+
}
30+
}
31+
];
1532

1633
export default eslintConfig;

package-lock.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)