@remotion/eslint-config-flat 4.0.484 → 4.0.485

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.
@@ -46263,6 +46263,7 @@ var import_utils12 = __toESM(require_dist4(), 1);
46263
46263
  var import_utils13 = __toESM(require_dist4(), 1);
46264
46264
  var import_utils14 = __toESM(require_dist4(), 1);
46265
46265
  var import_utils15 = __toESM(require_dist4(), 1);
46266
+ var import_utils16 = __toESM(require_dist4(), 1);
46266
46267
  var __commonJS2 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
46267
46268
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
46268
46269
  var createRule;
@@ -47236,13 +47237,103 @@ var init_v4_import = __esm(() => {
47236
47237
  v4_import_default = rule;
47237
47238
  });
47238
47239
  var createRule14;
47240
+ var validNameRegex;
47241
+ var InvalidCompositionId = "Composition IDs can only contain a-z, A-Z, 0-9, CJK characters and -.";
47242
+ var InvalidFolderName = "Folder names can only contain a-z, A-Z, 0-9, CJK characters and -.";
47243
+ var getStringValue = (value) => {
47244
+ if (!value) {
47245
+ return null;
47246
+ }
47247
+ if (value.type === "Literal") {
47248
+ return typeof value.value === "string" ? value.value : null;
47249
+ }
47250
+ if (value.type !== "JSXExpressionContainer") {
47251
+ return null;
47252
+ }
47253
+ const { expression } = value;
47254
+ if (expression.type === "Literal") {
47255
+ return typeof expression.value === "string" ? expression.value : null;
47256
+ }
47257
+ if (expression.type === "TemplateLiteral" && expression.expressions.length === 0) {
47258
+ return expression.quasis[0].value.cooked;
47259
+ }
47260
+ return null;
47261
+ };
47262
+ var getJsxElementName = (node) => {
47263
+ if (node.type !== "JSXIdentifier") {
47264
+ return null;
47265
+ }
47266
+ return node.name;
47267
+ };
47268
+ var valid_composition_and_folder_name_default;
47269
+ var init_valid_composition_and_folder_name = __esm(() => {
47270
+ createRule14 = import_utils14.ESLintUtils.RuleCreator(() => {
47271
+ return `https://github.com/remotion-dev/remotion`;
47272
+ });
47273
+ validNameRegex = /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/;
47274
+ valid_composition_and_folder_name_default = createRule14({
47275
+ name: "valid-composition-and-folder-name",
47276
+ meta: {
47277
+ type: "problem",
47278
+ docs: {
47279
+ description: "Warns about invalid Remotion composition IDs and folder names.",
47280
+ recommended: "warn"
47281
+ },
47282
+ fixable: undefined,
47283
+ schema: [],
47284
+ messages: {
47285
+ InvalidCompositionId,
47286
+ InvalidFolderName
47287
+ }
47288
+ },
47289
+ defaultOptions: [],
47290
+ create: (context) => {
47291
+ return {
47292
+ JSXAttribute: (node) => {
47293
+ if (node.type !== "JSXAttribute") {
47294
+ return;
47295
+ }
47296
+ if (node.name.type !== "JSXIdentifier") {
47297
+ return;
47298
+ }
47299
+ const parent = node.parent;
47300
+ if (!parent || parent.type !== "JSXOpeningElement") {
47301
+ return;
47302
+ }
47303
+ const elementName = getJsxElementName(parent.name);
47304
+ if (elementName === null) {
47305
+ return;
47306
+ }
47307
+ const propName = node.name.name;
47308
+ const value = getStringValue(node.value);
47309
+ if (value === null || validNameRegex.test(value)) {
47310
+ return;
47311
+ }
47312
+ if ((elementName === "Composition" || elementName === "Still") && propName === "id") {
47313
+ context.report({
47314
+ messageId: "InvalidCompositionId",
47315
+ node
47316
+ });
47317
+ }
47318
+ if (elementName === "Folder" && propName === "name") {
47319
+ context.report({
47320
+ messageId: "InvalidFolderName",
47321
+ node
47322
+ });
47323
+ }
47324
+ }
47325
+ };
47326
+ }
47327
+ });
47328
+ });
47329
+ var createRule15;
47239
47330
  var VolumeCallback = "Prefer a callback function for setting the volume: `volume={(f) => interpolate(...)}`. See https://www.remotion.dev/docs/audio/volume";
47240
47331
  var volume_callback_default;
