@remotion/eslint-plugin 3.0.0-lambda.18 → 3.0.0-lambda.196

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.
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ declare const _default: {
6
6
  "no-string-assets": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"NoStringAssets", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
7
7
  "even-dimensions": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"EvenDimensions", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
8
8
  "duration-in-frames": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"DurationInFrames", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
9
+ "volume-callback": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"VolumeCallback", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
9
10
  };
10
11
  };
11
12
  export = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;AAgBA,kBAEE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAkBA,kBAEE"}
package/dist/index.js CHANGED
@@ -8,13 +8,15 @@ const no_mp4_import_1 = __importDefault(require("./rules/no-mp4-import"));
8
8
  const no_string_assets_1 = __importDefault(require("./rules/no-string-assets"));
9
9
  const warn_native_media_tag_1 = __importDefault(require("./rules/warn-native-media-tag"));
10
10
  const no_duration_frames_infinity_1 = __importDefault(require("./rules/no-duration-frames-infinity"));
11
+ const volume_callback_1 = __importDefault(require("./rules/volume-callback"));
11
12
  const rules = {
12
13
  "no-mp4-import": no_mp4_import_1.default,
13
14
  "warn-native-media-tag": warn_native_media_tag_1.default,
14
15
  "deterministic-randomness": deterministic_randomness_1.default,
15
16
  "no-string-assets": no_string_assets_1.default,
16
17
  "even-dimensions": even_dimensions_1.default,
17
- "duration-in-frames": no_duration_frames_infinity_1.default
18
+ "duration-in-frames": no_duration_frames_infinity_1.default,
19
+ "volume-callback": volume_callback_1.default,
18
20
  };
