@mui/internal-code-infra 0.0.3-canary.95 → 0.0.4-canary.0

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.0.3-canary.95",
3
+ "version": "0.0.4-canary.0",
4
4
  "description": "Infra scripts and configs to be used across MUI repos.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -59,8 +59,8 @@
59
59
  "@babel/preset-react": "^7.28.5",
60
60
  "@babel/preset-typescript": "^7.28.5",
61
61
  "@eslint/compat": "^2.0.2",
62
- "@eslint/js": "^9.39.2",
63
- "@eslint/json": "^0.14.0",
62
+ "@eslint/js": "^10.0.1",
63
+ "@eslint/json": "^1.0.1",
64
64
  "@inquirer/confirm": "^6.0.4",
65
65
  "@inquirer/select": "^5.0.4",
66
66
  "@napi-rs/keyring": "^1.2.0",
@@ -68,8 +68,8 @@
68
68
  "@octokit/oauth-methods": "^6.0.2",
69
69
  "@octokit/rest": "^22.0.1",
70
70
  "@pnpm/find-workspace-dir": "^1000.1.3",
71
- "@typescript-eslint/types": "^8.56.0",
72
- "@typescript-eslint/utils": "^8.56.0",
71
+ "@typescript-eslint/types": "^8.56.1",
72
+ "@typescript-eslint/utils": "^8.56.1",
73
73
  "@vitest/eslint-plugin": "^1.6.9",
74
74
  "babel-plugin-optimize-clsx": "^2.6.2",
75
75
  "babel-plugin-react-compiler": "^1.0.0",
@@ -110,17 +110,17 @@
110
110
  "resolve-pkg-maps": "^1.0.0",
111
111
  "semver": "^7.7.4",
112
112
  "stylelint-config-standard": "^40.0.0",
113
- "typescript-eslint": "^8.56.0",
113
+ "typescript-eslint": "^8.56.1",
114
114
  "unified": "^11.0.5",
115
115
  "yargs": "^18.0.0",
116
- "@mui/internal-babel-plugin-minify-errors": "2.0.8-canary.22",
116
+ "@mui/internal-babel-plugin-display-name": "1.0.4-canary.13",
117
117
  "@mui/internal-babel-plugin-resolve-imports": "2.0.7-canary.32",
118
- "@mui/internal-babel-plugin-display-name": "1.0.4-canary.13"
118
+ "@mui/internal-babel-plugin-minify-errors": "2.0.8-canary.22"
119
119
  },
120
120
  "peerDependencies": {
121
121
  "@next/eslint-plugin-next": "*",
122
122
  "@typescript/native-preview": ">=7.0.0-dev.0",
123
- "eslint": "^9.0.0",
123
+ "eslint": "^9.0.0 || ^10.0.0",
124
124
  "prettier": "^3.0.0",
125
125
  "typescript": "^5.0.0"
126
126
  },
@@ -143,13 +143,13 @@
143
143
  "@types/estree-jsx": "1.0.5",
144
144
  "@types/regexp.escape": "2.0.0",
145
145
  "@types/yargs": "17.0.35",
146
- "@typescript-eslint/parser": "8.56.0",
147
- "@typescript-eslint/rule-tester": "8.56.0",
148
- "eslint": "9.39.2",
146
+ "@typescript-eslint/parser": "8.56.1",
147
+ "@typescript-eslint/rule-tester": "8.56.1",
148
+ "eslint": "10.0.2",
149
149
  "get-port": "7.1.0",
150
150
  "prettier": "3.8.1",
151
151
  "serve": "14.2.5",
152
- "typescript-eslint": "8.56.0"
152
+ "typescript-eslint": "8.56.1"
153
153
  },