47241
47332
  var init_volume_callback = __esm(() => {
47242
- createRule14 = import_utils14.ESLintUtils.RuleCreator(() => {
47333
+ createRule15 = import_utils15.ESLintUtils.RuleCreator(() => {
47243
47334
  return `https://github.com/remotion-dev/remotion`;
47244
47335
  });
47245
- volume_callback_default = createRule14({
47336
+ volume_callback_default = createRule15({
47246
47337
  name: "volume-callback",
47247
47338
  meta: {
47248
47339
  type: "problem",
@@ -47309,17 +47400,17 @@ var init_volume_callback = __esm(() => {
47309
47400
  }
47310
47401
  });
47311
47402
  });
47312
- var createRule15;
47403
+ var createRule16;
47313
47404
  var NoNativeImgTag = "Prefer the <Img /> tag from 'remotion' package, because it will wait until the image is loaded when you are rendering your video.";
47314
47405
  var NoNativeIFrameTag = "Prefer the <IFrame /> tag from 'remotion' package, because it will wait until the iframe is loaded when you are rendering your video.";
47315
47406
  var NoNativeAudioTag = "Use the <Audio /> tag from '@remotion/media' package, because it will synchronize with the Remotion timeline.";
47316
47407
  var NoNativeVideoTag = "Use the <Video /> tag from '@remotion/media' package, because it will synchronize with the Remotion timeline.";
47317
47408
  var warn_native_media_tag_default;
47318
47409
  var init_warn_native_media_tag = __esm(() => {
47319
- createRule15 = import_utils15.ESLintUtils.RuleCreator(() => {
47410
+ createRule16 = import_utils16.ESLintUtils.RuleCreator(() => {
47320
47411
  return `https://github.com/remotion-dev/remotion`;
47321
47412
  });
47322
- warn_native_media_tag_default = createRule15({
47413
+ warn_native_media_tag_default = createRule16({
47323
47414
  name: "warn-native-media-tag",
47324
47415
  meta: {
47325
47416
  type: "problem",
@@ -47421,6 +47512,7 @@ var require_src2 = __commonJS2((exports, module) => {
47421
47512
  init_staticfile_no_remote();
47422
47513
  init_use_gif_component();
47423
47514
  init_v4_import();
47515
+ init_valid_composition_and_folder_name();
47424
47516
  init_volume_callback();
47425
47517
  init_warn_native_media_tag();
47426
47518
  var rules = {
@@ -47438,7 +47530,8 @@ var require_src2 = __commonJS2((exports, module) => {
47438
47530
  "non-pure-animation": non_pure_animation_default,
47439
47531
  "slow-css-property": slow_css_property_default,
47440
47532
  "v4-config-import": v4_import_default,
47441
- "no-object-fit-on-media-video": no_object_fit_on_media_video_default
47533
+ "no-object-fit-on-media-video": no_object_fit_on_media_video_default,
47534
+ "valid-composition-and-folder-name": valid_composition_and_folder_name_default
47442
47535
  };
47443
47536
  var recommendedRuleConfig = {
47444
47537
  "@remotion/warn-native-media-tag": "error",
@@ -47454,7 +47547,8 @@ var require_src2 = __commonJS2((exports, module) => {
47454
47547
  "@remotion/no-background-image": "error",
47455
47548
  "@remotion/non-pure-animation": "warn",
47456
47549
  "@remotion/v4-config-import": "error",
47457
- "@remotion/no-object-fit-on-media-video": "warn"
47550
+ "@remotion/no-object-fit-on-media-video": "warn",
47551
+ "@remotion/valid-composition-and-folder-name": "error"
47458
47552
  };
47459
47553
  var configs = {
47460
47554
  recommended: {
@@ -47523,7 +47617,10 @@ var makeConfig = ({
47523
47617
  plugins: {
47524
47618
  "@remotion": esm_default
47525
47619
  },
47526
- rules: esm_default.configs.recommended.rules,
47620
+ rules: {
47621
+ ...esm_default.configs.recommended.rules,
47622
+ "@remotion/valid-composition-and-folder-name": "error"
47623
+ },
47527
47624
  ...remotionDir ? { files: [remotionDir] } : {}
47528
47625
  });
47529
47626
  var config = makeConfig({
package/dist/index.js CHANGED
@@ -48,7 +48,10 @@ export const makeConfig = ({ remotionDir, }) => tseslint.config({
48
48
  plugins: {
49
49
  '@remotion': remotionPlugin,
50
50
  },
51
- rules: remotionPlugin.configs.recommended.rules,
51
+ rules: {
52
+ ...remotionPlugin.configs.recommended.rules,
53
+ '@remotion/valid-composition-and-folder-name': 'error',
54
+ },
52
55
  ...(remotionDir ? { files: [remotionDir] } : {}),
53
56
  });
54
57
  export const config = makeConfig({
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/eslint-config-flat"
4
4
  },
5
5
  "name": "@remotion/eslint-config-flat",
6
- "version": "4.0.484",
6
+ "version": "4.0.485",
7
7
  "description": "Default configuration for Remotion templates (ESLint >= 9)",
8
8
  "main": "dist/esm/index.mjs",
9
9
  "type": "module",
@@ -28,11 +28,11 @@
28
28
  "eslint": ">=9"
29
29
  },
30
30
  "devDependencies": {
31
- "@remotion/eslint-plugin": "4.0.484",
31
+ "@remotion/eslint-plugin": "4.0.485",
32
32
  "@eslint/js": "9.19.0",
33
33
  "eslint-plugin-react": "7.37.4",
34
34
  "eslint-plugin-react-hooks": "5.2.0",
35
- "@remotion/eslint-config-internal": "4.0.484",
35
+ "@remotion/eslint-config-internal": "4.0.485",
36
36
  "eslint": "9.19.0",
37
37
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
38
38
  },