19
21
  module.exports = {
20
22
  rules,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,gGAAuE;AACvE,8EAAqD;AACrD,0EAAgD;AAChD,gFAAsD;AACtD,0FAA+D;AAC/D,sGAAmE;AAEnE,MAAM,KAAK,GAAG;IACZ,eAAe,EAAE,uBAAW;IAC5B,uBAAuB,EAAE,+BAAkB;IAC3C,0BAA0B,EAAE,kCAAuB;IACnD,kBAAkB,EAAE,0BAAc;IAClC,iBAAiB,EAAE,yBAAc;IACjC,oBAAoB,EAAE,qCAAgB;CACvC,CAAC;AAEF,iBAAS;IACP,KAAK;CACN,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,gGAAuE;AACvE,8EAAqD;AACrD,0EAAgD;AAChD,gFAAsD;AACtD,0FAA+D;AAC/D,sGAAmE;AACnE,8EAAqD;AAErD,MAAM,KAAK,GAAG;IACZ,eAAe,EAAE,uBAAW;IAC5B,uBAAuB,EAAE,+BAAkB;IAC3C,0BAA0B,EAAE,kCAAuB;IACnD,kBAAkB,EAAE,0BAAc;IAClC,iBAAiB,EAAE,yBAAc;IACjC,oBAAoB,EAAE,qCAAgB;IACtC,iBAAiB,EAAE,yBAAc;CAClC,CAAC;AAEF,iBAAS;IACP,KAAK;CACN,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"VolumeCallback", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
2
+ export default _default;
3
+ //# sourceMappingURL=volume-callback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"volume-callback.d.ts","sourceRoot":"","sources":["../../src/rules/volume-callback.ts"],"names":[],"mappings":";AAaA,wBAiEG"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
4
+ const createRule = experimental_utils_1.ESLintUtils.RuleCreator((name) => {
5
+ return `https://github.com/remotion-dev/remotion`;
6
+ });
7
+ const VolumeCallback = "Prefer a callback function for setting the volume: `volume={(f) => interpolate(...)}`. See https://www.remotion.dev/docs/using-audio/#controlling-volume";
8
+ exports.default = createRule({
9
+ name: "volume-callback",
10
+ meta: {
11
+ type: "problem",
12
+ docs: {
13
+ description: VolumeCallback,
14
+ category: "Possible Errors",
15
+ recommended: "warn",
16
+ },
17
+ fixable: undefined,
18
+ schema: [],
19
+ messages: {
20
+ VolumeCallback,
21
+ },
22
+ },
23
+ defaultOptions: [],
24
+ create: (context) => {
25
+ return {
26
+ JSXAttribute: (node) => {
27
+ if (node.type !== "JSXAttribute") {
28
+ return;
29
+ }
30
+ if (node.name.name !== "volume") {
31
+ return;
32
+ }
33
+ const value = node.value;
34
+ if (!value || value.type !== "JSXExpressionContainer") {
35
+ return;
36
+ }
37
+ const parent = node.parent;
38
+ if (!parent) {
39
+ return;
40
+ }
41
+ if (parent.type !== "JSXOpeningElement") {
42
+ return;
43
+ }
44
+ const name = parent.name;
45
+ if (name.type !== "JSXIdentifier") {
46
+ return;
47
+ }
48
+ if (name.name !== "Video" && name.name !== "Audio") {
49
+ return;
50
+ }
51
+ const expression = value.expression;
52
+ if (!expression) {
53
+ return;
54
+ }
55
+ if (expression.type === "Literal") {
56
+ return;
57
+ }
58
+ if (expression.type === "ArrowFunctionExpression") {
59
+ return;
60
+ }
61
+ context.report({
62
+ messageId: "VolumeCallback",
63
+ node,
64
+ });
65
+ },
66
+ };
67
+ },
68
+ });
69
+ //# sourceMappingURL=volume-callback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"volume-callback.js","sourceRoot":"","sources":["../../src/rules/volume-callback.ts"],"names":[],"mappings":";;AAAA,8EAAoE;AAEpE,MAAM,UAAU,GAAG,gCAAW,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE;IAClD,OAAO,0CAA0C,CAAC;AACpD,CAAC,CAAC,CAAC;AAMH,MAAM,cAAc,GAClB,0JAA0J,CAAC;AAE7J,kBAAe,UAAU,CAAsB;IAC7C,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,iBAAiB;YAC3B,WAAW,EAAE,MAAM;SACpB;QACD,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,cAAc;SACf;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;QAClB,OAAO;YACL,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE;gBACrB,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,EAAE;oBAChC,OAAO;iBACR;gBACD,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;oBAC/B,OAAO;iBACR;gBACD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;gBACzB,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,wBAAwB,EAAE;oBACrD,OAAO;iBACR;gBAED,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;gBAC3B,IAAI,CAAC,MAAM,EAAE;oBACX,OAAO;iBACR;gBAED,IAAI,MAAM,CAAC,IAAI,KAAK,mBAAmB,EAAE;oBACvC,OAAO;iBACR;gBACD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;gBACzB,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,EAAE;oBACjC,OAAO;iBACR;gBACD,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE;oBAClD,OAAO;iBACR;gBAED,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;gBACpC,IAAI,CAAC,UAAU,EAAE;oBACf,OAAO;iBACR;gBAED,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE;oBACjC,OAAO;iBACR;gBACD,IAAI,UAAU,CAAC,IAAI,KAAK,yBAAyB,EAAE;oBACjD,OAAO;iBACR;gBAED,OAAO,CAAC,MAAM,CAAC;oBACb,SAAS,EAAE,gBAAgB;oBAC3B,IAAI;iBACL,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/eslint-plugin",
3
- "version": "3.0.0-lambda.18+a6804ce2f",
3
+ "version": "3.0.0-lambda.196+d4d99a5b8",
4
4
  "description": "A set of rules helping you avoid common pitfalls in Remotion.",
5
5
  "scripts": {
6
6
  "build": "tsc -d",
@@ -21,5 +21,5 @@
21
21
  "typescript": "^4.1.3"
22
22
  },
23
23
  "private": false,
24
- "gitHead": "a6804ce2f4f0982d1f516d4a0ca20951b91e9dd7"
24
+ "gitHead": "d4d99a5b8c63723a3f0d18776ed8c9d3805e09e3"
25
25
  }