Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
98 lines (97 loc) · 3.35 KB
/
Copy patheslint.config.js
File metadata and controls
98 lines (97 loc) · 3.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import js from "@eslint/js";
import tseslint from "typescript-eslint";
export default [
{
ignores: [
"**/dist/**",
"**/coverage/**",
"**/artifacts/**",
"docs/site/**",
"tools/sam3-fixture/output/**",
"tools/geometry-fixture/output/**",
],
},
{
languageOptions: {
globals: {
clearInterval: "readonly",
clearTimeout: "readonly",
console: "readonly",
document: "readonly",
setInterval: "readonly",
setTimeout: "readonly",
window: "readonly",
},
},
},
js.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
/* A leading underscore marks a binding the code is required to accept and
* has no use for: a parameter the worker protocol carries, or the value of
* a generator drained for its side effects. */
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"no-restricted-imports": [
"error",
{
patterns: [
{
group: [
"supervision/web-video-engine/*",
"!supervision/web-video-engine/analysis",
"!supervision/web-video-engine/worker",
],
message:
"The web video engine exposes three entries: supervision/web-video-engine, supervision/web-video-engine/analysis, and supervision/web-video-engine/worker. Anything else is an internal module.",
},
{
group: [
"supervision-js-web-video-engine",
"supervision-js-web-video-engine/**",
],
message:
"The web video engine is a private workspace package that ships inside supervision. Import supervision/web-video-engine or supervision/web-video-engine/analysis.",
},
{
group: ["#web-video-engine", "#web-video-engine/**"],
message:
"#web-video-engine is the browser package's own alias for the staged engine build. Import supervision/web-video-engine or supervision/web-video-engine/analysis.",
},
{
group: ["**/video-engine/src/**"],
message:
"Import supervision/web-video-engine or supervision/web-video-engine/analysis. A path into the engine's source binds the importer to its file layout.",
},
],
},
],
},
},
{
/* The media seam and the subpath barrel are the two places that adapt the
* staged engine build, so they are the two that may name it. */
files: [
"packages/web/src/media/video-engine-media-source.ts",
"packages/web/src/media/mediabunny-frame-clock.ts",
"packages/web/src/media/track-frame-index.ts",
"packages/web/src/media/video-engine-media-source.test.ts",
"packages/web/src/web-video-engine/index.ts",
],
rules: {
"no-restricted-imports": "off",
},
},
{
files: ["packages/video-engine/src/decode-scheduler.test.ts"],
rules: {
/* Doubles for a decode that hangs: the generator awaits a promise that
* never settles, so it can never reach a yield. Being a generator is what
* the caller consumes, not an accident of how it was written. */
"require-yield": "off",
},
},
];