@remotion/eslint-plugin 4.0.0-webhook.27 → 4.1.0-alpha1

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 CHANGED
@@ -1,34 +1,34 @@
1
1
  # Remotion License
2
2
 
3
- Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion create videos for free (even commercial), while a company license is required for for-profit organisations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
3
+ Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion to create videos for free (even commercial), while a company license is required for for-profit organizations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
4
4
 
5
5
  - [Free license](#free-license)
6
6
  - [Company license](#company-license)
7
7
 
8
8
  ## Free license
9
9
 
10
- Copyright © 2022 [Jonny Burger](https://jonny.io)
10
+ Copyright © 2023 [Remotion](https://www.remotion.dev/)
11
11
 
12
12
  ### Eligibility
13
13
 
14
14
  You are eligible to use Remotion for free if you are:
15
15
 
16
16
  - an individual
17
- - a for-profit organisation with up to 3 employees
18
- - a non-profit or not-for-profit organisation
17
+ - a for-profit organization with up to 3 employees
18
+ - a non-profit or not-for-profit organization
19
19
  - evaluating whether Remotion is a good fit, and are not yet using it in a commercial way
20
20
 
21
21
  ### Allowed use cases
22
22
 
23
- Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify and the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
23
+ Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
24
24
 
25
25
  ### Disallowed use cases
26
26
 
27
- It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, sublicensing your own derivate of Remotion.
27
+ It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, or sublicensing your own derivate of Remotion.
28
28
 
29
29
  ### Warranty notice
30
30
 
31
- The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
31
+ The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
32
32
 
33
33
  ### Support
34
34
 
@@ -36,6 +36,6 @@ Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
36
36
 
37
37
  ## Company license
38
38
 
39
- You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support.
39
+ You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support (read the [Support Policy](/docs/support)).
40
40
 
41
41
  Visit [companies.remotion.dev](https://companies.remotion.dev) for pricing and to buy a license.
package/dist/index.d.ts CHANGED
@@ -6,10 +6,13 @@ 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
- "staticfile-no-relative": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"RelativePathStaticFile", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
12
+ "staticfile-no-relative": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"RelativePathStaticFile" | "AbsoluteStaticFile" | "PublicStaticFile", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
12
13
  "staticfile-no-remote": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"RelativePathStaticFile", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
14
+ "no-background-image": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"BackgroundImage", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
15
+ "v4-config-import": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"ImportConfig", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
13
16
  };
14
17
  configs: {
15
18
  recommended: {
@@ -20,10 +23,13 @@ declare const _default: {
20
23
  "@remotion/no-string-assets": string;
21
24
  "@remotion/even-dimensions": string;
22
25
  "@remotion/duration-in-frames": string;
26
+ "@remotion/from-0": string;
23
27
  "@remotion/volume-callback": string;
24
28
  "@remotion/use-gif-component": string;
25
29
  "@remotion/staticfile-no-relative": string;
26
30
  "@remotion/staticfile-no-remote": string;
31
+ "@remotion/no-background-image": string;
32
+ "@remotion/v4-config-import": string;
27
33
  };
28
34
  };
29
35
  };
package/dist/index.js CHANGED
@@ -4,7 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  const deterministic_randomness_1 = __importDefault(require("./rules/deterministic-randomness"));
6
6
  const even_dimensions_1 = __importDefault(require("./rules/even-dimensions"));
7
+ const no_background_image_1 = __importDefault(require("./rules/no-background-image"));
7
8
  const no_duration_frames_infinity_1 = __importDefault(require("./rules/no-duration-frames-infinity"));
9
+ const no_from_0_1 = __importDefault(require("./rules/no-from-0"));
8
10
  const no_mp4_import_1 = __importDefault(require("./rules/no-mp4-import"));
9
11
  const no_string_assets_1 = __importDefault(require("./rules/no-string-assets"));
10
12
  const staticfile_no_relative_1 = __importDefault(require("./rules/staticfile-no-relative"));
@@ -12,6 +14,7 @@ const staticfile_no_remote_1 = __importDefault(require("./rules/staticfile-no-re
12
14
  const use_gif_component_1 = __importDefault(require("./rules/use-gif-component"));
13
15
  const volume_callback_1 = __importDefault(require("./rules/volume-callback"));
14
16
  const warn_native_media_tag_1 = __importDefault(require("./rules/warn-native-media-tag"));
17
+ const v4_import_1 = __importDefault(require("./rules/v4-import"));
15
18
  const rules = {
16
19
  "no-mp4-import": no_mp4_import_1.default,
17
20
  "warn-native-media-tag": warn_native_media_tag_1.default,
@@ -19,10 +22,13 @@ const rules = {
19
22
  "no-string-assets": no_string_assets_1.default,
20
23
  "even-dimensions": even_dimensions_1.default,
21
24
  "duration-in-frames": no_duration_frames_infinity_1.default,
25
+ "from-0": no_from_0_1.default,
22
26
  "volume-callback": volume_callback_1.default,
23
27
  "use-gif-component": use_gif_component_1.default,
24
28
  "staticfile-no-relative": staticfile_no_relative_1.default,
25
29
  "staticfile-no-remote": staticfile_no_remote_1.default,
30
+ "no-background-image": no_background_image_1.default,
31
+ "v4-config-import": v4_import_1.default,
26
32
  };
27
33
  module.exports = {
28
34
  rules,
@@ -35,10 +41,13 @@ module.exports = {
35
41
  "@remotion/no-string-assets": "error",
36
42
  "@remotion/even-dimensions": "error",
37
43
  "@remotion/duration-in-frames": "error",
44
+ "@remotion/from-0": "error",
38
45
  "@remotion/volume-callback": "error",
39
46
  "@remotion/use-gif-component": "error",
40
47
  "@remotion/staticfile-no-relative": "error",
41
48
  "@remotion/staticfile-no-remote": "error",
49
+ "@remotion/no-background-image": "error",
50
+ "@remotion/v4-config-import": "error",
42
51
  },
43
52
  },
44
53
  },
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"BackgroundImage", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
2
+ export default _default;
@@ -0,0 +1,60 @@
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://remotion.dev/docs/troubleshooting/background-image";
6
+ });
7
+ const BackgroundImage = [
8
+ "Don't use background-image in Remotion.",
9
+ "See: https://remotion.dev/docs/troubleshooting/background-image",
10
+ ].join("\n");
11
+ exports.default = createRule({
12
+ name: "no-background-image",
13
+ meta: {
14
+ type: "problem",
15
+ docs: {
16
+ description: BackgroundImage,
17
+ recommended: "error",
18
+ },
19
+ fixable: undefined,
20
+ schema: [],
21
+ messages: {
22
+ BackgroundImage: BackgroundImage,
23
+ },
24
+ },
25
+ defaultOptions: [],
26
+ create: (context) => {
27
+ return {
28
+ Property: (node) => {
29
+ if (node.key.type !== "Identifier") {
30
+ return;
31
+ }
32
+ if (node.key.name !== "backgroundImage") {
33
+ return;
34
+ }
35
+ if (node.value.type === "Literal") {
36
+ const { value } = node.value;
37
+ if (typeof value === "string" && value.includes("url(")) {
38
+ context.report({
39
+ messageId: "BackgroundImage",
40
+ node,
41
+ });
42
+ }
43
+ }
44
+ if (node.value.type === "TemplateLiteral") {
45
+ for (const element of node.value.quasis) {
46
+ if (element.type !== "TemplateElement") {
47
+ continue;
48
+ }
49
+ if (element.value.raw.includes("url(")) {
50
+ context.report({
51
+ messageId: "BackgroundImage",
52
+ node,
53
+ });
54
+ }
55
+ }
56
+ }
57
+ },
58
+ };
59
+ },
60
+ });
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"From0", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
2
+ export default _default;
@@ -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
+ });
File without changes
File without changes
File without changes
File without changes
@@ -1,2 +1,3 @@
1
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"RelativePathStaticFile", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
1
+ type MessageIds = "RelativePathStaticFile" | "AbsoluteStaticFile" | "PublicStaticFile";
2
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<MessageIds, [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
2
3
  export default _default;
@@ -8,6 +8,14 @@ const RelativePathStaticFile = [
8
8
  "Don't pass a relative path to staticFile().",
9
9
  "See: https://remotion.dev/docs/staticfile-relative-paths",
10
10
  ].join("\n");
11
+ const AbsoluteStaticFile = [
12
+ "Do not pass an absolute path to staticFile().",
13
+ "See: https://remotion.dev/docs/staticfile-relative-paths",
14
+ ].join("");
15
+ const PublicStaticFile = [
16
+ "Do not prefix your assets with public/.",
17
+ "See: https://remotion.dev/docs/staticfile-relative-paths",
18
+ ].join("");
11
19
  exports.default = createRule({
12
20
  name: "staticfile-no-relative",
13
21
  meta: {
@@ -20,6 +28,8 @@ exports.default = createRule({
20
28
  schema: [],
21
29
  messages: {
22
30
  RelativePathStaticFile: RelativePathStaticFile,
31
+ PublicStaticFile: PublicStaticFile,
32
+ AbsoluteStaticFile: AbsoluteStaticFile,
23
33
  },
24
34
  },
25
35
  defaultOptions: [],
@@ -56,6 +66,26 @@ exports.default = createRule({
56
66
  node,
57
67
  });
58
68
  }
69
+ if (value.startsWith("public/")) {
70
+ context.report({
71
+ messageId: "PublicStaticFile",
72
+ node,
73
+ });
74
+ }
75
+ if (value.startsWith("/Users") ||
76
+ value.startsWith("/home") ||
77
+ value.startsWith("/tmp") ||
78
+ value.startsWith("/etc") ||
79
+ value.startsWith("/opt") ||
80
+ value.startsWith("/var") ||
81
+ value.startsWith("C:") ||
82
+ value.startsWith("D:") ||
83
+ value.startsWith("E:")) {
84
+ context.report({
85
+ messageId: "AbsoluteStaticFile",
86
+ node,
87
+ });
88
+ }
59
89
  }
60
90
  }
61
91
  },
File without changes
File without changes
File without changes
@@ -33,6 +33,20 @@ exports.default = createRule({
33
33
  if (node.name.name !== "src") {
34
34
  return;
35
35
  }
36
+ const parent = node.parent;
37
+ if (!parent) {
38
+ return;
39
+ }
40
+ if (parent.type !== "JSXOpeningElement") {
41
+ return;
42
+ }
43
+ const name = parent.name;
44
+ if (name.type !== "JSXIdentifier") {
45
+ return;
46
+ }
47
+ if (name.name !== "Img" && name.name !== "img") {
48
+ return;
49
+ }
36
50
  const value = node.value;
37
51
  // src={"some string"}
38
52
  if (!value) {
@@ -47,25 +61,12 @@ exports.default = createRule({
47
61
  : null;
48
62
  // src="image.gif"
49
63
  if (typeof stringValue === "string") {
50
- const parent = node.parent;
51
- if (!parent) {
52
- return;
53
- }
54
- if (parent.type !== "JSXOpeningElement") {
55
- return;
56
- }
57
- const name = parent.name;
58
- if (name.type !== "JSXIdentifier") {
59
- return;
60
- }
61
- if (name.name === "Img" || name.name === "img") {
62
- // Network and inline URLs are okay
63
- if (stringValue.includes(".gif")) {
64
- context.report({
65
- messageId: "UseGifComponent",
66
- node,
67
- });
68
- }
64
+ // Network and inline URLs are okay
65
+ if (stringValue.includes(".gif")) {
66
+ context.report({
67
+ messageId: "UseGifComponent",
68
+ node,
69
+ });
69
70
  }
70
71
  }
71
72
  if (value.type === "JSXExpressionContainer" &&
@@ -0,0 +1,2 @@
1
+ declare const rule: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"ImportConfig", [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
2
+ export default rule;
@@ -0,0 +1,40 @@
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://v4.remotion.dev/docs/4-0-migration`;
6
+ });
7
+ const ImportConfig = "Update the import to the new V4 location: import {Config} from '@remotion/cli/config'";
8
+ const rule = createRule({
9
+ name: "v4-config-import",
10
+ meta: {
11
+ type: "problem",
12
+ docs: {
13
+ description: ImportConfig,
14
+ recommended: "warn",
15
+ },
16
+ fixable: undefined,
17
+ schema: [],
18
+ messages: {
19
+ ImportConfig,
20
+ },
21
+ },
22
+ defaultOptions: [],
23
+ create: (context) => {
24
+ return {
25
+ ImportDeclaration: (node) => {
26
+ if (node.source.value !== "remotion") {
27
+ return;
28
+ }
29
+ const config = node.specifiers.find((s) => s.type === "ImportSpecifier" && s.imported.name === "Config");
30
+ if (config) {
31
+ context.report({
32
+ messageId: "ImportConfig",
33
+ node,
34
+ });
35
+ }
36
+ },
37
+ };
38
+ },
39
+ });
40
+ exports.default = rule;
File without changes
File without changes
@@ -1,3 +1,3 @@
1
- declare type MessageIds = "NoNativeImgTag" | "NoNativeIFrameTag" | "NoNativeAudioTag" | "NoNativeVideoTag";
1
+ type MessageIds = "NoNativeImgTag" | "NoNativeIFrameTag" | "NoNativeAudioTag" | "NoNativeVideoTag";
2
2
  declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<MessageIds, [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
3
3
  export default _default;
File without changes
package/package.json CHANGED
@@ -1,12 +1,7 @@
1
1
  {
2
2
  "name": "@remotion/eslint-plugin",
3
- "version": "4.0.0-webhook.27+eb81308ee",
3
+ "version": "4.1.0-alpha1",
4
4
  "description": "A set of rules helping you avoid common pitfalls in Remotion.",
5
- "scripts": {
6
- "build": "tsc -d",
7
- "test": "jest",
8
- "watch": "tsc -w"
9
- },
10
5
  "main": "dist/index.js",
11
6
  "bugs": {
12
7
  "url": "https://github.com/remotion-dev/remotion/issues"
@@ -16,12 +11,22 @@
16
11
  "dependencies": {
17
12
  "@typescript-eslint/utils": "5.19.0"
18
13
  },
14
+ "keywords": [
15
+ "eslint",
16
+ "eslintplugin"
17
+ ],
18
+ "peerDependencies": {
19
+ "eslint": ">=7.0.0"
20
+ },
19
21
  "devDependencies": {
20
- "eslint": "8.13.0",
21
- "jest": "^27.2.4",
22
- "ts-jest": "^27.0.5",
23
- "typescript": "^4.7.0"
22
+ "eslint": "8.42.0",
23
+ "typescript": "4.9.5",
24
+ "vitest": "0.31.1"
24
25
  },
25
26
  "private": false,
26
- "gitHead": "eb81308ee07a402f4a8dd9ff24306bb07dd78175"
27
- }
27
+ "scripts": {
28
+ "build": "tsc -d",
29
+ "test": "vitest --run",
30
+ "watch": "tsc -w"
31
+ }
32
+ }
package/tsconfig.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../tsconfig.settings.json",
3
- "compilerOptions": {
4
- "rootDir": "./src",
5
- "outDir": "./dist",
6
- "skipLibCheck": true,
7
- "jsx": "react-jsx"
8
- },
9
- "include": ["./src"]
10
- }