@remotion/eslint-plugin 3.3.11 → 3.3.13

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.
@@ -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" &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/eslint-plugin",
3
- "version": "3.3.11",
3
+ "version": "3.3.13",
4
4
  "description": "A set of rules helping you avoid common pitfalls in Remotion.",
5
5
  "scripts": {
6
6
  "build": "tsc -d",
@@ -22,5 +22,5 @@
22
22
  "vitest": "0.24.3"
23
23
  },
24
24
  "private": false,
25
- "gitHead": "08404196c439c2bf1f06bbb7a99a6fd84d5158e1"
25
+ "gitHead": "5149292492bbbd27d48935e0aea371251c21588d"
26
26
  }