@r_masseater/oxlint-typed-rules 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/LICENSE +278 -0
  2. package/README.md +29 -1
  3. package/dist/config-rules-CIyMUUvG.mjs +6 -0
  4. package/dist/config-rules-CIyMUUvG.mjs.map +1 -0
  5. package/dist/drizzle.d.mts +5 -0
  6. package/dist/drizzle.mjs +232 -0
  7. package/dist/drizzle.mjs.map +1 -0
  8. package/dist/eslint-utils-DauzR3x9.mjs +489 -0
  9. package/dist/eslint-utils-DauzR3x9.mjs.map +1 -0
  10. package/dist/index.d.mts +12 -1
  11. package/dist/index.mjs +1 -1
  12. package/dist/react.d.mts +4 -2
  13. package/dist/react.mjs +9 -301
  14. package/dist/react.mjs.map +1 -1
  15. package/dist/remotion.d.mts +5 -0
  16. package/dist/remotion.mjs +955 -0
  17. package/dist/remotion.mjs.map +1 -0
  18. package/dist/rolldown-runtime-DQp2zzRu.mjs +41 -0
  19. package/dist/tanstack-query.d.mts +5 -0
  20. package/dist/tanstack-query.mjs +1379 -0
  21. package/dist/tanstack-query.mjs.map +1 -0
  22. package/dist/tanstack-router.d.mts +5 -0
  23. package/dist/tanstack-router.mjs +344 -0
  24. package/dist/tanstack-router.mjs.map +1 -0
  25. package/dist/tanstack-start.mjs +6 -4
  26. package/dist/tanstack-start.mjs.map +1 -1
  27. package/dist/ts-compat-kqrVqnFj.mjs +132 -0
  28. package/dist/ts-compat-kqrVqnFj.mjs.map +1 -0
  29. package/dist/{typed-rule-D8jasU_z.mjs → typed-rule-DsbM82SI.mjs} +20 -4
  30. package/dist/typed-rule-DsbM82SI.mjs.map +1 -0
  31. package/dist/typescript-eslint-utils-QnYasB-9.mjs +16 -0
  32. package/dist/typescript-eslint-utils-QnYasB-9.mjs.map +1 -0
  33. package/dist/upstream-plugin-DqJEA6iy.mjs +20 -0
  34. package/dist/upstream-plugin-DqJEA6iy.mjs.map +1 -0
  35. package/dist/upstream-plugin-xn91RvOJ.d.mts +15 -0
  36. package/package.json +55 -5
  37. package/dist/eslint-utils-CTNWAzIf.mjs +0 -352
  38. package/dist/eslint-utils-CTNWAzIf.mjs.map +0 -1
  39. package/dist/typed-rule-D8jasU_z.mjs.map +0 -1
