@mui/internal-code-infra 0.1.1-canary.29 → 0.1.1-canary.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/internal-code-infra",
3
- "version": "0.1.1-canary.29",
3
+ "version": "0.1.1-canary.30",
4
4
  "author": "MUI Team",
5
5
  "description": "Infra scripts and configs to be used across MUI repos.",
6
6
  "license": "MIT",
@@ -197,7 +197,7 @@
197
197
  "publishConfig": {
198
198
  "access": "public"
199
199
  },
200
- "gitSha": "1528dd11a9b88caecbdf6eb74002cbee8b601b3a",
200
+ "gitSha": "1f9fcea1392b103e1ab1e3029fd244314d9c7130",
201
201
  "scripts": {
202
202
  "build": "tsc -p tsconfig.build.json",
203
203
  "typescript": "tsc -noEmit",
@@ -47,7 +47,10 @@ export default /** @type {import('eslint').Rule.RuleModule} */ ({
47
47
  return null;
48
48
  }
49
49
 
50
- const firstToken = context.sourceCode.ast.body[0];
50
+ const firstToken = context.sourceCode.getFirstToken(context.sourceCode.ast);
51
+ if (!firstToken) {
52
+ return null;
53
+ }
51
54
  return fixer.insertTextBefore(firstToken, "'use client';\n");
52
55
  }
53
56