@mui/internal-code-infra 0.0.3-canary.45 → 0.0.3-canary.47
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/build/eslint/material-ui/config.d.mts +2 -1
- package/build/eslint/material-ui/rules/rules-of-use-theme-variants.d.mts +1 -1
- package/package.json +7 -7
- package/src/eslint/material-ui/config.mjs +1 -0
- package/src/eslint/material-ui/rules/mui-name-matches-component-name.mjs +4 -2
- package/src/eslint/material-ui/rules/rules-of-use-theme-variants.mjs +2 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {Object} [options]
|
|
3
3
|
* @param {boolean} [options.enableReactCompiler] - Whether the config is for spec files.
|
|
4
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
4
5
|
*/
|
|
5
6
|
export function createCoreConfig(options?: {
|
|
6
7
|
enableReactCompiler?: boolean | undefined;
|
|
7
|
-
}): import("eslint
|
|
8
|
+
}): import("eslint").Linter.Config[];
|
|
@@ -3,7 +3,7 @@ declare const _default: {
|
|
|
3
3
|
type: "problem";
|
|
4
4
|
};
|
|
5
5
|
create(context: import("eslint").Rule.RuleContext): {
|
|
6
|
-
CallExpression(node: import("estree").
|
|
6
|
+
CallExpression(node: import("estree").SimpleCallExpression & import("eslint").Rule.NodeParentExtension): void;
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
9
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-code-infra",
|
|
3
|
-
"version": "0.0.3-canary.
|
|
3
|
+
"version": "0.0.3-canary.47",
|
|
4
4
|
"description": "Infra scripts and configs to be used across MUI repos.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"@babel/preset-env": "^7.28.5",
|
|
59
59
|
"@babel/preset-react": "^7.28.5",
|
|
60
60
|
"@babel/preset-typescript": "^7.28.5",
|
|
61
|
-
"@eslint/compat": "^1.4.
|
|
62
|
-
"@eslint/js": "^9.
|
|
63
|
-
"@eslint/json": "^0.
|
|
61
|
+
"@eslint/compat": "^1.4.1",
|
|
62
|
+
"@eslint/js": "^9.39.0",
|
|
63
|
+
"@eslint/json": "^0.14.0",
|
|
64
64
|
"@inquirer/confirm": "^5.1.19",
|
|
65
65
|
"@inquirer/select": "^4.4.0",
|
|
66
66
|
"@napi-rs/keyring": "^1.2.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"eslint-plugin-mocha": "^11.2.0",
|
|
86
86
|
"eslint-plugin-react": "^7.37.5",
|
|
87
87
|
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
|
|
88
|
-
"eslint-plugin-react-hooks": "^7.0.
|
|
88
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
89
89
|
"eslint-plugin-testing-library": "^7.13.3",
|
|
90
90
|
"execa": "^9.6.0",
|
|
91
91
|
"git-url-parse": "^16.1.0",
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
"@types/yargs": "^17.0.34",
|
|
125
125
|
"@typescript-eslint/parser": "^8.46.2",
|
|
126
126
|
"@typescript-eslint/rule-tester": "^8.46.2",
|
|
127
|
-
"eslint": "^9.
|
|
127
|
+
"eslint": "^9.39.0",
|
|
128
128
|
"get-port": "^7.1.0",
|
|
129
129
|
"prettier": "^3.6.2",
|
|
130
130
|
"serve": "^14.2.5",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"publishConfig": {
|
|
141
141
|
"access": "public"
|
|
142
142
|
},
|
|
143
|
-
"gitSha": "
|
|
143
|
+
"gitSha": "465383f6412395ff2f6aed28ba45fd30f6c01f37",
|
|
144
144
|
"scripts": {
|
|
145
145
|
"build": "tsc -p tsconfig.build.json",
|
|
146
146
|
"typescript": "tsc -p tsconfig.json",
|
|
@@ -305,6 +305,7 @@ const airbnbJsxA11y = {
|
|
|
305
305
|
/**
|
|
306
306
|
* @param {Object} [options]
|
|
307
307
|
* @param {boolean} [options.enableReactCompiler] - Whether the config is for spec files.
|
|
308
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
308
309
|
*/
|
|
309
310
|
export function createCoreConfig(options = {}) {
|
|
310
311
|
return defineConfig([
|
|
@@ -88,7 +88,8 @@ const rule = {
|
|
|
88
88
|
callee.name === 'useDefaultProps' || callee.name === 'useThemeProps';
|
|
89
89
|
if (isUseDefaultPropsCall) {
|
|
90
90
|
let isCalledFromCustomHook = false;
|
|
91
|
-
|
|
91
|
+
/** @type {import('eslint').Rule.Node | null} */
|
|
92
|
+
let parent = node.parent;
|
|
92
93
|
while (parent != null) {
|
|
93
94
|
if (parent.type === 'FunctionExpression' || parent.type === 'FunctionDeclaration') {
|
|
94
95
|
if (
|
|
@@ -112,7 +113,8 @@ const rule = {
|
|
|
112
113
|
|
|
113
114
|
if (nameLiteral !== null) {
|
|
114
115
|
let componentName = null;
|
|
115
|
-
|
|
116
|
+
/** @type {import('eslint').Rule.Node | null} */
|
|
117
|
+
let parent = node.parent;
|
|
116
118
|
while (parent != null && componentName === null) {
|
|
117
119
|
if (parent.type === 'FunctionExpression' || parent.type === 'FunctionDeclaration') {
|
|
118
120
|
componentName = /** @type {import('estree').Identifier} */ (parent.id).name;
|
|
@@ -32,8 +32,9 @@ export default {
|
|
|
32
32
|
* @param {import("estree").CallExpression & import("eslint").Rule.NodeParentExtension} hookCallNode
|
|
33
33
|
*/
|
|
34
34
|
function getComponentBlockNode(hookCallNode) {
|
|
35
|
+
/** @type {import("eslint").Rule.Node | null} */
|
|
35
36
|
let node = hookCallNode.parent;
|
|
36
|
-
while (node
|
|
37
|
+
while (node) {
|
|
37
38
|
if (node.type === 'BlockStatement') {
|
|
38
39
|
return node;
|
|
39
40
|
}
|