@@ -0,0 +1,955 @@
1
+ import { n as import_eslint_utils, r as init_typescript_eslint_utils } from "./typescript-eslint-utils-QnYasB-9.mjs";
2
+ import { n as upstreamPlugin, t as plainRules } from "./upstream-plugin-DqJEA6iy.mjs";
3
+ // ../../node_modules/.pnpm/@remotion+eslint-plugin@4.0.541_eslint@9.39.5_jiti@2.6.1_supports-color@7.2.0_/node_modules/@remotion/eslint-plugin/dist/esm/index.mjs
4
+ init_typescript_eslint_utils();
5
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
6
+ var __esm = (fn, res, err) => () => {
7
+ if (fn) try {
8
+ res = fn(fn = 0);
9
+ } catch (e) {
10
+ err = [e];
11
+ }
12
+ if (err) throw err[0];
13
+ return res;
14
+ };
15
+ var createRule;
16
+ var DeterministicRandomness;
17
+ var deterministic_randomness_default;
18
+ var init_deterministic_randomness = __esm(() => {
19
+ createRule = import_eslint_utils.RuleCreator(() => {
20
+ return `https://github.com/remotion-dev/remotion`;
21
+ });
22
+ DeterministicRandomness = [
23
+ "The result of Math.random() will change between frames while in rendering mode.",
24
+ "Use the `random()` API from Remotion to get a deterministic pseudorandom value.",
25
+ "If you are sure you want a true random value, use `random(null)` to hide this warning.",
26
+ "See: https://remotion.dev/docs/using-randomness"
27
+ ].join(`
28
+ `);
29
+ deterministic_randomness_default = createRule({
30
+ name: "deterministic-randomness",
31
+ meta: {
32
+ type: "problem",
33
+ docs: {
34
+ description: DeterministicRandomness,
35
+ recommended: "warn"
36
+ },
37
+ fixable: void 0,
38
+ schema: [],
39
+ messages: { DeterministicRandomness }
40
+ },
41
+ defaultOptions: [],
42
+ create: (context) => {
43
+ return { CallExpression: (node) => {
44
+ const callee = node.callee;
45
+ if (callee.type === "MemberExpression") {
46
+ if (callee.object.type === "Identifier" && callee.object.name === "Math") {
47
+ if (callee.property.type === "Identifier" && callee.property.name === "random") context.report({
48
+ messageId: "DeterministicRandomness",
49
+ node
50
+ });
51
+ }
52
+ }
53
+ } };
54
+ }
55
+ });
56
+ });
57
+ var createRule2;
58
+ var EvenDimensions = "Videos rendered in H264/H265 codec do not support dimensions that are not divisible by 2. Remotion will round down your dimensions to satisfy this constraint. Ignore this warning if you don't plan on rendering this video with a H264 or H265 codec.";
59
+ var even_dimensions_default;
60
+ var init_even_dimensions = __esm(() => {
61
+ createRule2 = import_eslint_utils.RuleCreator(() => {
62
+ return `https://github.com/remotion-dev/remotion`;
63
+ });
64
+ even_dimensions_default = createRule2({
65
+ name: "even-dimensions",
66
+ meta: {
67
+ type: "problem",
68
+ docs: {
69
+ description: EvenDimensions,
70
+ recommended: "warn"
71
+ },
72
+ fixable: void 0,
73
+ schema: [],
74
+ messages: { EvenDimensions }
75
+ },
76
+ defaultOptions: [],
77
+ create: (context) => {
78
+ return { JSXAttribute: (node) => {
79
+ if (node.type !== "JSXAttribute") return;
80
+ if (node.name.name !== "width" && node.name.name !== "height") return;
81
+ const value = node.value;
82
+ if (!value || value.type !== "JSXExpressionContainer") return;
83
+ const expression = value.expression;
84
+ if (!expression || expression.type !== "Literal") return;
85
+ const stringValue = expression.value;
86
+ if (typeof stringValue !== "number") return;
87
+ const parent = node.parent;
88
+ if (!parent) return;
89
+ if (parent.type !== "JSXOpeningElement") return;
90
+ const name = parent.name;
91
+ if (name.type !== "JSXIdentifier") return;
92
+ if (name.name !== "Composition") return;
93
+ if (stringValue % 2 !== 0) context.report({
94
+ messageId: "EvenDimensions",
95
+ node
96
+ });
97
+ } };
98
+ }
99
+ });
100
+ });
101
+ var createRule3;
102
+ var BackgroundImage;
103
+ var no_background_image_default;
104
+ var init_no_background_image = __esm(() => {
105
+ createRule3 = import_eslint_utils.RuleCreator(() => {
106
+ return "https://remotion.dev/docs/troubleshooting/background-image";
107
+ });
108
+ BackgroundImage = ["Don't use background-image in Remotion.", "See: https://remotion.dev/docs/troubleshooting/background-image"].join(`
109
+ `);
110
+ no_background_image_default = createRule3({
111
+ name: "no-background-image",
112
+ meta: {
113
+ type: "problem",
114
+ docs: {
115
+ description: BackgroundImage,
116
+ recommended: "error"
117
+ },
118
+ fixable: void 0,
119
+ schema: [],
120
+ messages: { BackgroundImage }
121
+ },
122
+ defaultOptions: [],
123
+ create: (context) => {
124
+ return { Property: (node) => {
125
+ if (node.key.type !== "Identifier") return;
126
+ if (node.key.name !== "backgroundImage") return;
127
+ if (node.value.type === "Literal") {
128
+ const { value } = node.value;
129
+ if (typeof value === "string" && value.includes("url(")) context.report({
130
+ messageId: "BackgroundImage",
131
+ node
132
+ });
133
+ }
134
+ if (node.value.type === "TemplateLiteral") for (const element of node.value.quasis) {
135
+ if (element.type !== "TemplateElement") continue;
136
+ if (element.value.raw.includes("url(")) context.report({
137
+ messageId: "BackgroundImage",
138
+ node
139
+ });
140
+ }
141
+ } };
142
+ }
143
+ });
144
+ });
145
+ var createRule4;
146
+ var DurationInFrames = "Infinity is now the default, so you can remove the prop.";
147
+ var no_duration_frames_infinity_default;
148
+ var init_no_duration_frames_infinity = __esm(() => {
149
+ createRule4 = import_eslint_utils.RuleCreator(() => {
150
+ return `https://github.com/remotion-dev/remotion`;
151
+ });
152
+ no_duration_frames_infinity_default = createRule4({
153
+ name: "duration-in-frames",
154
+ meta: {
155
+ type: "problem",
156
+ docs: {
157
+ description: DurationInFrames,
158
+ recommended: "warn"
159
+ },
160
+ fixable: "code",
161
+ schema: [],
162
+ messages: { DurationInFrames }
163
+ },
164
+ defaultOptions: [],
165
+ create: (context) => {
166
+ return { JSXAttribute: (node) => {
167
+ if (node.type !== "JSXAttribute") return;
168
+ if (node.name.name !== "durationInFrames") return;
169
+ const value = node.value;
170
+ if (!value || value.type !== "JSXExpressionContainer") return;
171
+ const expression = value.expression;
172
+ if (!expression || expression.type !== "Identifier") return;
173
+ const stringValue = expression.name;
174
+ if (typeof stringValue !== "string") return;
175
+ const parent = node.parent;
176
+ if (!parent) return;
177
+ if (parent.type !== "JSXOpeningElement") return;
178
+ const name = parent.name;
179
+ if (name.type !== "JSXIdentifier") return;
180
+ if (name.name !== "Sequence") return;
181
+ if (stringValue === "Infinity") context.report({
182
+ messageId: "DurationInFrames",
183
+ node,
184
+ fix: (fixer) => {
185
+ return fixer.removeRange([node.name.range[0], value.range[1]]);
186
+ }
187
+ });
188
+ } };
189
+ }
190
+ });
191
+ });
192
+ var createRule5;
193
+ var From0 = "0 is now the default, so you can remove the prop.";
194
+ var no_from_0_default;
195
+ var init_no_from_0 = __esm(() => {
196
+ createRule5 = import_eslint_utils.RuleCreator(() => {
197
+ return `https://github.com/remotion-dev/remotion`;
198
+ });
199
+ no_from_0_default = createRule5({
200
+ name: "from",
201
+ meta: {
202
+ type: "problem",
203
+ docs: {
204
+ description: From0,
205
+ recommended: "warn"
206
+ },
207
+ fixable: "code",
208
+ schema: [],
209
+ messages: { From0 }
210
+ },
211
+ defaultOptions: [],
212
+ create: (context) => {
213
+ return { JSXAttribute: (node) => {
214
+ if (node.type !== "JSXAttribute") return;
215
+ if (node.name.name !== "from") return;
216
+ const value = node.value;
217
+ if (!value || value.type !== "JSXExpressionContainer") return;
218
+ const expression = value.expression;
219
+ if (!expression || expression.type !== "Literal") return;
220
+ const stringValue = expression.value;
221
+ if (stringValue !== 0) return;
222
+ const parent = node.parent;
223
+ if (!parent) return;
224
+ if (parent.type !== "JSXOpeningElement") return;
225
+ const name = parent.name;
226
+ if (name.type !== "JSXIdentifier") return;
227
+ if (name.name !== "Sequence") return;
228
+ if (stringValue === 0) context.report({
229
+ messageId: "From0",
230
+ node,
231
+ fix: (fixer) => {
232
+ return fixer.removeRange([node.name.range[0], value.range[1]]);
233
+ }
234
+ });
235
+ } };
236
+ }
237
+ });
238
+ });
239
+ var createRule6;
240
+ var NoObjectFitInStyle;
241
+ var NoObjectFitInClassName;
242
+ var objectFitClassPattern;
243
+ var no_object_fit_on_media_video_default;
244
+ var init_no_object_fit_on_media_video = __esm(() => {
245
+ createRule6 = import_eslint_utils.RuleCreator(() => {
246
+ return "https://remotion.dev/docs/media/video#objectfit";
247
+ });
248
+ NoObjectFitInStyle = [
249
+ "Passing `objectFit` via the `style` prop is not supported for `<Video>` from `@remotion/media`.",
250
+ "Use the `objectFit` prop directly instead.",
251
+ "See: https://remotion.dev/docs/media/video#objectfit"
252
+ ].join(`
253
+ `);
254
+ NoObjectFitInClassName = [
255
+ "Passing an `object-fit` CSS class via `className` is not supported for `<Video>` from `@remotion/media`.",
256
+ "Use the `objectFit` prop directly instead.",
257
+ "See: https://remotion.dev/docs/media/video#objectfit"
258
+ ].join(`
259
+ `);
260
+ objectFitClassPattern = /\bobject-(contain|cover|fill|none|scale-down)\b/;
261
+ no_object_fit_on_media_video_default = createRule6({
262
+ name: "no-object-fit-on-media-video",
263
+ meta: {
264
+ type: "problem",
265
+ docs: {
266
+ description: NoObjectFitInStyle,
267
+ recommended: "warn"
268
+ },
269
+ fixable: void 0,
270
+ schema: [],
271
+ messages: {
272
+ NoObjectFitInStyle,
273
+ NoObjectFitInClassName
274
+ }
275
+ },
276
+ defaultOptions: [],
277
+ create: (context) => {
278
+ return { JSXOpeningElement: (node) => {
279
+ if (node.name.type !== "JSXIdentifier" || node.name.name !== "Video") return;
280
+ for (const attr of node.attributes) {
281
+ if (attr.type !== "JSXAttribute") continue;
282
+ if (attr.name.type === "JSXIdentifier" && attr.name.name === "style" && attr.value) {
283
+ if (attr.value.type === "JSXExpressionContainer" && attr.value.expression.type === "ObjectExpression") for (const prop of attr.value.expression.properties) {
284
+ if (prop.type !== "Property") continue;
285
+ let propertyName;
286
+ if (prop.key.type === "Identifier") propertyName = prop.key.name;
287
+ else if (prop.key.type === "Literal" && typeof prop.key.value === "string") propertyName = prop.key.value;
288
+ if (propertyName === "objectFit" || propertyName === "object-fit") context.report({
289
+ messageId: "NoObjectFitInStyle",
290
+ node: prop
291
+ });
292
+ }
293
+ }
294
+ if (attr.name.type === "JSXIdentifier" && attr.name.name === "className" && attr.value) {
295
+ let classString;
296
+ if (attr.value.type === "Literal" && typeof attr.value.value === "string") classString = attr.value.value;
297
+ else if (attr.value.type === "JSXExpressionContainer" && attr.value.expression.type === "Literal" && typeof attr.value.expression.value === "string") classString = attr.value.expression.value;
298
+ else if (attr.value.type === "JSXExpressionContainer" && attr.value.expression.type === "TemplateLiteral") classString = attr.value.expression.quasis.map((q) => q.value.cooked || q.value.raw).join(" ");
299
+ if (classString && objectFitClassPattern.test(classString)) context.report({
300
+ messageId: "NoObjectFitInClassName",
301
+ node: attr
302
+ });
303
+ }
304
+ }
305
+ } };
306
+ }
307
+ });
308
+ });
309
+ var createRule7;
310
+ var NoStringAssets;
311
+ var no_string_assets_default;
312
+ var init_no_string_assets = __esm(() => {
313
+ createRule7 = import_eslint_utils.RuleCreator(() => {
314
+ return `https://github.com/remotion-dev/remotion`;
315
+ });
316
+ NoStringAssets = ["Don't reference local assets by string, use an import statement or staticFile() instead.", "See: https://www.remotion.dev/docs/assets"].join(`
317
+ `);
318
+ no_string_assets_default = createRule7({
319
+ name: "no-string-assets",
320
+ meta: {
321
+ type: "problem",
322
+ docs: {
323
+ description: NoStringAssets,
324
+ recommended: "warn"
325
+ },
326
+ fixable: void 0,
327
+ schema: [],
328
+ messages: { NoStringAssets }
329
+ },
330
+ defaultOptions: [],
331
+ create: (context) => {
332
+ return { JSXAttribute: (node) => {
333
+ if (node.type !== "JSXAttribute") return;
334
+ if (node.name.name !== "src") return;
335
+ const value = node.value;
336
+ const insideCurlyBraces = value && value.type === "JSXExpressionContainer" && value.expression.type === "Literal";
337
+ if (!value || value.type !== "Literal" && !insideCurlyBraces) return;
338
+ const stringValue = value && value.type === "JSXExpressionContainer" && value.expression.type === "Literal" ? value.expression.value : value.type === "Literal" ? value.value : null;
339
+ if (typeof stringValue !== "string") return;
340
+ const parent = node.parent;
341
+ if (!parent) return;
342
+ if (parent.type !== "JSXOpeningElement") return;
343
+ const name = parent.name;
344
+ if (name.type !== "JSXIdentifier") return;
345
+ if (name.name === "Img" || name.name === "img" || name.name === "Audio" || name.name === "audio" || name.name === "Video" || name.name === "video" || name.name === "source" || name.name === "Html5Video" || name.name === "Html5Audio") {
346
+ if (stringValue.startsWith("http://")) return;
347
+ if (stringValue.startsWith("https://")) return;
348
+ if (stringValue.startsWith("data:")) return;
349
+ context.report({
350
+ messageId: "NoStringAssets",
351
+ node
352
+ });
353
+ }
354
+ } };
355
+ }
356
+ });
357
+ });
358
+ function findProblematicTailwindClass(classString) {
359
+ for (const pattern of nonPureAnimationTailwindClasses) {
360
+ const match = classString.match(pattern);
361
+ if (match) return {
362
+ match: match[0],
363
+ index: match.index
364
+ };
365
+ }
366
+ return null;
367
+ }
368
+ var createRule8;
369
+ var NonPureAnimation;
370
+ var nonPureAnimationProperties;
371
+ var nonPureAnimationPropertiesKebab;
372
+ var nonPureAnimationTailwindClasses;
373
+ var non_pure_animation_default;
374
+ var init_non_pure_animation = __esm(() => {
375
+ createRule8 = import_eslint_utils.RuleCreator(() => {
376
+ return "https://www.remotion.dev/docs/flickering";
377
+ });
378
+ NonPureAnimation = ["This animation does not run purely off useCurrentFrame() and will lead to flickering.", "See: https://www.remotion.dev/docs/flickering"].join(`
379
+ `);
380
+ nonPureAnimationProperties = /* @__PURE__ */ new Set(["transition"]);
381
+ nonPureAnimationPropertiesKebab = /* @__PURE__ */ new Set(["transition"]);
382
+ nonPureAnimationTailwindClasses = [/\btransition-\w+\b/, /\btransition\b/];
383
+ non_pure_animation_default = createRule8({
384
+ name: "non-pure-animation",
385
+ meta: {
386
+ type: "problem",
387
+ docs: {
388
+ description: NonPureAnimation,
389
+ recommended: "warn"
390
+ },
391
+ fixable: void 0,
392
+ schema: [],
393
+ messages: { NonPureAnimation }
394
+ },
395
+ defaultOptions: [],
396
+ create: (context) => {
397
+ return {
398
+ Property: (node) => {
399
+ let propertyName;
400
+ if (node.key.type === "Identifier") propertyName = node.key.name;
401
+ else if (node.key.type === "Literal" && typeof node.key.value === "string") propertyName = node.key.value;
402
+ if (!propertyName) return;
403
+ if (nonPureAnimationProperties.has(propertyName) || nonPureAnimationPropertiesKebab.has(propertyName)) context.report({
404
+ messageId: "NonPureAnimation",
405
+ node
406
+ });
407
+ },
408
+ JSXAttribute: (node) => {
409
+ if (node.name.type === "JSXIdentifier" && node.name.name === "className" && node.value) {
410
+ let classString;
411
+ let valueNode;
412
+ if (node.value.type === "Literal" && typeof node.value.value === "string") {
413
+ classString = node.value.value;
414
+ valueNode = node.value;
415
+ } else if (node.value.type === "JSXExpressionContainer" && node.value.expression.type === "Literal" && typeof node.value.expression.value === "string") {
416
+ classString = node.value.expression.value;
417
+ valueNode = node.value.expression;
418
+ } else if (node.value.type === "JSXExpressionContainer" && node.value.expression.type === "TemplateLiteral") {
419
+ const templateLiteral = node.value.expression;
420
+ classString = templateLiteral.quasis.map((q) => q.value.cooked || q.value.raw).join(" ");
421
+ valueNode = templateLiteral;
422
+ }
423
+ if (classString) {
424
+ const problematicClass = findProblematicTailwindClass(classString);
425
+ if (problematicClass) {
426
+ const sourceCode = "sourceCode" in context ? context.sourceCode : context.getSourceCode();
427
+ const classStart = valueNode.range[0] + (valueNode.type === "Literal" ? 1 : 0) + problematicClass.index;
428
+ const classEnd = classStart + problematicClass.match.length;
429
+ const start = sourceCode.getLocFromIndex(classStart);
430
+ const end = sourceCode.getLocFromIndex(classEnd);
431
+ context.report({
432
+ messageId: "NonPureAnimation",
433
+ loc: {
434
+ start,
435
+ end
436
+ }
437
+ });
438
+ }
439
+ }
440
+ }
441
+ }
442
+ };
443
+ }
444
+ });
445
+ });
446
+ function containsSlowTailwindClass(classString) {
447
+ return slowTailwindClasses.some((pattern) => pattern.test(classString));
448
+ }
449
+ var createRule9;
450
+ var SlowCssProperty;
451
+ var slowCssProperties;
452
+ var slowCssPropertiesKebab;
453
+ var slowTailwindClasses;
454
+ var slow_css_property_default;
455
+ var init_slow_css_property = __esm(() => {
456
+ createRule9 = import_eslint_utils.RuleCreator(() => {
457
+ return "https://remotion.dev/docs/gpu";
458
+ });
459
+ SlowCssProperty = ["This GPU effect may slow down the render on machines which don't have a GPU.", "See: https://remotion.dev/docs/gpu"].join(`
460
+ `);
461
+ slowCssProperties = /* @__PURE__ */ new Set([
462
+ "boxShadow",
463
+ "textShadow",
464
+ "filter"
465
+ ]);
466
+ slowCssPropertiesKebab = /* @__PURE__ */ new Set([
467
+ "box-shadow",
468
+ "text-shadow",
469
+ "filter"
470
+ ]);
471
+ slowTailwindClasses = [
472
+ /\bshadow-(?:sm|md|lg|xl|2xl|inner|none|\w+)\b/,
473
+ /\bshadow-\w+(?:\/\d+)?\b/,
474
+ /\bblur-(?:none|sm|md|lg|xl|2xl|3xl|\w+)\b/,
475
+ /\bbrightness-\d+\b/,
476
+ /\bcontrast-\d+\b/,
477
+ /\bdrop-shadow-(?:sm|md|lg|xl|2xl|none|\w+)\b/,
478
+ /\bgrayscale(?:-\d+)?\b/,
479
+ /\bhue-rotate-\d+\b/,
480
+ /\binvert(?:-\d+)?\b/,
481
+ /\bsaturate-\d+\b/,
482
+ /\bsepia(?:-\d+)?\b/,
483
+ /\btext-shadow-\w+\b/
484
+ ];
485
+ slow_css_property_default = createRule9({
486
+ name: "slow-css-property",
487
+ meta: {
488
+ type: "problem",
489
+ docs: {
490
+ description: SlowCssProperty,
491
+ recommended: "warn"
492
+ },
493
+ fixable: void 0,
494
+ schema: [],
495
+ messages: { SlowCssProperty }
496
+ },
497
+ defaultOptions: [],
498
+ create: (context) => {
499
+ return {
500
+ Property: (node) => {
501
+ let propertyName;
502
+ if (node.key.type === "Identifier") propertyName = node.key.name;
503
+ else if (node.key.type === "Literal" && typeof node.key.value === "string") propertyName = node.key.value;
504
+ if (!propertyName) return;
505
+ if (slowCssProperties.has(propertyName) || slowCssPropertiesKebab.has(propertyName)) context.report({
506
+ messageId: "SlowCssProperty",
507
+ node
508
+ });
509
+ },
510
+ JSXAttribute: (node) => {
511
+ if (node.name.type === "JSXIdentifier" && node.name.name === "className" && node.value) {
512
+ let classString;
513
+ if (node.value.type === "Literal" && typeof node.value.value === "string") classString = node.value.value;
514
+ else if (node.value.type === "JSXExpressionContainer" && node.value.expression.type === "Literal" && typeof node.value.expression.value === "string") classString = node.value.expression.value;
515
+ else if (node.value.type === "JSXExpressionContainer" && node.value.expression.type === "TemplateLiteral") classString = node.value.expression.quasis.map((q) => q.value.cooked || q.value.raw).join(" ");
516
+ if (classString && containsSlowTailwindClass(classString)) context.report({
517
+ messageId: "SlowCssProperty",
518
+ node
519
+ });
520
+ }
521
+ }
522
+ };
523
+ }
524
+ });
525
+ });
526
+ var createRule10;
527
+ var RelativePathStaticFile;
528
+ var AbsoluteStaticFile;
529
+ var PublicStaticFile;
530
+ var staticfile_no_relative_default;
531
+ var init_staticfile_no_relative = __esm(() => {
532
+ createRule10 = import_eslint_utils.RuleCreator(() => {
533
+ return `https://remotion.dev/docs/staticfile-relative-paths`;
534
+ });
535
+ RelativePathStaticFile = ["Don't pass a relative path to staticFile().", "See: https://remotion.dev/docs/staticfile-relative-paths"].join(`
536
+ `);
537
+ AbsoluteStaticFile = ["Do not pass an absolute path to staticFile().", "See: https://remotion.dev/docs/staticfile-relative-paths"].join("");
538
+ PublicStaticFile = ["Do not prefix your assets with public/.", "See: https://remotion.dev/docs/staticfile-relative-paths"].join("");
539
+ staticfile_no_relative_default = createRule10({
540
+ name: "staticfile-no-relative",
541
+ meta: {
542
+ type: "problem",
543
+ docs: {
544
+ description: RelativePathStaticFile,
545
+ recommended: "warn"
546
+ },
547
+ fixable: void 0,
548
+ schema: [],
549
+ messages: {
550
+ RelativePathStaticFile,
551
+ PublicStaticFile,
552
+ AbsoluteStaticFile
553
+ }
554
+ },
555
+ defaultOptions: [],
556
+ create: (context) => {
557
+ return { CallExpression: (node) => {
558
+ if (!node) return;
559
+ if (node.type === "CallExpression" && node.callee.type === "Identifier" && node.callee.name === "staticFile") {
560
+ const args = node.arguments;
561
+ if (args.length === 0) return;
562
+ const firstArg = args[0];
563
+ if (firstArg.type === "Literal") {
564
+ const value = firstArg.value;
565
+ if (typeof value !== "string") return;
566
+ if (value.startsWith("./")) context.report({
567
+ messageId: "RelativePathStaticFile",
568
+ node
569
+ });
570
+ if (value.startsWith("../")) context.report({
571
+ messageId: "RelativePathStaticFile",
572
+ node
573
+ });
574
+ if (value.startsWith("public/")) context.report({
575
+ messageId: "PublicStaticFile",
576
+ node
577
+ });
578
+ if (value.startsWith("/Users") || value.startsWith("/home") || value.startsWith("/tmp") || value.startsWith("/etc") || value.startsWith("/opt") || value.startsWith("/var") || value.startsWith("C:") || value.startsWith("D:") || value.startsWith("E:")) context.report({
579
+ messageId: "AbsoluteStaticFile",
580
+ node
581
+ });
582
+ }
583
+ }
584
+ } };
585
+ }
586
+ });
587
+ });
588
+ var createRule11;
589
+ var RelativePathStaticFile2;
590
+ var staticfile_no_remote_default;
591
+ var init_staticfile_no_remote = __esm(() => {
592
+ createRule11 = import_eslint_utils.RuleCreator(() => {
593
+ return `https://remotion.dev/docs/staticfile-remote-urls`;
594
+ });
595
+ RelativePathStaticFile2 = ["Don't pass a remote URL to staticFile().", "See: https://remotion.dev/docs/staticfile-remote-urls"].join(`
596
+ `);
597
+ staticfile_no_remote_default = createRule11({
598
+ name: "staticfile-no-remote",
599
+ meta: {
600
+ type: "problem",
601
+ docs: {
602
+ description: RelativePathStaticFile2,
603
+ recommended: "warn"
604
+ },
605
+ fixable: void 0,
606
+ schema: [],
607
+ messages: { RelativePathStaticFile: RelativePathStaticFile2 }
608
+ },
609
+ defaultOptions: [],
610
+ create: (context) => {
611
+ return { CallExpression: (node) => {
612
+ if (!node) return;
613
+ if (node.type === "CallExpression" && node.callee.type === "Identifier" && node.callee.name === "staticFile") {
614
+ const args = node.arguments;
615
+ if (args.length === 0) return;
616
+ const firstArg = args[0];
617
+ if (firstArg.type === "Literal") {
618
+ const value = firstArg.value;
619
+ if (typeof value !== "string") return;
620
+ if (value.startsWith("http://")) context.report({
621
+ messageId: "RelativePathStaticFile",
622
+ node
623
+ });
624
+ if (value.startsWith("https://")) context.report({
625
+ messageId: "RelativePathStaticFile",
626
+ node
627
+ });
628
+ }
629
+ }
630
+ } };
631
+ }
632
+ });
633
+ });
634
+ var createRule12;
635
+ var UseGifComponent;
636
+ var use_gif_component_default;
637
+ var init_use_gif_component = __esm(() => {
638
+ createRule12 = import_eslint_utils.RuleCreator(() => {
639
+ return `https://github.com/remotion-dev/remotion`;
640
+ });
641
+ UseGifComponent = [
642
+ "Use the <Gif> component animated GIFs.",
643
+ "See: https://www.remotion.dev/docs/gif.",
644
+ "Ignore this message if this is a non-animated GIF."
645
+ ].join(`
646
+ `);
647
+ use_gif_component_default = createRule12({
648
+ name: "use-gif-component",
649
+ meta: {
650
+ type: "problem",
651
+ docs: {
652
+ description: UseGifComponent,
653
+ recommended: "warn"
654
+ },
655
+ fixable: void 0,
656
+ schema: [],
657
+ messages: { UseGifComponent }
658
+ },
659
+ defaultOptions: [],
660
+ create: (context) => {
661
+ return { JSXAttribute: (node) => {
662
+ if (node.type !== "JSXAttribute") return;
663
+ if (node.name.name !== "src") return;
664
+ const parent = node.parent;
665
+ if (!parent) return;
666
+ if (parent.type !== "JSXOpeningElement") return;
667
+ const name = parent.name;
668
+ if (name.type !== "JSXIdentifier") return;
669
+ if (name.name !== "Img" && name.name !== "img") return;
670
+ const value = node.value;
671
+ if (!value) return;
672
+ const stringValue = value && value.type === "JSXExpressionContainer" && value.expression.type === "Literal" ? value.expression.value : value.type === "Literal" ? value.value : null;
673
+ if (typeof stringValue === "string") {
674
+ if (stringValue.includes(".gif")) context.report({
675
+ messageId: "UseGifComponent",
676
+ node
677
+ });
678
+ }
679
+ if (value.type === "JSXExpressionContainer" && value.expression.type === "CallExpression" && value.expression.callee.type === "Identifier" && value.expression.callee.name === "staticFile") {
680
+ const args = value.expression.arguments;
681
+ if (args.length === 0) return;
682
+ const firstArg = args[0];
683
+ if (firstArg.type === "Literal") {
684
+ const value = firstArg.value;
685
+ if (typeof value !== "string") return;
686
+ if (value.includes(".gif")) context.report({
687
+ messageId: "UseGifComponent",
688
+ node
689
+ });
690
+ }
691
+ }
692
+ } };
693
+ }
694
+ });
695
+ });
696
+ var createRule13;
697
+ var ImportConfig = "Update the import to the new V4 location: import {Config} from '@remotion/cli/config'";
698
+ var rule;
699
+ var v4_import_default;
700
+ var init_v4_import = __esm(() => {
701
+ createRule13 = import_eslint_utils.RuleCreator(() => {
702
+ return `https://www.remotion.dev/docs/4-0-migration`;
703
+ });
704
+ rule = createRule13({
705
+ name: "v4-config-import",
706
+ meta: {
707
+ type: "problem",
708
+ docs: {
709
+ description: ImportConfig,
710
+ recommended: "warn"
711
+ },
712
+ fixable: void 0,
713
+ schema: [],
714
+ messages: { ImportConfig }
715
+ },
716
+ defaultOptions: [],
717
+ create: (context) => {
718
+ return { ImportDeclaration: (node) => {
719
+ if (node.source.value !== "remotion") return;
720
+ if (node.specifiers.find((s) => s.type === "ImportSpecifier" && s.imported.name === "Config")) context.report({
721
+ messageId: "ImportConfig",
722
+ node
723
+ });
724
+ } };
725
+ }
726
+ });
727
+ v4_import_default = rule;
728
+ });
729
+ var createRule14;
730
+ var validNameRegex;
731
+ var InvalidCompositionId = "Composition IDs can only contain a-z, A-Z, 0-9, CJK characters and -.";
732
+ var InvalidFolderName = "Folder names can only contain a-z, A-Z, 0-9, CJK characters and -.";
733
+ var getStringValue = (value) => {
734
+ if (!value) return null;
735
+ if (value.type === "Literal") return typeof value.value === "string" ? value.value : null;
736
+ if (value.type !== "JSXExpressionContainer") return null;
737
+ const { expression } = value;
738
+ if (expression.type === "Literal") return typeof expression.value === "string" ? expression.value : null;
739
+ if (expression.type === "TemplateLiteral" && expression.expressions.length === 0) return expression.quasis[0].value.cooked;
740
+ return null;
741
+ };
742
+ var getJsxElementName = (node) => {
743
+ if (node.type !== "JSXIdentifier") return null;
744
+ return node.name;
745
+ };
746
+ var valid_composition_and_folder_name_default;
747
+ var init_valid_composition_and_folder_name = __esm(() => {
748
+ createRule14 = import_eslint_utils.RuleCreator(() => {
749
+ return `https://github.com/remotion-dev/remotion`;
750
+ });
751
+ validNameRegex = /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/;
752
+ valid_composition_and_folder_name_default = createRule14({
753
+ name: "valid-composition-and-folder-name",
754
+ meta: {
755
+ type: "problem",
756
+ docs: {
757
+ description: "Warns about invalid Remotion composition IDs and folder names.",
758
+ recommended: "warn"
759
+ },
760
+ fixable: void 0,
761
+ schema: [],
762
+ messages: {
763
+ InvalidCompositionId,
764
+ InvalidFolderName
765
+ }
766
+ },
767
+ defaultOptions: [],
768
+ create: (context) => {
769
+ return { JSXAttribute: (node) => {
770
+ if (node.type !== "JSXAttribute") return;
771
+ if (node.name.type !== "JSXIdentifier") return;
772
+ const parent = node.parent;
773
+ if (!parent || parent.type !== "JSXOpeningElement") return;
774
+ const elementName = getJsxElementName(parent.name);
775
+ if (elementName === null) return;
776
+ const propName = node.name.name;
777
+ const value = getStringValue(node.value);
778
+ if (value === null || validNameRegex.test(value)) return;
779
+ if ((elementName === "Composition" || elementName === "Still") && propName === "id") context.report({
780
+ messageId: "InvalidCompositionId",
781
+ node
782
+ });
783
+ if (elementName === "Folder" && propName === "name") context.report({
784
+ messageId: "InvalidFolderName",
785
+ node
786
+ });
787
+ } };
788
+ }
789
+ });
790
+ });
791
+ var createRule15;
792
+ var VolumeCallback = "Deprecated no-op kept for compatibility. Volume can be animated with regular keyframes.";
793
+ var volume_callback_default;
794
+ var init_volume_callback = __esm(() => {
795
+ createRule15 = import_eslint_utils.RuleCreator(() => {
796
+ return `https://github.com/remotion-dev/remotion`;
797
+ });
798
+ volume_callback_default = createRule15({
799
+ name: "volume-callback",
800
+ meta: {
801
+ type: "problem",
802
+ docs: {
803
+ description: VolumeCallback,
804
+ recommended: "warn"
805
+ },
806
+ fixable: void 0,
807
+ schema: [],
808
+ messages: { VolumeCallback }
809
+ },
810
+ defaultOptions: [],
811
+ create: () => ({})
812
+ });
813
+ });
814
+ var createRule16;
815
+ var NoNativeImgTag = "Prefer the <Img /> tag from 'remotion' package, because it will wait until the image is loaded when you are rendering your video.";
816
+ var NoNativeIFrameTag = "Prefer the <IFrame /> tag from 'remotion' package, because it will wait until the iframe is loaded when you are rendering your video.";
817
+ var NoNativeAudioTag = "Use the <Audio /> tag from '@remotion/media' package, because it will synchronize with the Remotion timeline.";
818
+ var NoNativeVideoTag = "Use the <Video /> tag from '@remotion/media' package, because it will synchronize with the Remotion timeline.";
819
+ var warn_native_media_tag_default;
820
+ var init_warn_native_media_tag = __esm(() => {
821
+ createRule16 = import_eslint_utils.RuleCreator(() => {
822
+ return `https://github.com/remotion-dev/remotion`;
823
+ });
824
+ warn_native_media_tag_default = createRule16({
825
+ name: "warn-native-media-tag",
826
+ meta: {
827
+ type: "problem",
828
+ docs: {
829
+ description: NoNativeImgTag,
830
+ recommended: "warn"
831
+ },
832
+ fixable: void 0,
833
+ schema: [],
834
+ messages: {
835
+ NoNativeImgTag,
836
+ NoNativeIFrameTag,
837
+ NoNativeAudioTag,
838
+ NoNativeVideoTag
839
+ }
840
+ },
841
+ defaultOptions: [],
842
+ create: (context) => {
843
+ return {
844
+ JSXOpeningElement: (node) => {
845
+ if (node.name.type === "JSXIdentifier" && node.name.name === "img") context.report({
846
+ messageId: "NoNativeImgTag",
847
+ node
848
+ });
849
+ if (node.name.type === "JSXIdentifier" && node.name.name === "iframe") context.report({
850
+ messageId: "NoNativeIFrameTag",
851
+ node
852
+ });
853
+ if (node.name.type === "JSXIdentifier" && node.name.name === "video") context.report({
854
+ messageId: "NoNativeVideoTag",
855
+ node
856
+ });
857
+ if (node.name.type === "JSXIdentifier" && node.name.name === "audio") context.report({
858
+ messageId: "NoNativeAudioTag",
859
+ node
860
+ });
861
+ },
862
+ TaggedTemplateExpression: (node) => {
863
+ if (node.tag.type !== "MemberExpression") return;
864
+ if (node.tag.object.type !== "Identifier") return;
865
+ if (node.tag.object.name !== "styled") return;
866
+ if (node.tag.property.type !== "Identifier") return;
867
+ if (node.tag.property.name === "img") context.report({
868
+ messageId: "NoNativeImgTag",
869
+ node
870
+ });
871
+ if (node.tag.property.name === "iframe") context.report({
872
+ messageId: "NoNativeIFrameTag",
873
+ node
874
+ });
875
+ if (node.tag.property.name === "audio") context.report({
876
+ messageId: "NoNativeAudioTag",
877
+ node
878
+ });
879
+ if (node.tag.property.name === "video") context.report({
880
+ messageId: "NoNativeVideoTag",
881
+ node
882
+ });
883
+ }
884
+ };
885
+ }
886
+ });
887
+ });
888
+ var esm_default = __commonJS(function(exports, module) {
889
+ init_deterministic_randomness();
890
+ init_even_dimensions();
891
+ init_no_background_image();
892
+ init_no_duration_frames_infinity();
893
+ init_no_from_0();
894
+ init_no_object_fit_on_media_video();
895
+ init_no_string_assets();
896
+ init_non_pure_animation();
897
+ init_slow_css_property();
898
+ init_staticfile_no_relative();
899
+ init_staticfile_no_remote();
900
+ init_use_gif_component();
901
+ init_v4_import();
902
+ init_valid_composition_and_folder_name();
903
+ init_volume_callback();
904
+ init_warn_native_media_tag();
905
+ var rules = {
906
+ "warn-native-media-tag": warn_native_media_tag_default,
907
+ "deterministic-randomness": deterministic_randomness_default,
908
+ "no-string-assets": no_string_assets_default,
909
+ "even-dimensions": even_dimensions_default,
910
+ "duration-in-frames": no_duration_frames_infinity_default,
911
+ "from-0": no_from_0_default,
912
+ "volume-callback": volume_callback_default,
913
+ "use-gif-component": use_gif_component_default,
914
+ "staticfile-no-relative": staticfile_no_relative_default,
915
+ "staticfile-no-remote": staticfile_no_remote_default,
916
+ "no-background-image": no_background_image_default,
917
+ "non-pure-animation": non_pure_animation_default,
918
+ "slow-css-property": slow_css_property_default,
919
+ "v4-config-import": v4_import_default,
920
+ "no-object-fit-on-media-video": no_object_fit_on_media_video_default,
921
+ "valid-composition-and-folder-name": valid_composition_and_folder_name_default
922
+ };
923
+ var recommendedRuleConfig = {
924
+ "@remotion/warn-native-media-tag": "error",
925
+ "@remotion/deterministic-randomness": "error",
926
+ "@remotion/no-string-assets": "error",
927
+ "@remotion/even-dimensions": "error",
928
+ "@remotion/duration-in-frames": "error",
929
+ "@remotion/from-0": "error",
930
+ "@remotion/use-gif-component": "error",
931
+ "@remotion/staticfile-no-relative": "error",
932
+ "@remotion/staticfile-no-remote": "error",
933
+ "@remotion/no-background-image": "error",
934
+ "@remotion/non-pure-animation": "warn",
935
+ "@remotion/v4-config-import": "error",
936
+ "@remotion/no-object-fit-on-media-video": "warn",
937
+ "@remotion/valid-composition-and-folder-name": "error"
938
+ };
939
+ module.exports = {
940
+ configs: { recommended: {
941
+ rules: recommendedRuleConfig,
942
+ plugins: ["@remotion"]
943
+ } },
944
+ rules,
945
+ flatPlugin: {
946
+ rules: recommendedRuleConfig,
947
+ plugins: { "@remotion": { rules } }
948
+ }
949
+ };
950
+ })();
951
+ // src/remotion.ts
952
+ const plugin = upstreamPlugin("@remotion", esm_default, plainRules);
953
+ export { plugin as default };
954
+
955
+ //# sourceMappingURL=remotion.mjs.map