@remotion/eslint-plugin 3.2.35-crf.3 → 3.2.36
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/LICENSE.md +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/rules/no-from-0.d.ts +2 -0
- package/dist/rules/no-from-0.js +70 -0
- package/package.json +2 -2
package/LICENSE.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ declare const _default: {
|
|
|
6
6
|
"no-string-assets": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"NoStringAssets", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
|
|
7
7
|
"even-dimensions": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"EvenDimensions", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
|
|
8
8
|
"duration-in-frames": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"DurationInFrames", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
|
|
9
|
+
"from-0": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"From0", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
|
|
9
10
|
"volume-callback": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"VolumeCallback", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
|
|
10
11
|
"use-gif-component": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"UseGifComponent", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
|
|
11
12
|
"staticfile-no-relative": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"RelativePathStaticFile", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
|
|
@@ -20,6 +21,7 @@ declare const _default: {
|
|
|
20
21
|
"@remotion/no-string-assets": string;
|
|
21
22
|
"@remotion/even-dimensions": string;
|
|
22
23
|
"@remotion/duration-in-frames": string;
|
|
24
|
+
"@remotion/from-0": string;
|
|
23
25
|
"@remotion/volume-callback": string;
|
|
24
26
|
"@remotion/use-gif-component": string;
|
|
25
27
|
"@remotion/staticfile-no-relative": string;
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
const deterministic_randomness_1 = __importDefault(require("./rules/deterministic-randomness"));
|
|
6
6
|
const even_dimensions_1 = __importDefault(require("./rules/even-dimensions"));
|
|
7
7
|
const no_duration_frames_infinity_1 = __importDefault(require("./rules/no-duration-frames-infinity"));
|
|
8
|
+
const no_from_0_1 = __importDefault(require("./rules/no-from-0"));
|
|
8
9
|
const no_mp4_import_1 = __importDefault(require("./rules/no-mp4-import"));
|
|
9
10
|
const no_string_assets_1 = __importDefault(require("./rules/no-string-assets"));
|
|
10
11
|
const staticfile_no_relative_1 = __importDefault(require("./rules/staticfile-no-relative"));
|
|
@@ -19,6 +20,7 @@ const rules = {
|
|
|
19
20
|
"no-string-assets": no_string_assets_1.default,
|
|
20
21
|
"even-dimensions": even_dimensions_1.default,
|
|
21
22
|
"duration-in-frames": no_duration_frames_infinity_1.default,
|
|
23
|
+
"from-0": no_from_0_1.default,
|
|
22
24
|
"volume-callback": volume_callback_1.default,
|
|
23
25
|
"use-gif-component": use_gif_component_1.default,
|
|
24
26
|
"staticfile-no-relative": staticfile_no_relative_1.default,
|
|
@@ -35,6 +37,7 @@ module.exports = {
|
|
|
35
37
|
"@remotion/no-string-assets": "error",
|
|
36
38
|
"@remotion/even-dimensions": "error",
|
|
37
39
|
"@remotion/duration-in-frames": "error",
|
|
40
|
+
"@remotion/from-0": "error",
|
|
38
41
|
"@remotion/volume-callback": "error",
|
|
39
42
|
"@remotion/use-gif-component": "error",
|
|
40
43
|
"@remotion/staticfile-no-relative": "error",
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("@typescript-eslint/utils");
|
|
4
|
+
const createRule = utils_1.ESLintUtils.RuleCreator(() => {
|
|
5
|
+
return `https://github.com/remotion-dev/remotion`;
|
|
6
|
+
});
|
|
7
|
+
const From0 = "0 is now the default, so you can remove the prop.";
|
|
8
|
+
exports.default = createRule({
|
|
9
|
+
name: "from",
|
|
10
|
+
meta: {
|
|
11
|
+
type: "problem",
|
|
12
|
+
docs: {
|
|
13
|
+
description: From0,
|
|
14
|
+
recommended: "warn",
|
|
15
|
+
},
|
|
16
|
+
fixable: "code",
|
|
17
|
+
schema: [],
|
|
18
|
+
messages: {
|
|
19
|
+
From0,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultOptions: [],
|
|
23
|
+
create: (context) => {
|
|
24
|
+
return {
|
|
25
|
+
JSXAttribute: (node) => {
|
|
26
|
+
if (node.type !== "JSXAttribute") {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (node.name.name !== "from") {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const value = node.value;
|
|
33
|
+
if (!value || value.type !== "JSXExpressionContainer") {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const expression = value.expression;
|
|
37
|
+
if (!expression || expression.type !== "Literal") {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const stringValue = expression.value;
|
|
41
|
+
if (stringValue !== 0) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const parent = node.parent;
|
|
45
|
+
if (!parent) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (parent.type !== "JSXOpeningElement") {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const name = parent.name;
|
|
52
|
+
if (name.type !== "JSXIdentifier") {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (name.name !== "Sequence") {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (stringValue === 0) {
|
|
59
|
+
context.report({
|
|
60
|
+
messageId: "From0",
|
|
61
|
+
node,
|
|
62
|
+
fix: (fixer) => {
|
|
63
|
+
return fixer.removeRange([node.name.range[0], value.range[1]]);
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/eslint-plugin",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.36",
|
|
4
4
|
"description": "A set of rules helping you avoid common pitfalls in Remotion.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc -d",
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"vitest": "0.24.3"
|
|
23
23
|
},
|
|
24
24
|
"private": false,
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "69d6e23f17b14509aee4d327b3481fd4e15df4a4"
|
|
26
26
|
}
|