@mui/internal-code-infra 0.0.4-canary.4 → 0.0.4-canary.41

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.
Files changed (101) hide show
  1. package/README.md +19 -8
  2. package/build/babel-config.d.mts +11 -3
  3. package/build/brokenLinksChecker/crawlWorker.d.mts +1 -0
  4. package/build/brokenLinksChecker/index.d.mts +45 -2
  5. package/build/changelog/types.d.ts +1 -1
  6. package/build/cli/cmdArgosPush.d.mts +2 -2
  7. package/build/cli/cmdBuild.d.mts +2 -2
  8. package/build/cli/cmdCopyFiles.d.mts +2 -2
  9. package/build/cli/cmdExtractErrorCodes.d.mts +2 -2
  10. package/build/cli/cmdGenerateChangelog.d.mts +2 -2
  11. package/build/cli/cmdGithubAuth.d.mts +2 -2
  12. package/build/cli/cmdListWorkspaces.d.mts +4 -2
  13. package/build/cli/cmdNetlifyIgnore.d.mts +2 -2
  14. package/build/cli/cmdPublish.d.mts +4 -2
  15. package/build/cli/cmdPublishCanary.d.mts +3 -2
  16. package/build/cli/cmdPublishNewPackage.d.mts +4 -2
  17. package/build/cli/cmdSetVersionOverrides.d.mts +2 -2
  18. package/build/cli/cmdVale.d.mts +46 -0
  19. package/build/cli/cmdValidateBuiltTypes.d.mts +2 -2
  20. package/build/eslint/baseConfig.d.mts +3 -1
  21. package/build/eslint/mui/rules/disallow-react-api-in-server-components.d.mts +2 -2
  22. package/build/eslint/mui/rules/docgen-ignore-before-comment.d.mts +2 -2
  23. package/build/eslint/mui/rules/no-guarded-throw.d.mts +31 -0
  24. package/build/eslint/mui/rules/no-restricted-resolved-imports.d.mts +2 -2
  25. package/build/eslint/mui/rules/nodeEnvUtils.d.mts +18 -0
  26. package/build/markdownlint/duplicate-h1.d.mts +1 -1
  27. package/build/markdownlint/git-diff.d.mts +1 -1
  28. package/build/markdownlint/index.d.mts +1 -1
  29. package/build/markdownlint/straight-quotes.d.mts +1 -1
  30. package/build/markdownlint/table-alignment.d.mts +1 -1
  31. package/build/markdownlint/terminal-language.d.mts +1 -1
  32. package/build/remark/config.d.mts +43 -0
  33. package/build/remark/createLintTester.d.mts +10 -0
  34. package/build/remark/firstBlockHeading.d.mts +4 -0
  35. package/build/remark/gitDiff.d.mts +2 -0
  36. package/build/remark/noSpaceInLinks.d.mts +2 -0
  37. package/build/remark/straightQuotes.d.mts +2 -0
  38. package/build/remark/tableAlignment.d.mts +2 -0
  39. package/build/remark/terminalLanguage.d.mts +2 -0
  40. package/build/utils/build.d.mts +3 -3
  41. package/build/utils/github.d.mts +1 -1
  42. package/build/utils/pnpm.d.mts +68 -2
  43. package/build/utils/testUtils.d.mts +7 -0
  44. package/package.json +59 -32
  45. package/src/babel-config.mjs +9 -3
  46. package/src/brokenLinksChecker/__fixtures__/static-site/index.html +1 -0
  47. package/src/brokenLinksChecker/__fixtures__/static-site/invalid-html.html +15 -0
  48. package/src/brokenLinksChecker/crawlWorker.mjs +212 -0
  49. package/src/brokenLinksChecker/index.mjs +215 -164
  50. package/src/brokenLinksChecker/index.test.ts +43 -13
  51. package/src/changelog/categorizeCommits.test.ts +5 -5
  52. package/src/changelog/fetchChangelogs.mjs +6 -2
  53. package/src/changelog/parseCommitLabels.test.ts +5 -5
  54. package/src/changelog/renderChangelog.mjs +1 -1
  55. package/src/changelog/types.ts +1 -1
  56. package/src/cli/cmdListWorkspaces.mjs +9 -2
  57. package/src/cli/cmdNetlifyIgnore.mjs +4 -88
  58. package/src/cli/cmdPublish.mjs +51 -14
  59. package/src/cli/cmdPublishCanary.mjs +139 -107
  60. package/src/cli/cmdPublishNewPackage.mjs +27 -6
  61. package/src/cli/cmdVale.mjs +513 -0
  62. package/src/cli/cmdVale.test.mjs +644 -0
  63. package/src/cli/index.mjs +2 -0
  64. package/src/eslint/baseConfig.mjs +45 -20
  65. package/src/eslint/docsConfig.mjs +2 -1
  66. package/src/eslint/jsonConfig.mjs +2 -1
  67. package/src/eslint/mui/config.mjs +20 -1
  68. package/src/eslint/mui/index.mjs +2 -0
  69. package/src/eslint/mui/rules/no-guarded-throw.mjs +115 -0
  70. package/src/eslint/mui/rules/no-guarded-throw.test.mjs +206 -0
  71. package/src/eslint/mui/rules/nodeEnvUtils.mjs +52 -0
  72. package/src/eslint/mui/rules/require-dev-wrapper.mjs +25 -40
  73. package/src/eslint/testConfig.mjs +2 -1
  74. package/src/estree-typescript.d.ts +1 -1
  75. package/src/remark/config.mjs +157 -0
  76. package/src/remark/createLintTester.mjs +19 -0
  77. package/src/remark/firstBlockHeading.mjs +87 -0
  78. package/src/remark/firstBlockHeading.test.mjs +107 -0
  79. package/src/remark/gitDiff.mjs +43 -0
  80. package/src/remark/gitDiff.test.mjs +45 -0
  81. package/src/remark/noSpaceInLinks.mjs +42 -0
  82. package/src/remark/noSpaceInLinks.test.mjs +22 -0
  83. package/src/remark/straightQuotes.mjs +31 -0
  84. package/src/remark/straightQuotes.test.mjs +25 -0
  85. package/src/remark/tableAlignment.mjs +23 -0
  86. package/src/remark/tableAlignment.test.mjs +28 -0
  87. package/src/remark/terminalLanguage.mjs +19 -0
  88. package/src/remark/terminalLanguage.test.mjs +17 -0
  89. package/src/untyped-plugins.d.ts +11 -11
  90. package/src/utils/build.test.mjs +546 -575
  91. package/src/utils/pnpm.mjs +192 -3
  92. package/src/utils/pnpm.test.mjs +580 -0
  93. package/src/utils/testUtils.mjs +18 -0
  94. package/src/utils/typescript.test.mjs +249 -272
  95. package/vale/.vale.ini +1 -0
  96. package/vale/styles/MUI/CorrectReferenceAllCases.yml +43 -0
  97. package/vale/styles/MUI/CorrectRererenceCased.yml +14 -0
  98. package/vale/styles/MUI/GoogleLatin.yml +11 -0
  99. package/vale/styles/MUI/MuiBrandName.yml +22 -0
  100. package/vale/styles/MUI/NoBritish.yml +112 -0
  101. package/vale/styles/MUI/NoCompanyName.yml +17 -0