154
154
  "files": [
155
155
  "bin",
@@ -161,7 +161,7 @@
161
161
  "publishConfig": {
162
162
  "access": "public"
163
163
  },
164
- "gitSha": "74232307111caed6f4d181e941df5c358f57ed28",
164
+ "gitSha": "91b038cb6c568b63684a7be0146dd12747e76060",
165
165
  "scripts": {
166
166
  "build": "tsgo -p tsconfig.build.json",
167
167
  "typescript": "tsgo -p tsconfig.json",
@@ -1,4 +1,4 @@
1
- import { includeIgnoreFile } from '@eslint/compat';
1
+ import { includeIgnoreFile, fixupConfigRules } from '@eslint/compat';
2
2
  import eslintJs from '@eslint/js';
3
3
  import { defineConfig } from 'eslint/config';
4
4
  import prettier from 'eslint-config-prettier/flat';
@@ -52,13 +52,13 @@ export function createBaseConfig({
52
52
  files: [`**/*${EXTENSION_TS}`],
53
53
  extends: defineConfig([
54
54
  eslintJs.configs.recommended,
55
- importPlugin.flatConfigs.recommended,
56
- importPlugin.flatConfigs.react,
57
- jsxA11yPlugin.flatConfigs.recommended,
58
- reactPlugin.configs.flat.recommended,
59
- reactHooks.configs.flat.recommended,
55
+ // Fix ESLint 10 compatibility for plugins that use deprecated context methods
56
+ ...fixupConfigRules([importPlugin.flatConfigs.recommended, importPlugin.flatConfigs.react]),
57
+ ...fixupConfigRules(jsxA11yPlugin.flatConfigs.recommended),
58
+ ...fixupConfigRules(reactPlugin.configs.flat.recommended),
59
+ ...fixupConfigRules(reactHooks.configs.flat.recommended),
60
60
  tseslint.configs.recommended,
61
- importPlugin.flatConfigs.typescript,
61
+ ...fixupConfigRules(importPlugin.flatConfigs.typescript),
62
62
  enableReactCompiler ? reactCompilerPluginConfigs.recommended : {},
63
63
  compatPlugin.configs['flat/recommended'],
64
64
  {
@@ -104,6 +104,18 @@ export function createBaseConfig({
104
104
  '@typescript-eslint/no-empty-object-type': 'off',
105
105
  },
106
106
  },
107
+ // New ESLint 10 rules - turned off initially to ease migration
108
+ {
109
+ name: 'ESLint 10 new rules',
110
+ rules: {
111
+ // Requires attaching caught errors as `cause` when re-throwing
112
+ 'preserve-caught-error': 'off',
113
+ // Disallows assignments that are never used
114
+ 'no-useless-assignment': 'off',
115
+ // Disallows unused vars without explicit init (use @typescript-eslint/no-unused-vars instead)
116
+ 'no-unassigned-vars': 'off',
117
+ },
118
+ },
107
119
  ]),
108
120
  },
109
121
  {
@@ -22,7 +22,6 @@ ruleTester.run('disallow-active-element-as-key-event-target', rule, {
22
22
  {
23
23
  message:
24
24
  "Don't use document.activeElement as a target for keyboard events. Prefer the actual element.",
25
- type: 'MemberExpression',
26
25
  },
27
26
  ],
28
27
  },
@@ -32,7 +31,6 @@ ruleTester.run('disallow-active-element-as-key-event-target', rule, {
32
31
  {
33
32
  message:
34
33
  "Don't use document.activeElement as a target for keyboard events. Prefer the actual element.",
35
- type: 'MemberExpression',
36
34
  },
37
35
  ],
38
36
  },
@@ -42,7 +40,6 @@ ruleTester.run('disallow-active-element-as-key-event-target', rule, {
42
40
  {
43
41
  message:
44
42
  "Don't use document.activeElement as a target for keyboard events. Prefer the actual element.",
45
- type: 'MemberExpression',
46
43
  },
47
44
  ],
48
45
  },
@@ -52,7 +49,6 @@ ruleTester.run('disallow-active-element-as-key-event-target', rule, {
52
49
  {
53
50
  message:
54
51
  "Don't use document.activeElement as a target for keyboard events. Prefer the actual element.",
55
- type: 'MemberExpression',
56
52
  },
57
53
  ],
58
54
  },
@@ -63,7 +59,6 @@ ruleTester.run('disallow-active-element-as-key-event-target', rule, {
63
59
  {
64
60
  message:
65
61
  "Don't use document.activeElement as a target for keyboard events. Prefer the actual element.",
66
- type: 'TSNonNullExpression',
67
62
  },
68
63
  ],
69
64
  },
@@ -21,7 +21,6 @@ ruleTester.run('ignore-before-comment', rule, {
21
21
  errors: [
22
22
  {
23
23
  message: '@ignore should be at the beginning of a block comment.',
24
- type: 'Block',
25
24
  },
26
25
  ],
27
26
  },
@@ -30,7 +29,6 @@ ruleTester.run('ignore-before-comment', rule, {
30
29
  errors: [
31
30
  {
32
31
  message: '@ignore should be at the beginning of a block comment.',
33
- type: 'Block',
34
32
  },
35
33
  ],
36
34
  },
@@ -39,7 +37,6 @@ ruleTester.run('ignore-before-comment', rule, {
39
37
  errors: [
40
38
  {
41
39
  message: '@ignore should be at the beginning of a block comment.',
42
- type: 'Block',
43
40
  },
44
41
  ],
45
42
  },
@@ -48,7 +45,6 @@ ruleTester.run('ignore-before-comment', rule, {
48
45
  errors: [
49
46
  {
50
47
  message: '@ignore should be at the beginning of a block comment.',
51
- type: 'Block',
52
48
  },
53
49
  ],
54
50
  },
@@ -138,7 +138,6 @@ ruleTester.run('mui-name-matches-component-name', rule, {
138
138
  {
139
139
  message:
140
140
  "Expected `name` to be 'MuiStaticDateRangePicker' but instead got 'MuiPickersDateRangePicker'.",
141
- type: 'Literal',
142
141
  },
143
142
  ],
144
143
  },
@@ -147,7 +146,6 @@ ruleTester.run('mui-name-matches-component-name', rule, {
147
146
  errors: [
148
147
  {
149
148
  message: 'Unable to find `name` property. Did you forget to pass `name`?',
150
- type: 'ObjectExpression',
151
149
  },
152
150
  ],
153
151
  },
@@ -157,7 +155,6 @@ ruleTester.run('mui-name-matches-component-name', rule, {
157
155
  {
158
156
  message:
159
157
  'Unable to resolve `name`. Please hardcode the `name` i.e. use a string literal.',
160
- type: 'Identifier',
161
158
  },
162
159
  ],
163
160
  },
@@ -166,7 +163,6 @@ ruleTester.run('mui-name-matches-component-name', rule, {
166
163
  errors: [
167
164
  {
168
165
  message: 'Unable to find component for this call.',
169
- type: 'CallExpression',
170
166
  },
171
167
  ],
172
168
  },
@@ -184,7 +180,6 @@ ruleTester.run('mui-name-matches-component-name', rule, {
184
180
  {
185
181
  message:
186
182
  "Expected `name` to be 'MuiStaticDateRangePicker' but instead got 'MuiPickersDateRangePicker'.",
187
- type: 'Literal',
188
183
  },
189
184
  ],
190
185
  },
@@ -203,7 +198,6 @@ ruleTester.run('mui-name-matches-component-name', rule, {
203
198
  {
204
199
  message:
205
200
  "Expected `name` to be 'MuiStaticDateRangePicker' but instead got 'MuiPickersDateRangePicker'.",
206
- type: 'Literal',
207
201
  },
208
202
  ],
209
203
  },
@@ -212,7 +206,6 @@ ruleTester.run('mui-name-matches-component-name', rule, {
212
206
  errors: [
213
207
  {
214
208
  message: 'Unable to find `name` property. Did you forget to pass `name`?',
215
- type: 'ObjectExpression',
216
209
  },
217
210
  ],
218
211
  },
@@ -222,7 +215,6 @@ ruleTester.run('mui-name-matches-component-name', rule, {
222
215
  {
223
216
  message:
224
217
  'Unable to resolve `name`. Please hardcode the `name` i.e. use a string literal.',
225
- type: 'Identifier',
226
218
  },
227
219
  ],
228
220
  },
@@ -231,7 +223,6 @@ ruleTester.run('mui-name-matches-component-name', rule, {
231
223
  errors: [
232
224
  {
233
225
  message: 'Unable to find component for this call.',
234
- type: 'CallExpression',
235
226
  },
236
227
  ],
237
228
  },
@@ -249,7 +240,6 @@ ruleTester.run('mui-name-matches-component-name', rule, {
249
240
  {
250
241
  message:
251
242
  "Unable to find name argument. Expected `useDatePickerDefaultizedProps(firstParameter, 'MuiComponent')`.",
252
- type: 'Identifier',
253
243
  },
254
244
  ],
255
245
  },
@@ -19,7 +19,6 @@ ruleTester.run('no-empty-box', rule, {
19
19
  errors: [
20
20
  {
21
21
  messageId: 'emptyBox',
22
- type: 'JSXOpeningElement',
23
22
  data: {
24
23
  component: 'div',
25
24
  },
@@ -31,7 +30,6 @@ ruleTester.run('no-empty-box', rule, {
31
30
  errors: [
32
31
  {
33
32
  messageId: 'emptyBox',
34
- type: 'JSXOpeningElement',
35
33
  data: {
36
34
  component: 'span',
37
35
  },
@@ -35,7 +35,6 @@ const foo = styled(Box)({
35
35
  errors: [
36
36
  {
37
37
  messageId: 'noBox',
38
- type: 'CallExpression',
39
38
  },
40
39
  ],
41
40
  output: `
@@ -59,7 +58,6 @@ const foo = styled(Box, {})({
59
58
  errors: [
60
59
  {
61
60
  messageId: 'noBox',
62
- type: 'CallExpression',
63
61
  },
64
62
  ],
65
63
  output: `
@@ -147,7 +147,9 @@ export default async function extractErrorCodes(args) {
147
147
  Object.entries(existingErrorCodes).map(([key, value]) => [value, Number(key)]),
148
148
  );
149
149
  const originalErrorCount = inverseLookupCode.size;
150
- let newErrorCodeStart = Math.max(...Array.from(inverseLookupCode.values()));
150
+ let newErrorCodeStart =
151
+ inverseLookupCode.size > 0 ? Math.max(...Array.from(inverseLookupCode.values())) : 0;
152
+
151
153
  if (newErrorCodeStart !== originalErrorCount) {
152
154
  console.warn(
153
155
  `⚠️ Warning: Detected a gap in the error codes. Current max code is ${newErrorCodeStart}, but there are only ${originalErrorCount} existing codes.\nThis can happen when codes have been removed. New codes will continue from the highest existing code.`,