@remotion/eslint-plugin 4.0.257 → 4.0.259
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/cjs/index.js +19 -19
- package/dist/esm/index.mjs +19 -19
- package/package.json +1 -1
- package/dist/index.js +0 -51
- package/dist/rules/deterministic-randomness.js +0 -47
- package/dist/rules/even-dimensions.js +0 -67
- package/dist/rules/no-background-image.js +0 -60
- package/dist/rules/no-duration-frames-infinity.js +0 -70
- package/dist/rules/no-from-0.js +0 -70
- package/dist/rules/no-string-assets.js +0 -89
- package/dist/rules/staticfile-no-relative.js +0 -94
- package/dist/rules/staticfile-no-remote.js +0 -64
- package/dist/rules/use-gif-component.js +0 -97
- package/dist/rules/v4-import.js +0 -40
- package/dist/rules/volume-callback.js +0 -67
- package/dist/rules/warn-native-media-tag.js +0 -97
package/dist/cjs/index.js
CHANGED
|
@@ -13725,7 +13725,7 @@ var require_eslintrc = __commonJS((exports2) => {
|
|
|
13725
13725
|
if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {
|
|
13726
13726
|
return normSeverity;
|
|
13727
13727
|
}
|
|
13728
|
-
throw new Error(
|
|
13728
|
+
throw new Error(` Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util__default["default"].inspect(severity).replace(/'/gu, '"').replace(/\n/gu, "")}').
|
|
13729
13729
|
`);
|
|
13730
13730
|
}
|
|
13731
13731
|
validateRuleSchema(rule, localOptions) {
|
|
@@ -13739,7 +13739,7 @@ var require_eslintrc = __commonJS((exports2) => {
|
|
|
13739
13739
|
if (validateRule) {
|
|
13740
13740
|
validateRule(localOptions);
|
|
13741
13741
|
if (validateRule.errors) {
|
|
13742
|
-
throw new Error(validateRule.errors.map((error) =>
|
|
13742
|
+
throw new Error(validateRule.errors.map((error) => ` Value ${JSON.stringify(error.data)} ${error.message}.
|
|
13743
13743
|
`).join(""));
|
|
13744
13744
|
}
|
|
13745
13745
|
}
|
|
@@ -13755,7 +13755,7 @@ var require_eslintrc = __commonJS((exports2) => {
|
|
|
13755
13755
|
${err.message}`;
|
|
13756
13756
|
if (typeof source === "string") {
|
|
13757
13757
|
throw new Error(`${source}:
|
|
13758
|
-
|
|
13758
|
+
${enhancedMessage}`);
|
|
13759
13759
|
} else {
|
|
13760
13760
|
throw new Error(enhancedMessage);
|
|
13761
13761
|
}
|
|
@@ -13769,7 +13769,7 @@ ${err.message}`;
|
|
|
13769
13769
|
const env = getAdditionalEnv(id) || environments.get(id) || null;
|
|
13770
13770
|
if (!env) {
|
|
13771
13771
|
const message = `${source}:
|
|
13772
|
-
|
|
13772
|
+
Environment key "${id}" is unknown
|
|
13773
13773
|
`;
|
|
13774
13774
|
throw new Error(message);
|
|
13775
13775
|
}
|
|
@@ -13816,7 +13816,7 @@ ${err.message}`);
|
|
|
13816
13816
|
}
|
|
13817
13817
|
const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;
|
|
13818
13818
|
return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`;
|
|
13819
|
-
}).map((message) =>
|
|
13819
|
+
}).map((message) => ` - ${message}.
|
|
13820
13820
|
`).join("");
|
|
13821
13821
|
}
|
|
13822
13822
|
validateConfigSchema(config, source = null) {
|
|
@@ -25547,7 +25547,7 @@ var require_eslintrc_universal = __commonJS((exports2) => {
|
|
|
25547
25547
|
if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {
|
|
25548
25548
|
return normSeverity;
|
|
25549
25549
|
}
|
|
25550
|
-
throw new Error(
|
|
25550
|
+
throw new Error(` Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util__default["default"].inspect(severity).replace(/'/gu, '"').replace(/\n/gu, "")}').
|
|
25551
25551
|
`);
|
|
25552
25552
|
}
|
|
25553
25553
|
validateRuleSchema(rule, localOptions) {
|
|
@@ -25561,7 +25561,7 @@ var require_eslintrc_universal = __commonJS((exports2) => {
|
|
|
25561
25561
|
if (validateRule) {
|
|
25562
25562
|
validateRule(localOptions);
|
|
25563
25563
|
if (validateRule.errors) {
|
|
25564
|
-
throw new Error(validateRule.errors.map((error) =>
|
|
25564
|
+
throw new Error(validateRule.errors.map((error) => ` Value ${JSON.stringify(error.data)} ${error.message}.
|
|
25565
25565
|
`).join(""));
|
|
25566
25566
|
}
|
|
25567
25567
|
}
|
|
@@ -25577,7 +25577,7 @@ var require_eslintrc_universal = __commonJS((exports2) => {
|
|
|
25577
25577
|
${err.message}`;
|
|
25578
25578
|
if (typeof source === "string") {
|
|
25579
25579
|
throw new Error(`${source}:
|
|
25580
|
-
|
|
25580
|
+
${enhancedMessage}`);
|
|
25581
25581
|
} else {
|
|
25582
25582
|
throw new Error(enhancedMessage);
|
|
25583
25583
|
}
|
|
@@ -25591,7 +25591,7 @@ ${err.message}`;
|
|
|
25591
25591
|
const env = getAdditionalEnv(id) || environments.get(id) || null;
|
|
25592
25592
|
if (!env) {
|
|
25593
25593
|
const message = `${source}:
|
|
25594
|
-
|
|
25594
|
+
Environment key "${id}" is unknown
|
|
25595
25595
|
`;
|
|
25596
25596
|
throw new Error(message);
|
|
25597
25597
|
}
|
|
@@ -25638,7 +25638,7 @@ ${err.message}`);
|
|
|
25638
25638
|
}
|
|
25639
25639
|
const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;
|
|
25640
25640
|
return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`;
|
|
25641
|
-
}).map((message) =>
|
|
25641
|
+
}).map((message) => ` - ${message}.
|
|
25642
25642
|
`).join("");
|
|
25643
25643
|
}
|
|
25644
25644
|
validateConfigSchema(config, source = null) {
|
|
@@ -78653,7 +78653,7 @@ var require_spaced_comment = __commonJS((exports2, module2) => {
|
|
|
78653
78653
|
return new RegExp(pattern, "u");
|
|
78654
78654
|
}
|
|
78655
78655
|
function createNeverStylePattern(markers) {
|
|
78656
|
-
const pattern = `^(${markers.map(escape2).join("|")})?[
|
|
78656
|
+
const pattern = `^(${markers.map(escape2).join("|")})?[ ]+`;
|
|
78657
78657
|
return new RegExp(pattern, "u");
|
|
78658
78658
|
}
|
|
78659
78659
|
module2.exports = {
|
|
@@ -84140,7 +84140,7 @@ var require_rule_validator = __commonJS((exports2) => {
|
|
|
84140
84140
|
if (validateRule) {
|
|
84141
84141
|
validateRule(ruleOptions.slice(1));
|
|
84142
84142
|
if (validateRule.errors) {
|
|
84143
|
-
throw new Error(`Key "rules": Key "${ruleId}": ${validateRule.errors.map((error) =>
|
|
84143
|
+
throw new Error(`Key "rules": Key "${ruleId}": ${validateRule.errors.map((error) => ` Value ${JSON.stringify(error.data)} ${error.message}.
|
|
84144
84144
|
`).join("")}`);
|
|
84145
84145
|
}
|
|
84146
84146
|
}
|
|
@@ -85246,7 +85246,7 @@ Rule: "${err.ruleId}"`;
|
|
|
85246
85246
|
inlineConfigProblems.push(createLintingProblem({
|
|
85247
85247
|
ruleId,
|
|
85248
85248
|
message: `Inline configuration for rule "${ruleId}" is invalid:
|
|
85249
|
-
|
|
85249
|
+
${baseMessage}
|
|
85250
85250
|
`,
|
|
85251
85251
|
loc: node.loc
|
|
85252
85252
|
}));
|
|
@@ -91582,7 +91582,7 @@ var require_config_validator = __commonJS((exports2, module2) => {
|
|
|
91582
91582
|
if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {
|
|
91583
91583
|
return normSeverity;
|
|
91584
91584
|
}
|
|
91585
|
-
throw new Error(
|
|
91585
|
+
throw new Error(` Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, '"').replace(/\n/gu, "")}').
|
|
91586
91586
|
`);
|
|
91587
91587
|
}
|
|
91588
91588
|
function validateRuleSchema(rule, localOptions) {
|
|
@@ -91596,7 +91596,7 @@ var require_config_validator = __commonJS((exports2, module2) => {
|
|
|
91596
91596
|
if (validateRule) {
|
|
91597
91597
|
validateRule(localOptions);
|
|
91598
91598
|
if (validateRule.errors) {
|
|
91599
|
-
throw new Error(validateRule.errors.map((error) =>
|
|
91599
|
+
throw new Error(validateRule.errors.map((error) => ` Value ${JSON.stringify(error.data)} ${error.message}.
|
|
91600
91600
|
`).join(""));
|
|
91601
91601
|
}
|
|
91602
91602
|
}
|
|
@@ -91612,7 +91612,7 @@ var require_config_validator = __commonJS((exports2, module2) => {
|
|
|
91612
91612
|
${err.message}`;
|
|
91613
91613
|
if (typeof source === "string") {
|
|
91614
91614
|
throw new Error(`${source}:
|
|
91615
|
-
|
|
91615
|
+
${enhancedMessage}`);
|
|
91616
91616
|
} else {
|
|
91617
91617
|
throw new Error(enhancedMessage);
|
|
91618
91618
|
}
|
|
@@ -91626,7 +91626,7 @@ ${err.message}`;
|
|
|
91626
91626
|
const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null;
|
|
91627
91627
|
if (!env) {
|
|
91628
91628
|
const message = `${source}:
|
|
91629
|
-
|
|
91629
|
+
Environment key "${id}" is unknown
|
|
91630
91630
|
`;
|
|
91631
91631
|
throw new Error(message);
|
|
91632
91632
|
}
|
|
@@ -91673,7 +91673,7 @@ ${err.message}`);
|
|
|
91673
91673
|
}
|
|
91674
91674
|
const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;
|
|
91675
91675
|
return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`;
|
|
91676
|
-
}).map((message) =>
|
|
91676
|
+
}).map((message) => ` - ${message}.
|
|
91677
91677
|
`).join("");
|
|
91678
91678
|
}
|
|
91679
91679
|
function validateConfigSchema(config, source = null) {
|
|
@@ -92089,7 +92089,7 @@ var require_rule_tester = __commonJS((exports2, module2) => {
|
|
|
92089
92089
|
if (ajv.errors) {
|
|
92090
92090
|
const errors = ajv.errors.map((error) => {
|
|
92091
92091
|
const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;
|
|
92092
|
-
return
|
|
92092
|
+
return ` ${field}: ${error.message}`;
|
|
92093
92093
|
}).join(`
|
|
92094
92094
|
`);
|
|
92095
92095
|
throw new Error([`Schema for rule ${ruleName} is invalid:`, errors]);
|
package/dist/esm/index.mjs
CHANGED
|
@@ -13723,7 +13723,7 @@ var require_eslintrc = __commonJS((exports) => {
|
|
|
13723
13723
|
if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {
|
|
13724
13724
|
return normSeverity;
|
|
13725
13725
|
}
|
|
13726
|
-
throw new Error(
|
|
13726
|
+
throw new Error(` Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util__default["default"].inspect(severity).replace(/'/gu, '"').replace(/\n/gu, "")}').
|
|
13727
13727
|
`);
|
|
13728
13728
|
}
|
|
13729
13729
|
validateRuleSchema(rule, localOptions) {
|
|
@@ -13737,7 +13737,7 @@ var require_eslintrc = __commonJS((exports) => {
|
|
|
13737
13737
|
if (validateRule) {
|
|
13738
13738
|
validateRule(localOptions);
|
|
13739
13739
|
if (validateRule.errors) {
|
|
13740
|
-
throw new Error(validateRule.errors.map((error) =>
|
|
13740
|
+
throw new Error(validateRule.errors.map((error) => ` Value ${JSON.stringify(error.data)} ${error.message}.
|
|
13741
13741
|
`).join(""));
|
|
13742
13742
|
}
|
|
13743
13743
|
}
|
|
@@ -13753,7 +13753,7 @@ var require_eslintrc = __commonJS((exports) => {
|
|
|
13753
13753
|
${err.message}`;
|
|
13754
13754
|
if (typeof source === "string") {
|
|
13755
13755
|
throw new Error(`${source}:
|
|
13756
|
-
|
|
13756
|
+
${enhancedMessage}`);
|
|
13757
13757
|
} else {
|
|
13758
13758
|
throw new Error(enhancedMessage);
|
|
13759
13759
|
}
|
|
@@ -13767,7 +13767,7 @@ ${err.message}`;
|
|
|
13767
13767
|
const env = getAdditionalEnv(id) || environments.get(id) || null;
|
|
13768
13768
|
if (!env) {
|
|
13769
13769
|
const message = `${source}:
|
|
13770
|
-
|
|
13770
|
+
Environment key "${id}" is unknown
|
|
13771
13771
|
`;
|
|
13772
13772
|
throw new Error(message);
|
|
13773
13773
|
}
|
|
@@ -13814,7 +13814,7 @@ ${err.message}`);
|
|
|
13814
13814
|
}
|
|
13815
13815
|
const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;
|
|
13816
13816
|
return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`;
|
|
13817
|
-
}).map((message) =>
|
|
13817
|
+
}).map((message) => ` - ${message}.
|
|
13818
13818
|
`).join("");
|
|
13819
13819
|
}
|
|
13820
13820
|
validateConfigSchema(config, source = null) {
|
|
@@ -25545,7 +25545,7 @@ var require_eslintrc_universal = __commonJS((exports) => {
|
|
|
25545
25545
|
if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {
|
|
25546
25546
|
return normSeverity;
|
|
25547
25547
|
}
|
|
25548
|
-
throw new Error(
|
|
25548
|
+
throw new Error(` Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util__default["default"].inspect(severity).replace(/'/gu, '"').replace(/\n/gu, "")}').
|
|
25549
25549
|
`);
|
|
25550
25550
|
}
|
|
25551
25551
|
validateRuleSchema(rule, localOptions) {
|
|
@@ -25559,7 +25559,7 @@ var require_eslintrc_universal = __commonJS((exports) => {
|
|
|
25559
25559
|
if (validateRule) {
|
|
25560
25560
|
validateRule(localOptions);
|
|
25561
25561
|
if (validateRule.errors) {
|
|
25562
|
-
throw new Error(validateRule.errors.map((error) =>
|
|
25562
|
+
throw new Error(validateRule.errors.map((error) => ` Value ${JSON.stringify(error.data)} ${error.message}.
|
|
25563
25563
|
`).join(""));
|
|
25564
25564
|
}
|
|
25565
25565
|
}
|
|
@@ -25575,7 +25575,7 @@ var require_eslintrc_universal = __commonJS((exports) => {
|
|
|
25575
25575
|
${err.message}`;
|
|
25576
25576
|
if (typeof source === "string") {
|
|
25577
25577
|
throw new Error(`${source}:
|
|
25578
|
-
|
|
25578
|
+
${enhancedMessage}`);
|
|
25579
25579
|
} else {
|
|
25580
25580
|
throw new Error(enhancedMessage);
|
|
25581
25581
|
}
|
|
@@ -25589,7 +25589,7 @@ ${err.message}`;
|
|
|
25589
25589
|
const env = getAdditionalEnv(id) || environments.get(id) || null;
|
|
25590
25590
|
if (!env) {
|
|
25591
25591
|
const message = `${source}:
|
|
25592
|
-
|
|
25592
|
+
Environment key "${id}" is unknown
|
|
25593
25593
|
`;
|
|
25594
25594
|
throw new Error(message);
|
|
25595
25595
|
}
|
|
@@ -25636,7 +25636,7 @@ ${err.message}`);
|
|
|
25636
25636
|
}
|
|
25637
25637
|
const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;
|
|
25638
25638
|
return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`;
|
|
25639
|
-
}).map((message) =>
|
|
25639
|
+
}).map((message) => ` - ${message}.
|
|
25640
25640
|
`).join("");
|
|
25641
25641
|
}
|
|
25642
25642
|
validateConfigSchema(config, source = null) {
|
|
@@ -78651,7 +78651,7 @@ var require_spaced_comment = __commonJS((exports, module) => {
|
|
|
78651
78651
|
return new RegExp(pattern, "u");
|
|
78652
78652
|
}
|
|
78653
78653
|
function createNeverStylePattern(markers) {
|
|
78654
|
-
const pattern = `^(${markers.map(escape2).join("|")})?[
|
|
78654
|
+
const pattern = `^(${markers.map(escape2).join("|")})?[ ]+`;
|
|
78655
78655
|
return new RegExp(pattern, "u");
|
|
78656
78656
|
}
|
|
78657
78657
|
module.exports = {
|
|
@@ -84138,7 +84138,7 @@ var require_rule_validator = __commonJS((exports) => {
|
|
|
84138
84138
|
if (validateRule) {
|
|
84139
84139
|
validateRule(ruleOptions.slice(1));
|
|
84140
84140
|
if (validateRule.errors) {
|
|
84141
|
-
throw new Error(`Key "rules": Key "${ruleId}": ${validateRule.errors.map((error) =>
|
|
84141
|
+
throw new Error(`Key "rules": Key "${ruleId}": ${validateRule.errors.map((error) => ` Value ${JSON.stringify(error.data)} ${error.message}.
|
|
84142
84142
|
`).join("")}`);
|
|
84143
84143
|
}
|
|
84144
84144
|
}
|
|
@@ -85244,7 +85244,7 @@ Rule: "${err.ruleId}"`;
|
|
|
85244
85244
|
inlineConfigProblems.push(createLintingProblem({
|
|
85245
85245
|
ruleId,
|
|
85246
85246
|
message: `Inline configuration for rule "${ruleId}" is invalid:
|
|
85247
|
-
|
|
85247
|
+
${baseMessage}
|
|
85248
85248
|
`,
|
|
85249
85249
|
loc: node.loc
|
|
85250
85250
|
}));
|
|
@@ -91580,7 +91580,7 @@ var require_config_validator = __commonJS((exports, module) => {
|
|
|
91580
91580
|
if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {
|
|
91581
91581
|
return normSeverity;
|
|
91582
91582
|
}
|
|
91583
|
-
throw new Error(
|
|
91583
|
+
throw new Error(` Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, '"').replace(/\n/gu, "")}').
|
|
91584
91584
|
`);
|
|
91585
91585
|
}
|
|
91586
91586
|
function validateRuleSchema(rule, localOptions) {
|
|
@@ -91594,7 +91594,7 @@ var require_config_validator = __commonJS((exports, module) => {
|
|
|
91594
91594
|
if (validateRule) {
|
|
91595
91595
|
validateRule(localOptions);
|
|
91596
91596
|
if (validateRule.errors) {
|
|
91597
|
-
throw new Error(validateRule.errors.map((error) =>
|
|
91597
|
+
throw new Error(validateRule.errors.map((error) => ` Value ${JSON.stringify(error.data)} ${error.message}.
|
|
91598
91598
|
`).join(""));
|
|
91599
91599
|
}
|
|
91600
91600
|
}
|
|
@@ -91610,7 +91610,7 @@ var require_config_validator = __commonJS((exports, module) => {
|
|
|
91610
91610
|
${err.message}`;
|
|
91611
91611
|
if (typeof source === "string") {
|
|
91612
91612
|
throw new Error(`${source}:
|
|
91613
|
-
|
|
91613
|
+
${enhancedMessage}`);
|
|
91614
91614
|
} else {
|
|
91615
91615
|
throw new Error(enhancedMessage);
|
|
91616
91616
|
}
|
|
@@ -91624,7 +91624,7 @@ ${err.message}`;
|
|
|
91624
91624
|
const env = getAdditionalEnv(id) || BuiltInEnvironments.get(id) || null;
|
|
91625
91625
|
if (!env) {
|
|
91626
91626
|
const message = `${source}:
|
|
91627
|
-
|
|
91627
|
+
Environment key "${id}" is unknown
|
|
91628
91628
|
`;
|
|
91629
91629
|
throw new Error(message);
|
|
91630
91630
|
}
|
|
@@ -91671,7 +91671,7 @@ ${err.message}`);
|
|
|
91671
91671
|
}
|
|
91672
91672
|
const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;
|
|
91673
91673
|
return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`;
|
|
91674
|
-
}).map((message) =>
|
|
91674
|
+
}).map((message) => ` - ${message}.
|
|
91675
91675
|
`).join("");
|
|
91676
91676
|
}
|
|
91677
91677
|
function validateConfigSchema(config, source = null) {
|
|
@@ -92087,7 +92087,7 @@ var require_rule_tester = __commonJS((exports, module) => {
|
|
|
92087
92087
|
if (ajv.errors) {
|
|
92088
92088
|
const errors = ajv.errors.map((error) => {
|
|
92089
92089
|
const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;
|
|
92090
|
-
return
|
|
92090
|
+
return ` ${field}: ${error.message}`;
|
|
92091
92091
|
}).join(`
|
|
92092
92092
|
`);
|
|
92093
92093
|
throw new Error([`Schema for rule ${ruleName} is invalid:`, errors]);
|
package/package.json
CHANGED
package/dist/index.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
const deterministic_randomness_1 = __importDefault(require("./rules/deterministic-randomness"));
|
|
6
|
-
const even_dimensions_1 = __importDefault(require("./rules/even-dimensions"));
|
|
7
|
-
const no_background_image_1 = __importDefault(require("./rules/no-background-image"));
|
|
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"));
|
|
10
|
-
const no_string_assets_1 = __importDefault(require("./rules/no-string-assets"));
|
|
11
|
-
const staticfile_no_relative_1 = __importDefault(require("./rules/staticfile-no-relative"));
|
|
12
|
-
const staticfile_no_remote_1 = __importDefault(require("./rules/staticfile-no-remote"));
|
|
13
|
-
const use_gif_component_1 = __importDefault(require("./rules/use-gif-component"));
|
|
14
|
-
const v4_import_1 = __importDefault(require("./rules/v4-import"));
|
|
15
|
-
const volume_callback_1 = __importDefault(require("./rules/volume-callback"));
|
|
16
|
-
const warn_native_media_tag_1 = __importDefault(require("./rules/warn-native-media-tag"));
|
|
17
|
-
const rules = {
|
|
18
|
-
'warn-native-media-tag': warn_native_media_tag_1.default,
|
|
19
|
-
'deterministic-randomness': deterministic_randomness_1.default,
|
|
20
|
-
'no-string-assets': no_string_assets_1.default,
|
|
21
|
-
'even-dimensions': even_dimensions_1.default,
|
|
22
|
-
'duration-in-frames': no_duration_frames_infinity_1.default,
|
|
23
|
-
'from-0': no_from_0_1.default,
|
|
24
|
-
'volume-callback': volume_callback_1.default,
|
|
25
|
-
'use-gif-component': use_gif_component_1.default,
|
|
26
|
-
'staticfile-no-relative': staticfile_no_relative_1.default,
|
|
27
|
-
'staticfile-no-remote': staticfile_no_remote_1.default,
|
|
28
|
-
'no-background-image': no_background_image_1.default,
|
|
29
|
-
'v4-config-import': v4_import_1.default,
|
|
30
|
-
};
|
|
31
|
-
module.exports = {
|
|
32
|
-
rules,
|
|
33
|
-
configs: {
|
|
34
|
-
recommended: {
|
|
35
|
-
rules: {
|
|
36
|
-
'@remotion/warn-native-media-tag': 'error',
|
|
37
|
-
'@remotion/deterministic-randomness': 'error',
|
|
38
|
-
'@remotion/no-string-assets': 'error',
|
|
39
|
-
'@remotion/even-dimensions': 'error',
|
|
40
|
-
'@remotion/duration-in-frames': 'error',
|
|
41
|
-
'@remotion/from-0': 'error',
|
|
42
|
-
'@remotion/volume-callback': 'error',
|
|
43
|
-
'@remotion/use-gif-component': 'error',
|
|
44
|
-
'@remotion/staticfile-no-relative': 'error',
|
|
45
|
-
'@remotion/staticfile-no-remote': 'error',
|
|
46
|
-
'@remotion/no-background-image': 'error',
|
|
47
|
-
'@remotion/v4-config-import': 'error',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
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 DeterministicRandomness = [
|
|
8
|
-
'The result of Math.random() will change between frames while in rendering mode.',
|
|
9
|
-
'Use the `random()` API from Remotion to get a deterministic pseudorandom value.',
|
|
10
|
-
'If you are sure you want a true random value, use `random(null)` to hide this warning.',
|
|
11
|
-
'See: https://remotion.dev/docs/using-randomness',
|
|
12
|
-
].join('\n');
|
|
13
|
-
exports.default = createRule({
|
|
14
|
-
name: 'deterministic-randomness',
|
|
15
|
-
meta: {
|
|
16
|
-
type: 'problem',
|
|
17
|
-
docs: {
|
|
18
|
-
description: DeterministicRandomness,
|
|
19
|
-
recommended: 'warn',
|
|
20
|
-
},
|
|
21
|
-
fixable: undefined,
|
|
22
|
-
schema: [],
|
|
23
|
-
messages: {
|
|
24
|
-
DeterministicRandomness: DeterministicRandomness,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
defaultOptions: [],
|
|
28
|
-
create: (context) => {
|
|
29
|
-
return {
|
|
30
|
-
CallExpression: (node) => {
|
|
31
|
-
const callee = node.callee;
|
|
32
|
-
if (callee.type === 'MemberExpression') {
|
|
33
|
-
if (callee.object.type === 'Identifier' &&
|
|
34
|
-
callee.object.name === 'Math') {
|
|
35
|
-
if (callee.property.type === 'Identifier' &&
|
|
36
|
-
callee.property.name === 'random') {
|
|
37
|
-
context.report({
|
|
38
|
-
messageId: 'DeterministicRandomness',
|
|
39
|
-
node,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
});
|
|
@@ -1,67 +0,0 @@
|
|
|
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 EvenDimensions = "Videos rendered in H264/H265 codec do not support dimensions that are not divisible by 2. Make the number even to resolve this warning. Ignore this warning if you don't plan on rendering this video with a H264 or H265 codec.";
|
|
8
|
-
exports.default = createRule({
|
|
9
|
-
name: 'even-dimensions',
|
|
10
|
-
meta: {
|
|
11
|
-
type: 'problem',
|
|
12
|
-
docs: {
|
|
13
|
-
description: EvenDimensions,
|
|
14
|
-
recommended: 'warn',
|
|
15
|
-
},
|
|
16
|
-
fixable: undefined,
|
|
17
|
-
schema: [],
|
|
18
|
-
messages: {
|
|
19
|
-
EvenDimensions,
|
|
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 !== 'width' && node.name.name !== 'height') {
|
|
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 (typeof stringValue !== 'number') {
|
|
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 !== 'Composition') {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (stringValue % 2 !== 0) {
|
|
59
|
-
context.report({
|
|
60
|
-
messageId: 'EvenDimensions',
|
|
61
|
-
node,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
});
|
|
@@ -1,60 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,70 +0,0 @@
|
|
|
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 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
|
-
recommended: 'warn',
|
|
15
|
-
},
|
|
16
|
-
fixable: 'code',
|
|
17
|
-
schema: [],
|
|
18
|
-
messages: {
|
|
19
|
-
DurationInFrames,
|
|
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 !== 'durationInFrames') {
|
|
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 !== 'Identifier') {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const stringValue = expression.name;
|
|
41
|
-
if (typeof stringValue !== 'string') {
|
|
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 === 'Infinity') {
|
|
59
|
-
context.report({
|
|
60
|
-
messageId: 'DurationInFrames',
|
|
61
|
-
node,
|
|
62
|
-
fix: (fixer) => {
|
|
63
|
-
return fixer.removeRange([node.name.range[0], value.range[1]]);
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
},
|
|
70
|
-
});
|
package/dist/rules/no-from-0.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,89 +0,0 @@
|
|
|
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 NoStringAssets = [
|
|
8
|
-
"Don't reference local assets by string, use an import statement or staticFile() instead.",
|
|
9
|
-
'See: https://www.remotion.dev/docs/assets',
|
|
10
|
-
].join('\n');
|
|
11
|
-
exports.default = createRule({
|
|
12
|
-
name: 'no-string-assets',
|
|
13
|
-
meta: {
|
|
14
|
-
type: 'problem',
|
|
15
|
-
docs: {
|
|
16
|
-
description: NoStringAssets,
|
|
17
|
-
recommended: 'warn',
|
|
18
|
-
},
|
|
19
|
-
fixable: undefined,
|
|
20
|
-
schema: [],
|
|
21
|
-
messages: {
|
|
22
|
-
NoStringAssets: NoStringAssets,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
defaultOptions: [],
|
|
26
|
-
create: (context) => {
|
|
27
|
-
return {
|
|
28
|
-
JSXAttribute: (node) => {
|
|
29
|
-
if (node.type !== 'JSXAttribute') {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (node.name.name !== 'src') {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const value = node.value;
|
|
36
|
-
// src={"some string"}
|
|
37
|
-
const insideCurlyBraces = value &&
|
|
38
|
-
value.type === 'JSXExpressionContainer' &&
|
|
39
|
-
value.expression.type === 'Literal';
|
|
40
|
-
if (!value || (value.type !== 'Literal' && !insideCurlyBraces)) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const stringValue = value &&
|
|
44
|
-
value.type === 'JSXExpressionContainer' &&
|
|
45
|
-
value.expression.type === 'Literal'
|
|
46
|
-
? value.expression.value
|
|
47
|
-
: value.type === 'Literal'
|
|
48
|
-
? value.value
|
|
49
|
-
: null;
|
|
50
|
-
if (typeof stringValue !== 'string') {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const parent = node.parent;
|
|
54
|
-
if (!parent) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
if (parent.type !== 'JSXOpeningElement') {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const name = parent.name;
|
|
61
|
-
if (name.type !== 'JSXIdentifier') {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
if (name.name === 'Img' ||
|
|
65
|
-
name.name === 'img' ||
|
|
66
|
-
name.name === 'Audio' ||
|
|
67
|
-
name.name === 'audio' ||
|
|
68
|
-
name.name === 'Video' ||
|
|
69
|
-
name.name === 'video' ||
|
|
70
|
-
name.name === 'source') {
|
|
71
|
-
// Network and inline URLs are okay
|
|
72
|
-
if (stringValue.startsWith('http://')) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (stringValue.startsWith('https://')) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (stringValue.startsWith('data:')) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
context.report({
|
|
82
|
-
messageId: 'NoStringAssets',
|
|
83
|
-
node,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
},
|
|
89
|
-
});
|
|
@@ -1,94 +0,0 @@
|
|
|
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/staticfile-relative-paths`;
|
|
6
|
-
});
|
|
7
|
-
const RelativePathStaticFile = [
|
|
8
|
-
"Don't pass a relative path to staticFile().",
|
|
9
|
-
'See: https://remotion.dev/docs/staticfile-relative-paths',
|
|
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('');
|
|
19
|
-
exports.default = createRule({
|
|
20
|
-
name: 'staticfile-no-relative',
|
|
21
|
-
meta: {
|
|
22
|
-
type: 'problem',
|
|
23
|
-
docs: {
|
|
24
|
-
description: RelativePathStaticFile,
|
|
25
|
-
recommended: 'warn',
|
|
26
|
-
},
|
|
27
|
-
fixable: undefined,
|
|
28
|
-
schema: [],
|
|
29
|
-
messages: {
|
|
30
|
-
RelativePathStaticFile: RelativePathStaticFile,
|
|
31
|
-
PublicStaticFile: PublicStaticFile,
|
|
32
|
-
AbsoluteStaticFile: AbsoluteStaticFile,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
defaultOptions: [],
|
|
36
|
-
create: (context) => {
|
|
37
|
-
return {
|
|
38
|
-
CallExpression: (node) => {
|
|
39
|
-
const value = node;
|
|
40
|
-
// src={"some string"}
|
|
41
|
-
if (!value) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
if (node.type === 'CallExpression' &&
|
|
45
|
-
node.callee.type === 'Identifier' &&
|
|
46
|
-
node.callee.name === 'staticFile') {
|
|
47
|
-
const args = node.arguments;
|
|
48
|
-
if (args.length === 0) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const firstArg = args[0];
|
|
52
|
-
if (firstArg.type === 'Literal') {
|
|
53
|
-
const value = firstArg.value;
|
|
54
|
-
if (typeof value !== 'string') {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
if (value.startsWith('./')) {
|
|
58
|
-
context.report({
|
|
59
|
-
messageId: 'RelativePathStaticFile',
|
|
60
|
-
node,
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
if (value.startsWith('../')) {
|
|
64
|
-
context.report({
|
|
65
|
-
messageId: 'RelativePathStaticFile',
|
|
66
|
-
node,
|
|
67
|
-
});
|
|
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
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
},
|
|
94
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
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/staticfile-remote-urls`;
|
|
6
|
-
});
|
|
7
|
-
const RelativePathStaticFile = [
|
|
8
|
-
"Don't pass a remote URL to staticFile().",
|
|
9
|
-
'See: https://remotion.dev/docs/staticfile-remote-urls',
|
|
10
|
-
].join('\n');
|
|
11
|
-
exports.default = createRule({
|
|
12
|
-
name: 'staticfile-no-remote',
|
|
13
|
-
meta: {
|
|
14
|
-
type: 'problem',
|
|
15
|
-
docs: {
|
|
16
|
-
description: RelativePathStaticFile,
|
|
17
|
-
recommended: 'warn',
|
|
18
|
-
},
|
|
19
|
-
fixable: undefined,
|
|
20
|
-
schema: [],
|
|
21
|
-
messages: {
|
|
22
|
-
RelativePathStaticFile: RelativePathStaticFile,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
defaultOptions: [],
|
|
26
|
-
create: (context) => {
|
|
27
|
-
return {
|
|
28
|
-
CallExpression: (node) => {
|
|
29
|
-
const value = node;
|
|
30
|
-
// src={"some string"}
|
|
31
|
-
if (!value) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (node.type === 'CallExpression' &&
|
|
35
|
-
node.callee.type === 'Identifier' &&
|
|
36
|
-
node.callee.name === 'staticFile') {
|
|
37
|
-
const args = node.arguments;
|
|
38
|
-
if (args.length === 0) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const firstArg = args[0];
|
|
42
|
-
if (firstArg.type === 'Literal') {
|
|
43
|
-
const value = firstArg.value;
|
|
44
|
-
if (typeof value !== 'string') {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (value.startsWith('http://')) {
|
|
48
|
-
context.report({
|
|
49
|
-
messageId: 'RelativePathStaticFile',
|
|
50
|
-
node,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
if (value.startsWith('https://')) {
|
|
54
|
-
context.report({
|
|
55
|
-
messageId: 'RelativePathStaticFile',
|
|
56
|
-
node,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
},
|
|
64
|
-
});
|
|
@@ -1,97 +0,0 @@
|
|
|
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 UseGifComponent = [
|
|
8
|
-
'Use the <Gif> component animated GIFs.',
|
|
9
|
-
'See: https://www.remotion.dev/docs/gif.',
|
|
10
|
-
'Ignore this message if this is a non-animated GIF.',
|
|
11
|
-
].join('\n');
|
|
12
|
-
exports.default = createRule({
|
|
13
|
-
name: 'use-gif-component',
|
|
14
|
-
meta: {
|
|
15
|
-
type: 'problem',
|
|
16
|
-
docs: {
|
|
17
|
-
description: UseGifComponent,
|
|
18
|
-
recommended: 'warn',
|
|
19
|
-
},
|
|
20
|
-
fixable: undefined,
|
|
21
|
-
schema: [],
|
|
22
|
-
messages: {
|
|
23
|
-
UseGifComponent: UseGifComponent,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
defaultOptions: [],
|
|
27
|
-
create: (context) => {
|
|
28
|
-
return {
|
|
29
|
-
JSXAttribute: (node) => {
|
|
30
|
-
if (node.type !== 'JSXAttribute') {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (node.name.name !== 'src') {
|
|
34
|
-
return;
|
|
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
|
-
}
|
|
50
|
-
const value = node.value;
|
|
51
|
-
// src={"some string"}
|
|
52
|
-
if (!value) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
const stringValue = value &&
|
|
56
|
-
value.type === 'JSXExpressionContainer' &&
|
|
57
|
-
value.expression.type === 'Literal'
|
|
58
|
-
? value.expression.value
|
|
59
|
-
: value.type === 'Literal'
|
|
60
|
-
? value.value
|
|
61
|
-
: null;
|
|
62
|
-
// src="image.gif"
|
|
63
|
-
if (typeof stringValue === 'string') {
|
|
64
|
-
// Network and inline URLs are okay
|
|
65
|
-
if (stringValue.includes('.gif')) {
|
|
66
|
-
context.report({
|
|
67
|
-
messageId: 'UseGifComponent',
|
|
68
|
-
node,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (value.type === 'JSXExpressionContainer' &&
|
|
73
|
-
value.expression.type === 'CallExpression' &&
|
|
74
|
-
value.expression.callee.type === 'Identifier' &&
|
|
75
|
-
value.expression.callee.name === 'staticFile') {
|
|
76
|
-
const args = value.expression.arguments;
|
|
77
|
-
if (args.length === 0) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const firstArg = args[0];
|
|
81
|
-
if (firstArg.type === 'Literal') {
|
|
82
|
-
const value = firstArg.value;
|
|
83
|
-
if (typeof value !== 'string') {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
if (value.includes('.gif')) {
|
|
87
|
-
context.report({
|
|
88
|
-
messageId: 'UseGifComponent',
|
|
89
|
-
node,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
},
|
|
97
|
-
});
|
package/dist/rules/v4-import.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
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://www.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;
|
|
@@ -1,67 +0,0 @@
|
|
|
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 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
|
-
recommended: 'warn',
|
|
15
|
-
},
|
|
16
|
-
fixable: undefined,
|
|
17
|
-
schema: [],
|
|
18
|
-
messages: {
|
|
19
|
-
VolumeCallback,
|
|
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 !== 'volume') {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const value = node.value;
|
|
33
|
-
if (!value || value.type !== 'JSXExpressionContainer') {
|
|
34
|
-
return;
|
|
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 !== 'Video' && name.name !== 'Audio') {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const expression = value.expression;
|
|
51
|
-
if (!expression) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (expression.type === 'Literal') {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
if (expression.type === 'ArrowFunctionExpression') {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
context.report({
|
|
61
|
-
messageId: 'VolumeCallback',
|
|
62
|
-
node,
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
});
|
|
@@ -1,97 +0,0 @@
|
|
|
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 NoNativeImgTag = "Prefer the <Img /> tag from 'remotion' package, because it will wait until the image is loaded when you are rendering your video.";
|
|
8
|
-
const NoNativeIFrameTag = "Prefer the <IFrame /> tag from 'remotion' package, because it will wait until the iframe is loaded when you are rendering your video.";
|
|
9
|
-
const NoNativeAudioTag = "Use the <Audio /> tag from 'remotion' package, because it will synchronize with the Remotion timeline.";
|
|
10
|
-
const NoNativeVideoTag = "Use the <Video /> tag from 'remotion' package, because it will synchronize with the Remotion timeline.";
|
|
11
|
-
exports.default = createRule({
|
|
12
|
-
name: 'warn-native-media-tag',
|
|
13
|
-
meta: {
|
|
14
|
-
type: 'problem',
|
|
15
|
-
docs: {
|
|
16
|
-
description: NoNativeImgTag,
|
|
17
|
-
recommended: 'warn',
|
|
18
|
-
},
|
|
19
|
-
fixable: undefined,
|
|
20
|
-
schema: [],
|
|
21
|
-
messages: {
|
|
22
|
-
NoNativeImgTag,
|
|
23
|
-
NoNativeIFrameTag,
|
|
24
|
-
NoNativeAudioTag,
|
|
25
|
-
NoNativeVideoTag,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
defaultOptions: [],
|
|
29
|
-
create: (context) => {
|
|
30
|
-
return {
|
|
31
|
-
JSXOpeningElement: (node) => {
|
|
32
|
-
if (node.name.type === 'JSXIdentifier' && node.name.name === 'img') {
|
|
33
|
-
context.report({
|
|
34
|
-
messageId: 'NoNativeImgTag',
|
|
35
|
-
node,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
if (node.name.type === 'JSXIdentifier' && node.name.name === 'iframe') {
|
|
39
|
-
context.report({
|
|
40
|
-
messageId: 'NoNativeIFrameTag',
|
|
41
|
-
node,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
if (node.name.type === 'JSXIdentifier' && node.name.name === 'video') {
|
|
45
|
-
context.report({
|
|
46
|
-
messageId: 'NoNativeVideoTag',
|
|
47
|
-
node,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
if (node.name.type === 'JSXIdentifier' && node.name.name === 'audio') {
|
|
51
|
-
context.report({
|
|
52
|
-
messageId: 'NoNativeAudioTag',
|
|
53
|
-
node,
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
TaggedTemplateExpression: (node) => {
|
|
58
|
-
if (node.tag.type !== 'MemberExpression') {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (node.tag.object.type !== 'Identifier') {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
if (node.tag.object.name !== 'styled') {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (node.tag.property.type !== 'Identifier') {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (node.tag.property.name === 'img') {
|
|
71
|
-
context.report({
|
|
72
|
-
messageId: 'NoNativeImgTag',
|
|
73
|
-
node,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
if (node.tag.property.name === 'iframe') {
|
|
77
|
-
context.report({
|
|
78
|
-
messageId: 'NoNativeIFrameTag',
|
|
79
|
-
node,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
if (node.tag.property.name === 'audio') {
|
|
83
|
-
context.report({
|
|
84
|
-
messageId: 'NoNativeAudioTag',
|
|
85
|
-
node,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
if (node.tag.property.name === 'video') {
|
|
89
|
-
context.report({
|
|
90
|
-
messageId: 'NoNativeVideoTag',
|
|
91
|
-
node,
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
},
|
|
97
|
-
});
|