package/README.md CHANGED
@@ -35,24 +35,35 @@ This is stored in the `docs` top-level directory.
35
35
 
36
36
  ### Adding and publishing new packages
37
37
 
38
- Whenever news packages are added to the repo (that will get published to npm) or a private package is turned into a public one, follow the below steps before invoking the publish workflow of the previous section.
38
+ Whenever new packages are added to the repo (that will get published to npm) or a private package is turned into a public one, follow the below steps before invoking the publish workflow of the previous section.
39
39
 
40
- 1. Goto your repo's code base on your system, open terminal and run:
40
+ 1. Go to your repo's code base on your system, then log in to npm using
41
+
42
+ ```bash
43
+ npm login
44
+ ```
45
+
46
+ 2. Once logged-in, open terminal and run:
41
47
 
42
48
  ```bash
43
49
  pnpm code-infra publish-new-package
44
50
  ```
45
51
 
46
52
  This command detects the new public packages in the repo and asks for your confirmation before publishing them to the npm registry. Add the `--dryRun` flag to skip the actual publishing.
53
+ If publishing fails with npm asking for `otp`, run the command again with 6 digit auth code from your authenticator app where you've added npm; Google Authenticator, Authy or similar:
54
+
55
+ ```bash
56
+ pnpm code-infra publish-new-package --otp=123456
57
+ ```
47
58
 
48
- 2. Goto the settings link for each packages, ie, https://www.npmjs.com/package/<pkg-name>/access , and setup `Trusted Publisher`.
49
- 3. In `Select your publisher` step in the above link, click on the `Github Actions` button to configure Github actions based trusted publishing.
50
- 4. Fill in the details of the repo -
59
+ 3. Go to the settings link for each package, e.g., `https://www.npmjs.com/package/<pkg-name>/access`, and setup `Trusted Publisher`.
60
+ 4. In the `Select your publisher` step in the above link, click on the `GitHub Actions` button to configure GitHub Actions-based trusted publishing.
61
+ 5. Fill in the details of the repo -
51
62
  1. `Organization or user` as `mui`,
52
63
  2. `Repository` as per the new package
53
64
  3. `Workflow filename*` should be `publish.yml`
