@remotion/eslint-plugin 4.0.256 → 4.0.257

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 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(` 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, "")}').
13728
+ throw new Error(`\tSeverity 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) => ` Value ${JSON.stringify(error.data)} ${error.message}.
13742
+ throw new Error(validateRule.errors.map((error) => `\tValue ${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
- ${enhancedMessage}`);
13758
+ \t${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
- Environment key "${id}" is unknown
13772
+ \tEnvironment 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) => ` - ${message}.
13819
+ }).map((message) => `\t- ${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(` 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, "")}').
25550
+ throw new Error(`\tSeverity 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) => ` Value ${JSON.stringify(error.data)} ${error.message}.
25564
+ throw new Error(validateRule.errors.map((error) => `\tValue ${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
- ${enhancedMessage}`);
25580
+ \t${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
- Environment key "${id}" is unknown
25594
+ \tEnvironment 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) => ` - ${message}.
25641
+ }).map((message) => `\t- ${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("|")})?[ \t]+`;
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) => ` Value ${JSON.stringify(error.data)} ${error.message}.
84143
+ throw new Error(`Key "rules": Key "${ruleId}": ${validateRule.errors.map((error) => `\tValue ${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
- ${baseMessage}
85249
+ \t${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(` Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, '"').replace(/\n/gu, "")}').
91585
+ throw new Error(`\tSeverity 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) => ` Value ${JSON.stringify(error.data)} ${error.message}.
91599
+ throw new Error(validateRule.errors.map((error) => `\tValue ${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
- ${enhancedMessage}`);
91615
+ \t${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
- Environment key "${id}" is unknown
91629
+ \tEnvironment 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) => ` - ${message}.
91676
+ }).map((message) => `\t- ${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 ` ${field}: ${error.message}`;
92092
+ return `\t${field}: ${error.message}`;
92093
92093
  }).join(`
92094
92094
  `);
92095
92095
  throw new Error([`Schema for rule ${ruleName} is invalid:`, errors]);
@@ -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(` 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, "")}').
13726
+ throw new Error(`\tSeverity 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) => ` Value ${JSON.stringify(error.data)} ${error.message}.
13740
+ throw new Error(validateRule.errors.map((error) => `\tValue ${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
- ${enhancedMessage}`);
13756
+ \t${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
- Environment key "${id}" is unknown
13770
+ \tEnvironment 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) => ` - ${message}.
13817
+ }).map((message) => `\t- ${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(` 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, "")}').
25548
+ throw new Error(`\tSeverity 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) => ` Value ${JSON.stringify(error.data)} ${error.message}.
25562
+ throw new Error(validateRule.errors.map((error) => `\tValue ${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
- ${enhancedMessage}`);
25578
+ \t${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
- Environment key "${id}" is unknown
25592
+ \tEnvironment 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) => ` - ${message}.
25639
+ }).map((message) => `\t- ${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("|")})?[ \t]+`;
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) => ` Value ${JSON.stringify(error.data)} ${error.message}.
84141
+ throw new Error(`Key "rules": Key "${ruleId}": ${validateRule.errors.map((error) => `\tValue ${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
- ${baseMessage}
85247
+ \t${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(` Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util.inspect(severity).replace(/'/gu, '"').replace(/\n/gu, "")}').
91583
+ throw new Error(`\tSeverity 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) => ` Value ${JSON.stringify(error.data)} ${error.message}.
91597
+ throw new Error(validateRule.errors.map((error) => `\tValue ${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
- ${enhancedMessage}`);
91613
+ \t${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
- Environment key "${id}" is unknown
91627
+ \tEnvironment 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) => ` - ${message}.
91674
+ }).map((message) => `\t- ${message}.
91675
91675
  `).join("");
91676
91676
  }
91677
91677
  function validateConfigSchema(config, source = null) {
@@ -91732,7 +91732,7 @@ var require_rule_tester = __commonJS((exports, module) => {
91732
91732
  var { Linter, SourceCodeFixer, interpolate } = require_linter2();
91733
91733
  var CodePath = require_code_path();
91734
91734
  var ajv = require_ajv2()({ strictDefaults: true });
91735
- var espreePath = __require.resolve("espree");
91735
+ var espreePath = __require.resolve("/Users/jonathanburger/remotion/node_modules/.pnpm/espree@9.6.1/node_modules/espree/dist/espree.cjs");
91736
91736
  var parserSymbol = Symbol.for("eslint.RuleTester.parser");
91737
91737
  var { SourceCode } = require_source_code2();
91738
91738
  var testerDefaultConfig = { rules: {} };
@@ -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 ` ${field}: ${error.message}`;
92090
+ return `\t${field}: ${error.message}`;
92091
92091
  }).join(`
92092
92092
  `);
92093
92093
  throw new Error([`Schema for rule ${ruleName} is invalid:`, errors]);
package/dist/index.js CHANGED
@@ -7,7 +7,6 @@ const even_dimensions_1 = __importDefault(require("./rules/even-dimensions"));
7
7
  const no_background_image_1 = __importDefault(require("./rules/no-background-image"));
8
8
  const no_duration_frames_infinity_1 = __importDefault(require("./rules/no-duration-frames-infinity"));
9
9
  const no_from_0_1 = __importDefault(require("./rules/no-from-0"));
10
- const no_mp4_import_1 = __importDefault(require("./rules/no-mp4-import"));
11
10
  const no_string_assets_1 = __importDefault(require("./rules/no-string-assets"));
12
11
  const staticfile_no_relative_1 = __importDefault(require("./rules/staticfile-no-relative"));
13
12
  const staticfile_no_remote_1 = __importDefault(require("./rules/staticfile-no-remote"));
@@ -16,7 +15,6 @@ const v4_import_1 = __importDefault(require("./rules/v4-import"));
16
15
  const volume_callback_1 = __importDefault(require("./rules/volume-callback"));
17
16
  const warn_native_media_tag_1 = __importDefault(require("./rules/warn-native-media-tag"));
18
17
  const rules = {
19
- 'no-mp4-import': no_mp4_import_1.default,
20
18
  'warn-native-media-tag': warn_native_media_tag_1.default,
21
19
  'deterministic-randomness': deterministic_randomness_1.default,
22
20
  'no-string-assets': no_string_assets_1.default,
@@ -35,7 +33,6 @@ module.exports = {
35
33
  configs: {
36
34
  recommended: {
37
35
  rules: {
38
- '@remotion/no-mp4-import': 'off',
39
36
  '@remotion/warn-native-media-tag': 'error',
40
37
  '@remotion/deterministic-randomness': 'error',
41
38
  '@remotion/no-string-assets': 'error',
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/eslint-plugin"
4
4
  },
5
5
  "name": "@remotion/eslint-plugin",
6
- "version": "4.0.256",
6
+ "version": "4.0.257",
7
7
  "description": "Rules for writing Remotion code",
8
8
  "main": "dist/index.js",
9
9
  "bugs": {
@@ -1,2 +0,0 @@
1
- declare const rule: import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"NoMP4Import", [], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
2
- export default rule;
@@ -1,61 +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 NoMP4Import = 'Importing MP4 will work while you are previewing the video, but will not work while rendering since Puppeteer does not include the codecs necessary for MP4 videos. Convert the video to WebM first.';
8
- const rule = createRule({
9
- name: 'no-mp4-import',
10
- meta: {
11
- type: 'problem',
12
- docs: {
13
- description: NoMP4Import,
14
- recommended: 'warn',
15
- },
16
- fixable: undefined,
17
- schema: [],
18
- messages: {
19
- NoMP4Import,
20
- },
21
- },
22
- defaultOptions: [],
23
- create: (context) => {
24
- return {
25
- ImportDeclaration: (node) => {
26
- if (node.source.raw.includes('.mp4')) {
27
- context.report({
28
- messageId: 'NoMP4Import',
29
- node,
30
- });
31
- }
32
- },
33
- CallExpression: (node) => {
34
- var _a, _b, _c, _d;
35
- // @ts-expect-error
36
- if (node.callee.name !== 'require') {
37
- return;
38
- }
39
- // @ts-expect-error
40
- const firstArgument = (_d = (_c = (_b = (_a = node.callee) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.arguments) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.raw;
41
- if (!firstArgument) {
42
- const sourceCode = context.getSourceCode().getText(node);
43
- if (sourceCode.includes('.mp4')) {
44
- context.report({
45
- messageId: 'NoMP4Import',
46
- node,
47
- });
48
- }
49
- return;
50
- }
51
- if (firstArgument.includes('.mp4')) {
52
- context.report({
53
- messageId: 'NoMP4Import',
54
- node,
55
- });
56
- }
57
- },
58
- };
59
- },
60
- });
61
- exports.default = rule;