@remotion/eslint-plugin 2.4.0-alpha.d3efed28 → 2.4.2

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
@@ -5,6 +5,7 @@ declare const _default: {
5
5
  "deterministic-randomness": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"DeterministicRandomness", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
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
+ "duration-in-frames": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"DurationInFrames", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
8
9
  };
9
10
  };
10
11
  export = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;AAcA,kBAEE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;AAgBA,kBAEE"}
package/dist/index.js CHANGED
@@ -7,12 +7,14 @@ const even_dimensions_1 = __importDefault(require("./rules/even-dimensions"));
7
7
  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
+ const no_duration_frames_infinity_1 = __importDefault(require("./rules/no-duration-frames-infinity"));
10
11
  const rules = {
11
12
  "no-mp4-import": no_mp4_import_1.default,
12
13
  "warn-native-media-tag": warn_native_media_tag_1.default,
13
14
  "deterministic-randomness": deterministic_randomness_1.default,
14
15
  "no-string-assets": no_string_assets_1.default,
15
16
  "even-dimensions": even_dimensions_1.default,
17
+ "duration-in-frames": no_duration_frames_infinity_1.default
16
18
  };
17
19
  module.exports = {
18
20
  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;AAE/D,MAAM,KAAK,GAAG;IACZ,eAAe,EAAE,uBAAW;IAC5B,uBAAuB,EAAE,+BAAkB;IAC3C,0BAA0B,EAAE,kCAAuB;IACnD,kBAAkB,EAAE,0BAAc;IAClC,iBAAiB,EAAE,yBAAc;CAClC,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;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"}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"DurationInFrames", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
2
+ export default _default;
3
+ //# sourceMappingURL=no-duration-frames-infinity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-duration-frames-infinity.d.ts","sourceRoot":"","sources":["../../src/rules/no-duration-frames-infinity.ts"],"names":[],"mappings":";AAaA,wBAqEG"}
@@ -0,0 +1,72 @@
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 DurationInFrames = "Infinity is now the default, so you can remove the prop.";
8
+ exports.default = createRule({
9
+ name: "duration-in-frames",
10
+ meta: {
11
+ type: "problem",
12
+ docs: {
13
+ description: DurationInFrames,
14
+ category: "Best Practices",
15
+ recommended: "warn",
16
+ },
17
+ fixable: "code",
18
+ schema: [],
19
+ messages: {
20
+ DurationInFrames,
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 !== "durationInFrames") {
31
+ return;
32
+ }
33
+ const value = node.value;
34
+ if (!value || value.type !== "JSXExpressionContainer") {
35
+ return;
36
+ }
37
+ const expression = value.expression;
38
+ if (!expression || expression.type !== "Identifier") {
39
+ return;
40
+ }
41
+ const stringValue = expression.name;
42
+ if (typeof stringValue !== "string") {
43
+ return;
44
+ }
45
+ const parent = node.parent;
46
+ if (!parent) {
47
+ return;
48
+ }
49
+ if (parent.type !== "JSXOpeningElement") {
50
+ return;
51
+ }
52
+ const name = parent.name;
53
+ if (name.type !== "JSXIdentifier") {
54
+ return;
55
+ }
56
+ if (name.name !== "Sequence") {
57
+ return;
58
+ }
59
+ if (stringValue === "Infinity") {
60
+ context.report({
61
+ messageId: "DurationInFrames",
62
+ node,
63
+ fix: (fixer) => {
64
+ return fixer.removeRange([node.name.range[0], value.range[1]]);
65
+ },
66
+ });
67
+ }
68
+ },
69
+ };
70
+ },
71
+ });
72
+ //# sourceMappingURL=no-duration-frames-infinity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-duration-frames-infinity.js","sourceRoot":"","sources":["../../src/rules/no-duration-frames-infinity.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,gBAAgB,GACpB,0DAA0D,CAAC;AAE7D,kBAAe,UAAU,CAAsB;IAC7C,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,gBAAgB;YAC7B,QAAQ,EAAE,gBAAgB;YAC1B,WAAW,EAAE,MAAM;SACpB;QACD,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,gBAAgB;SACjB;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;gBAED,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,kBAAkB,EAAE;oBACzC,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,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;gBACpC,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,KAAK,YAAY,EAAE;oBACnD,OAAO;iBACR;gBAED,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC;gBACpC,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;oBACnC,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;gBAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;gBACzB,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,EAAE;oBACjC,OAAO;iBACR;gBACD,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE;oBAC5B,OAAO;iBACR;gBACD,IAAI,WAAW,KAAK,UAAU,EAAE;oBAC9B,OAAO,CAAC,MAAM,CAAC;wBACb,SAAS,EAAE,kBAAkB;wBAC7B,IAAI;wBACJ,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE;4BACb,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wBACjE,CAAC;qBACF,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@remotion/eslint-plugin",
3
- "version": "2.4.0-alpha.d3efed28",
3
+ "version": "2.4.2",
4
4
  "description": "A set of rules helping you avoid common pitfalls in Remotion.",
5
5
  "scripts": {
6
6
  "build": "tsc -d",
7
- "test": "jest"
7
+ "test": "jest",
8
+ "watch": "tsc -w"
8
9
  },
9
10
  "main": "dist/index.js",
10
11
  "bugs": {