54
- 4. `Environment name` should be `npm-publish`
55
- 5. In the `Publishing access` section, toggle the recommended option of `Require two-factor authentication and disallow tokens`.
56
- 6. Finally, save the changes by clicking on `Update Package Settings` button.
65
+ 4. `Environment name` should be `npm-publish` or `npm-publish-internal` based on whether the package is user facing package or internal package respectively.
66
+ 6. In the `Publishing access` section, toggle the recommended option of `Require two-factor authentication and disallow tokens`.
67
+ 7. Finally, save the changes by clicking on `Update Package Settings` button.
57
68
 
58
69
  After following these steps, the `Publish` workflow can be invoked again.
@@ -1,3 +1,7 @@
1
+ export type ReactCompilationMode = 'annotation' | 'syntax' | 'infer' | 'all';
2
+ /**
3
+ * @typedef {'annotation' | 'syntax' | 'infer' | 'all'} ReactCompilationMode
4
+ */
1
5
  /**
2
6
  * @param {Object} param0
3
7
  * @param {boolean} [param0.debug]
@@ -8,10 +12,11 @@
8
12
  * @param {string | null} param0.outExtension - Specify the output file extension.
9
13
  * @param {string} param0.runtimeVersion
10
14
  * @param {string} [param0.reactCompilerReactVersion]
11
- * @param {string} [param0.reactCompilerMode]
15
+ * @param {ReactCompilationMode} [param0.reactCompilerMode]
16
+ * @param {{ allowedCallees?: Record<string, string[]> }} [param0.displayName] - Options for the display name plugin.
12
17
  * @returns {import('@babel/core').TransformOptions} The base Babel configuration.
13
18
  */
14
- export declare function getBaseConfig({ debug, optimizeClsx, removePropTypes, noResolveImports, bundle, runtimeVersion, outExtension, reactCompilerReactVersion, reactCompilerMode }: {
19
+ export declare function getBaseConfig({ debug, optimizeClsx, removePropTypes, noResolveImports, bundle, runtimeVersion, outExtension, reactCompilerReactVersion, reactCompilerMode, displayName }: {
15
20
  debug?: boolean;
16
21
  optimizeClsx?: boolean;
17
22
  removePropTypes?: boolean;
@@ -20,7 +25,10 @@ export declare function getBaseConfig({ debug, optimizeClsx, removePropTypes, no
20
25
  outExtension: string | null;
21
26
  runtimeVersion: string;
22
27
  reactCompilerReactVersion?: string;
23
- reactCompilerMode?: string;
28
+ reactCompilerMode?: ReactCompilationMode;
29
+ displayName?: {
30
+ allowedCallees?: Record<string, string[]>;
31
+ };
24
32
  }): import('@babel/core').TransformOptions;
25
33
  export type Options = {
26
34
  bundle?: 'esm' | 'cjs';
@@ -0,0 +1 @@
1
+ export {};
@@ -2,6 +2,24 @@ export type LinkStructure = Map<string, Set<string>>;
2
2
  export type SerializedLinkStructure = {
3
3
  targets: Record<string, string[]>;
4
4
  };
5
+ export type CrawlWorkerInput = {
6
+ pageUrl: string;
7
+ options: ResolvedCrawlOptions;
8
+ };
9
+ export type CrawlWorkerPageData = {
10
+ url: string;
11
+ status: number;
12
+ targets: string[];
13
+ contentType: string;
14
+ };
15
+ export type CrawlWorkerOutput = {
16
+ pageData: CrawlWorkerPageData;
17
+ links: Link[];
18
+ htmlValidateResults: {
19
+ pageUrl: string;
20
+ results: import('html-validate').Result[];
21
+ } | null;
22
+ };
5
23
  export type PageData = {
6
24
  url: string;
7
25
  status: number;
@@ -36,15 +54,40 @@ export type CrawlOptions = {
36
54
  concurrency?: number;
37
55
  seedUrls?: string[];
38
56
  ignores?: IgnoreRule[];
57
+ htmlValidate?: HtmlValidateOption;
58
+ verbose?: boolean;
39
59
  };
40
- export type ResolvedCrawlOptions = Omit<Required<CrawlOptions>, 'ignores'> & {
60
+ export type HtmlValidateOverride = {
61
+ path?: (string | RegExp) | (string | RegExp)[];
62
+ config: true | import('html-validate').ConfigData;
63
+ };
64
+ export type HtmlValidateOption = boolean | import('html-validate').ConfigData | HtmlValidateOverride[];
65
+ export type ResolvedHtmlValidateEntry = {
66
+ path: (string | RegExp)[] | undefined;
67
+ config: import('html-validate').ConfigData;
68
+ };
69
+ export type ResolvedCrawlOptions = Omit<Required<CrawlOptions>, 'ignores' | 'htmlValidate'> & {
41
70
  ignores: NormalizedIgnoreRule[];
71
+ htmlValidate: ResolvedHtmlValidateEntry[];
42
72
  };
43
- export type Issue = {
73
+ export type BrokenLinkIssue = {
44
74
  type: 'broken-link' | 'broken-target';
45
75
  message: string;
46
76
  link: Link;
47
77
  };
78
+ export type HtmlValidateIssue = {
79
+ type: 'html-validate';
80
+ message: string;
81
+ pageUrl: string;
82
+ ruleId: string;
83
+ severity: number;
84
+ location: {
85
+ line: number;
86
+ column: number;
87
+ };
88
+ selector: string | null;
89
+ };
90
+ export type Issue = BrokenLinkIssue | HtmlValidateIssue;
48
91
  export type CrawlResult = {
49
92
  links: Set<Link>;
50
93
  pages: Map<string, PageData>;
@@ -212,7 +212,7 @@ export interface IntroConfig {
212
212
  * - {{teamCount}}: Number of team members
213
213
  * - {{communityCount}}: Number of community contributors
214
214
  *
215
- * Example: "We'd like to extend a big thank you to the {{contributorCount}} contributors who made this release possible"
215
+ * Example: "A big thanks to the {{contributorCount}} contributors who made this release possible."
216
216
  *
217
217
  * Set to `false` or omit to disable the thank you message.
218
218
  */
@@ -8,5 +8,5 @@ export type Args = {
8
8
  * @property {boolean} [verbose] - Run with verbose logging
9
9
  * @property {string} folder - Screenshots folder path
10
10
  */
11
- declare const _default: import("yargs").CommandModule<{}, Args>;
12
- export default /** @type {import('yargs').CommandModule<{}, Args>} */ _default;
11
+ declare const _default: import('yargs').CommandModule<{}, Args>;
12
+ export default _default;
@@ -14,5 +14,5 @@ export type Args = {
14
14
  tsgo?: boolean;
15
15
  flat?: boolean;
16
16
  };
17
- declare const _default: import("yargs").CommandModule<{}, Args>;
18
- export default /** @type {import('yargs').CommandModule<{}, Args>} */ _default;
17
+ declare const _default: import('yargs').CommandModule<{}, Args>;
18
+ export default _default;
@@ -4,5 +4,5 @@ export type Args = {
4
4
  glob?: string[];
5
5
  files?: string[];
6
6
  };
7
- declare const _default: import("yargs").CommandModule<{}, Args>;
8
- export default /** @type {import('yargs').CommandModule<{}, Args>} */ _default;
7
+ declare const _default: import('yargs').CommandModule<{}, Args>;
8
+ export default _default;
@@ -2,5 +2,5 @@ export type Args = import('../utils/extractErrorCodes.mjs').Args;
2
2
  /**
3
3
  * @typedef {import('../utils/extractErrorCodes.mjs').Args} Args
4
4
  */
5
- declare const _default: import("yargs").CommandModule<{}, import("../utils/extractErrorCodes.mjs").Args>;
6
- export default /** @type {import('yargs').CommandModule<{}, Args>} */ _default;
5
+ declare const _default: import('yargs').CommandModule<{}, Args>;
6
+ export default _default;
@@ -13,5 +13,5 @@ export type Args = {
13
13
  * @property {string} releaseVersion The version number for the new release
14
14
  * @property {string} cwd The current working directory to run the command in
15
15
  */
16
- declare const _default: import("yargs").CommandModule<{}, Args>;
17
- export default /** @type {import('yargs').CommandModule<{}, Args>} */ _default;
16
+ declare const _default: import('yargs').CommandModule<{}, Args>;
17
+ export default _default;
@@ -7,5 +7,5 @@ export type Args = {
7
7
  * @property {boolean} authorize
8
8
  * @property {boolean} clear
9
9
  */
10
- declare const _default: import("yargs").CommandModule<{}, Args>;
11
- export default /** @type {import('yargs').CommandModule<{}, Args>} */ _default;
10
+ declare const _default: import('yargs').CommandModule<{}, Args>;
11
+ export default _default;
@@ -4,12 +4,14 @@ export type Args = {
4
4
  publicOnly?: boolean;
5
5
  output?: 'json' | 'path' | 'name' | 'publish-dir';
6
6
  sinceRef?: string;
7
+ filter?: string[];
7
8
  };
8
9
  /**
9
10
  * @typedef {Object} Args
10
11
  * @property {boolean} [publicOnly] - Whether to filter to only public packages
11
12
  * @property {'json'|'path'|'name'|'publish-dir'} [output] - Output format (name, path, or json)
12
13
  * @property {string} [sinceRef] - Git reference to filter changes since
14
+ * @property {string[]} [filter] - Same as filtering packages with --filter in pnpm. Only include packages matching the filter. See https://pnpm.io/filtering.
13
15
  */
14
- declare const _default: import("yargs").CommandModule<{}, Args>;
15
- export default /** @type {import('yargs').CommandModule<{}, Args>} */ _default;
16
+ declare const _default: import('yargs').CommandModule<{}, Args>;
17
+ export default _default;
@@ -3,5 +3,5 @@ export type Args = {
3
3
  workspaces: string[];
4
4
  check?: boolean;
5
5
  };
6
- declare const _default: import("yargs").CommandModule<{}, Args>;
7
- export default /** @type {import('yargs').CommandModule<{}, Args>} */ _default;
6
+ declare const _default: import('yargs').CommandModule<{}, Args>;
7
+ export default _default;
@@ -1,12 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  export type PublicPackage = import('../utils/pnpm.mjs').PublicPackage;
3
3
  export type PublishOptions = import('../utils/pnpm.mjs').PublishOptions;
4
+ export type PublishSummaryEntry = import('../utils/pnpm.mjs').PublishSummaryEntry;
4
5
  export type Args = {
5
6
  dry-run: boolean;
6
7
  github-release: boolean;
7
8
  tag: string;
8
9
  ci: boolean;
9
10
  sha?: string;
11
+ filter?: string[];
10
12
  };
11
- declare const _default: import("yargs").CommandModule<{}, Args>;
12
- export default /** @type {import('yargs').CommandModule<{}, Args>} */ _default;
13
+ declare const _default: import('yargs').CommandModule<{}, Args>;
14
+ export default _default;
@@ -5,11 +5,12 @@ export type PublishOptions = import('../utils/pnpm.mjs').PublishOptions;
5
5
  export type Args = {
6
6
  dryRun?: boolean;
7
7
  githubRelease?: boolean;
8
+ filter?: string[];
8
9
  };
9
10
  export type Commit = {
10
11
  sha: string;
11
12
  message: string;
12
13
  author: string;
13
14
  };
14
- declare const _default: import("yargs").CommandModule<{}, Args>;
15
- export default /** @type {import('yargs').CommandModule<{}, Args>} */ _default;
15
+ declare const _default: import('yargs').CommandModule<{}, Args>;
16
+ export default _default;
@@ -1,9 +1,11 @@
1
1
  export type Args = {
2
2
  dryRun?: boolean;
3
+ otp?: string;
3
4
  };
4
5
  /**
5
6
  * @typedef {Object} Args
6
7
  * @property {boolean} [dryRun] If true, will only log the commands without executing them
8
+ * @property {string} [otp] 6 digit auth code to forward to npm for two-factor authentication
7
9
  */
8
- declare const _default: import("yargs").CommandModule<{}, Args>;
9
- export default /** @type {import('yargs').CommandModule<{}, Args>} */ _default;
10
+ declare const _default: import('yargs').CommandModule<{}, Args>;
11
+ export default _default;
@@ -2,5 +2,5 @@
2
2
  export type Args = {
3
3
  pkg?: string[];
4
4
  };
5
- declare const _default: import("yargs").CommandModule<{}, Args>;
6
- export default /** @type {import('yargs').CommandModule<{}, Args>} */ _default;
5
+ declare const _default: import('yargs').CommandModule<{}, Args>;
6
+ export default _default;
@@ -0,0 +1,46 @@
1
+ export type ValeOS = 'Linux' | 'macOS' | 'Windows';
2
+ export type ValeArch = '64-bit' | 'arm64';
3
+ /**
4
+ * Extracts the replacement text from a vale alert.
5
+ * Returns null if no replacement can be determined.
6
+ * @param {{ Action: { Name: string; Params: string[] | null }; Message: string }} alert
7
+ * @returns {string | null}
8
+ */
9
+ export declare function getReplacementText(alert: {
10
+ Action: {
11
+ Name: string;
12
+ Params: string[] | null;
13
+ };
14
+ Message: string;
15
+ }): string | null;
16
+ /**
17
+ * Applies auto-fixes from vale alerts to the source files.
18
+ * Processes alerts in reverse order within each line to preserve column positions.
19
+ * @param {Record<string, Array<{ Action: { Name: string; Params: string[] | null }; Span: [number, number]; Check: string; Message: string; Severity: string; Match: string; Line: number }>>} results
20
+ * @param {'all' | 'error'} fixLevel
21
+ * @returns {Promise<{ fixed: number; skipped: number }>}
22
+ */
23
+ export declare function applyFixes(results: Record<string, Array<{
24
+ Action: {
25
+ Name: string;
26
+ Params: string[] | null;
27
+ };
28
+ Span: [number, number];
29
+ Check: string;
30
+ Message: string;
31
+ Severity: string;
32
+ Match: string;
33
+ Line: number;
34
+ }>>, fixLevel: 'all' | 'error'): Promise<{
35
+ fixed: number;
36
+ skipped: number;
37
+ }>;
38
+ export type Args = {
39
+ 'vale-version': string;
40
+ 'auto-fix': 'all' | 'error' | undefined;
41
+ };
42
+ /**
43
+ * @typedef {{ 'vale-version': string; 'auto-fix': 'all' | 'error' | undefined; }} Args
44
+ */
45
+ declare const _default: import('yargs').CommandModule<{}, Args>;
46
+ export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("yargs").CommandModule<{}, {}>;
2
- export default /** @type {import('yargs').CommandModule<{}, {}>} */ _default;
1
+ declare const _default: import('yargs').CommandModule<{}, {}>;
2
+ export default _default;
@@ -3,12 +3,14 @@
3
3
  * @param {boolean} [params.enableReactCompiler] - Whether to enable React Compiler.
4
4
  * @param {boolean} [params.consistentTypeImports] - Whether to enforce consistent type imports.
5
5
  * @param {boolean} [params.materialUi] - Whether to enable Material UI specific rules (mui/material-ui-*).
6
+ * @param {boolean} [params.markdown] - Whether to enable markdown/MDX linting via `eslint-plugin-mdx`. Opt-in so dependents can adopt on their own schedule.
6
7
  * @param {string} [params.baseDirectory] - The base directory for the configuration.
7
8
  * @returns {import('eslint').Linter.Config[]}
8
9
  */
9
- export declare function createBaseConfig({ enableReactCompiler, consistentTypeImports, materialUi, baseDirectory }?: {
10
+ export declare function createBaseConfig({ enableReactCompiler, consistentTypeImports, materialUi, markdown, baseDirectory }?: {
10
11
  enableReactCompiler?: boolean;
11
12
  consistentTypeImports?: boolean;
12
13
  materialUi?: boolean;
14
+ markdown?: boolean;
13
15
  baseDirectory?: string;
14
16
  }): import('eslint').Linter.Config[];
@@ -1,2 +1,2 @@
1
- declare const _default: import("eslint").Rule.RuleModule;
2
- export default /** @type {import('eslint').Rule.RuleModule} */ _default;
1
+ declare const _default: import('eslint').Rule.RuleModule;
2
+ export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("eslint").Rule.RuleModule;
2
- export default /** @type {import('eslint').Rule.RuleModule} */ _default;
1
+ declare const _default: import('eslint').Rule.RuleModule;
2
+ export default _default;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * ESLint rule that disallows throw statements guarded by process.env.NODE_ENV checks.
3
+ *
4
+ * NODE_ENV guards cause throw statements to only execute in certain environments,
5
+ * leading to inconsistent control flow between development and production. Whether
6
+ * the guard excludes production (tree-shaking the throw away) or targets production
7
+ * specifically, the result is environment-dependent behavior that should be avoided.
8
+ *
9
+ * The rule stops at function boundaries, so throws inside functions defined within
10
+ * a NODE_ENV guard are not flagged, as the function may be called from other contexts.
11
+ *
12
+ * @example
13
+ * // Invalid - throw only in development, removed in production
14
+ * if (process.env.NODE_ENV !== 'production') {
15
+ * throw new Error('Missing required prop');
16
+ * }
17
+ *
18
+ * @example
19
+ * // Invalid - throw only in production
20
+ * if (process.env.NODE_ENV === 'production') {
21
+ * throw new Error('Production-only error');
22
+ * }
23
+ *
24
+ * @example
25
+ * // Valid - unconditional throw
26
+ * throw new Error('Something went wrong');
27
+ *
28
+ * @type {import('eslint').Rule.RuleModule}
29
+ */
30
+ declare const rule: import('eslint').Rule.RuleModule;
31
+ export default rule;
@@ -11,5 +11,5 @@ export type PatternConfig = {
11
11
  * Creates an ESLint rule that restricts imports based on their resolved paths.
12
12
  * Works with both ESM (import) and CommonJS (require) imports.
13
13
  */
14
- declare const _default: import("eslint").Rule.RuleModule;
15
- export default /** @type {import('eslint').Rule.RuleModule} */ _default;
14
+ declare const _default: import('eslint').Rule.RuleModule;
15
+ export default _default;
@@ -21,3 +21,21 @@ export declare function isLiteralEq(node: import('estree').Node, value: string):
21
21
  * @returns {boolean}
22
22
  */
23
23
  export declare function isLiteralNeq(node: import('estree').Node, value: string): boolean;
24
+ /**
25
+ * Checks if a BinaryExpression compares process.env.NODE_ENV with === or !==
26
+ * @param {import('estree').Node} node
27
+ * @returns {boolean}
28
+ */
29
+ export declare function isNodeEnvBinaryComparison(node: import('estree').Node): boolean;
30
+ /**
31
+ * Walks up the parent chain and checks if the node is inside an IfStatement
32
+ * whose test is a NODE_ENV binary comparison.
33
+ * If a callback is provided, it is called with the IfStatement and the direct
34
+ * child that leads to the node. The function returns true only when the callback
35
+ * returns true. Without a callback the function returns true when the node is
36
+ * inside any branch (consequent or alternate) of such an IfStatement.
37
+ * @param {import('eslint').Rule.Node} node
38
+ * @param {(ifStatement: import('estree').IfStatement & import('eslint').Rule.NodeParentExtension, child: import('eslint').Rule.Node) => boolean} [callback]
39
+ * @returns {boolean}
40
+ */
41
+ export declare function isInsideNodeEnvCheck(node: import('eslint').Rule.Node, callback?: (ifStatement: import('estree').IfStatement & import('eslint').Rule.NodeParentExtension, child: import('eslint').Rule.Node) => boolean): boolean;
@@ -51,6 +51,6 @@ declare const _default: {
51
51
  * @param {import('./duplicate-h1.mjs').MdParams} params
52
52
  * @param {import('./duplicate-h1.mjs').OnError} onError
53
53
  */
54
- function: (params: MdParams, onError: OnError) => void;
54
+ function: (params: import('./duplicate-h1.mjs').MdParams, onError: import('./duplicate-h1.mjs').OnError) => void;
55
55
  };
56
56
  export default _default;
@@ -6,6 +6,6 @@ declare const _default: {
6
6
  * @param {import('./duplicate-h1.mjs').MdParams} params
7
7
  * @param {import('./duplicate-h1.mjs').OnError} onError
8
8
  */
9
- function: (params: import("./duplicate-h1.mjs").MdParams, onError: import("./duplicate-h1.mjs").OnError) => void;
9
+ function: (params: import('./duplicate-h1.mjs').MdParams, onError: import('./duplicate-h1.mjs').OnError) => void;
10
10
  };
11
11
  export default _default;
@@ -46,7 +46,7 @@ export declare function createBaseConfig(options?: {
46
46
  names: string[];
47
47
  description: string;
48
48
  tags: string[];
49
- function: (params: import("./duplicate-h1.mjs").MdParams, onError: import("./duplicate-h1.mjs").OnError) => void;
49
+ function: (params: import('./duplicate-h1.mjs').MdParams, onError: import('./duplicate-h1.mjs').OnError) => void;
50
50
  }[];
51
51
  ignores: string[];
52
52
  };
@@ -6,6 +6,6 @@ declare const _default: {
6
6
  * @param {import('./duplicate-h1.mjs').MdParams} params
7
7
  * @param {import('./duplicate-h1.mjs').OnError} onError
8
8
  */
9
- function: (params: import("./duplicate-h1.mjs").MdParams, onError: import("./duplicate-h1.mjs").OnError) => void;
9
+ function: (params: import('./duplicate-h1.mjs').MdParams, onError: import('./duplicate-h1.mjs').OnError) => void;
10
10
  };
11
11
  export default _default;
@@ -6,6 +6,6 @@ declare const _default: {
6
6
  * @param {import('./duplicate-h1.mjs').MdParams} params
7
7
  * @param {import('./duplicate-h1.mjs').OnError} onError
8
8
  */
9
- function: (params: import("./duplicate-h1.mjs").MdParams, onError: import("./duplicate-h1.mjs").OnError) => void;
9
+ function: (params: import('./duplicate-h1.mjs').MdParams, onError: import('./duplicate-h1.mjs').OnError) => void;
10
10
  };
11
11
  export default _default;
@@ -6,6 +6,6 @@ declare const _default: {
6
6
  * @param {import('./duplicate-h1.mjs').MdParams} params
7
7
  * @param {import('./duplicate-h1.mjs').OnError} onError
8
8
  */
9
- function: (params: import("./duplicate-h1.mjs").MdParams, onError: import("./duplicate-h1.mjs").OnError) => void;
9
+ function: (params: import('./duplicate-h1.mjs').MdParams, onError: import('./duplicate-h1.mjs').OnError) => void;
10
10
  };
11
11
  export default _default;
@@ -0,0 +1,43 @@
1
+ import remarkGfm from 'remark-gfm';
2
+ import remarkLint from 'remark-lint';
3
+ /**
4
+ * Returns a remark preset wiring the MUI-authored remark-lint plugins together
5
+ * with a curated set of community plugins. Drop this into `.remarkrc.mjs`:
6
+ *
7
+ * ```js
8
+ * import { createRemarkConfig } from '@mui/internal-code-infra/remark';
9
+ * export default createRemarkConfig();
10
+ * ```
11
+ *
12
+ * Pass `overrides` to scope rule changes to a glob. Each entry's `rules` map
13
+ * is keyed by the rule name (the key used in `RULES`); `false` disables the
14
+ * rule for matching files, a settings tuple replaces its severity/options:
15
+ *
16
+ * ```js
17
+ * createRemarkConfig({
18
+ * overrides: [
19
+ * { files: 'docs/special/**', rules: { 'mui-no-space-in-links': false } },
20
+ * { files: '**\/CHANGELOG.md', rules: { 'heading-style': ['warn', 'atx'] } },
21
+ * ],
22
+ * });
23
+ * ```
24
+ *
25
+ * @param {Object} [options]
26
+ * @param {Array<{ files: string | string[], rules: Record<string, false | unknown[]> }>} [options.overrides]
27
+ */
28
+ export declare function createRemarkConfig({ overrides }?: {
29
+ overrides?: Array<{
30
+ files: string | string[];
31
+ rules: Record<string, false | unknown[]>;
32
+ }>;
33
+ }): {
34
+ settings: {
35
+ bullet: string;
36
+ emphasis: string;
37
+ fence: string;
38
+ listItemIndent: string;
39
+ resourceLink: boolean;
40
+ rule: string;
41
+ };
42
+ plugins: (any[] | typeof remarkGfm | typeof remarkLint)[];
43
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @param {unknown} plugin
3
+ * @param {unknown} [options]
4
+ * @returns {(input: string) => Array<{ reason: string, line: number, column: number }>}
5
+ */
6
+ export declare function createLintTester(plugin: unknown, options?: unknown): (input: string) => Array<{
7
+ reason: string;
8
+ line: number;
9
+ column: number;
10
+ }>;
@@ -0,0 +1,4 @@
1
+ declare const remarkLintMuiFirstBlockHeading: import("unified-lint-rule").Plugin<import("mdast").Root, {
2
+ frontMatterTitle?: RegExp | false;
3
+ } | undefined>;
4
+ export default remarkLintMuiFirstBlockHeading;
@@ -0,0 +1,2 @@
1
+ declare const remarkLintMuiGitDiff: import("unified-lint-rule").Plugin<import("mdast").Root, unknown>;
2
+ export default remarkLintMuiGitDiff;
@@ -0,0 +1,2 @@
1
+ declare const remarkLintMuiNoSpaceInLinks: import("unified-lint-rule").Plugin<import("mdast").Root, unknown>;
2
+ export default remarkLintMuiNoSpaceInLinks;
@@ -0,0 +1,2 @@
1
+ declare const remarkLintMuiStraightQuotes: import("unified-lint-rule").Plugin<import("mdast").Root, unknown>;
2
+ export default remarkLintMuiStraightQuotes;
@@ -0,0 +1,2 @@
1
+ declare const remarkLintMuiTableAlignment: import("unified-lint-rule").Plugin<import("mdast").Root, unknown>;
2
+ export default remarkLintMuiTableAlignment;
@@ -0,0 +1,2 @@
1
+ declare const remarkLintMuiTerminalLanguage: import("unified-lint-rule").Plugin<import("mdast").Root, unknown>;
2
+ export default remarkLintMuiTerminalLanguage;
@@ -37,9 +37,9 @@ export declare function createPackageExports({ exports: packageExports, bundles,
37
37
  isFlat?: boolean;
38
38
  packageType?: 'module' | 'commonjs';
39
39
  }): Promise<{
40
- main?: string | undefined;
41
- types?: string | undefined;
42
- exports: import("../cli/packageJson").PackageJson.ExportConditions;
40
+ main?: string;
41
+ types?: string;
42
+ exports: import('../cli/packageJson').PackageJson.ExportConditions;
43
43
  }>;
44
44
  /**
45
45
  * @param {Object} param0
@@ -20,7 +20,7 @@ export type GitHubAppAuthenticationWithRefreshToken = {
20
20
  * @property {string} [refreshTokenExpiresAt] - ISO string when the refresh token expires
21
21
  */
22
22
  export declare function persistentAuthStrategy(): {
23
- hook: (request: import("@octokit/types").RequestInterface<object>, route: string, parameters: import("@octokit/types").RequestParameters) => Promise<import("@octokit/types").OctokitResponse<any, number>>;
23
+ hook: (request: import('@octokit/types').RequestInterface, route: import('@octokit/types').Route, parameters: import('@octokit/types').RequestParameters) => Promise<import("@octokit/types").OctokitResponse<any, number>>;
24
24
  };
25
25
  /**
26
26
  * @param {Object} [options]