@docusaurus/eslint-plugin 3.10.2 → 4.0.0-canary-6808

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/lib/index.d.ts CHANGED
@@ -4,17 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- declare const _default: {
8
- rules: {
9
- 'no-untranslated-text': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"translateChildren", [{
10
- ignoredStrings: string[];
11
- }], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
12
- 'string-literal-i18n-messages': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"translateChildren" | "translateArg", [], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
13
- 'no-html-links': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"link", [{
14
- ignoreFullyResolved: boolean;
15
- }], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
16
- 'prefer-docusaurus-heading': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"headings", [], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
17
- };
7
+ declare const compatPlugin: {
18
8
  configs: {
19
9
  recommended: {
20
10
  plugins: string[];
@@ -33,6 +23,100 @@ declare const _default: {
33
23
  '@docusaurus/prefer-docusaurus-heading': string;
34
24
  };
35
25
  };
26
+ flat: {
27
+ recommended: {
28
+ plugins: {
29
+ '@docusaurus': {
30
+ meta: {
31
+ name: string;
32
+ version: string;
33
+ namespace: string;
34
+ };
35
+ rules: {
36
+ 'no-untranslated-text': import("@typescript-eslint/utils/ts-eslint").RuleModule<"translateChildren", [{
37
+ ignoredStrings: string[];
38
+ }], import("./util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
39
+ name: string;
40
+ };
41
+ 'string-literal-i18n-messages': import("@typescript-eslint/utils/ts-eslint").RuleModule<"translateChildren" | "translateArg", [], import("./util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
42
+ name: string;
43
+ };
44
+ 'no-html-links': import("@typescript-eslint/utils/ts-eslint").RuleModule<"link", [{
45
+ ignoreFullyResolved: boolean;
46
+ }], import("./util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
47
+ name: string;
48
+ };
49
+ 'prefer-docusaurus-heading': import("@typescript-eslint/utils/ts-eslint").RuleModule<"headings", [], import("./util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
50
+ name: string;
51
+ };
52
+ };
53
+ };
54
+ };
55
+ rules: {
56
+ '@docusaurus/string-literal-i18n-messages': string;
57
+ '@docusaurus/no-html-links': string;
58
+ '@docusaurus/prefer-docusaurus-heading': string;
59
+ };
60
+ };
61
+ all: {
62
+ plugins: {
63
+ '@docusaurus': {
64
+ meta: {
65
+ name: string;
66
+ version: string;
67
+ namespace: string;
68
+ };
69
+ rules: {
70
+ 'no-untranslated-text': import("@typescript-eslint/utils/ts-eslint").RuleModule<"translateChildren", [{
71
+ ignoredStrings: string[];
72
+ }], import("./util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
73
+ name: string;
74
+ };
75
+ 'string-literal-i18n-messages': import("@typescript-eslint/utils/ts-eslint").RuleModule<"translateChildren" | "translateArg", [], import("./util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
76
+ name: string;
77
+ };
78
+ 'no-html-links': import("@typescript-eslint/utils/ts-eslint").RuleModule<"link", [{
79
+ ignoreFullyResolved: boolean;
80
+ }], import("./util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
81
+ name: string;
82
+ };
83
+ 'prefer-docusaurus-heading': import("@typescript-eslint/utils/ts-eslint").RuleModule<"headings", [], import("./util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
84
+ name: string;
85
+ };
86
+ };
87
+ };
88
+ };
89
+ rules: {
90
+ '@docusaurus/string-literal-i18n-messages': string;
91
+ '@docusaurus/no-untranslated-text': string;
92
+ '@docusaurus/no-html-links': string;
93
+ '@docusaurus/prefer-docusaurus-heading': string;
94
+ };
95
+ };
96
+ };
97
+ };
98
+ meta: {
99
+ name: string;
100
+ version: string;
101
+ namespace: string;
102
+ };
103
+ rules: {
104
+ 'no-untranslated-text': import("@typescript-eslint/utils/ts-eslint").RuleModule<"translateChildren", [{
105
+ ignoredStrings: string[];
106
+ }], import("./util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
107
+ name: string;
108
+ };
109
+ 'string-literal-i18n-messages': import("@typescript-eslint/utils/ts-eslint").RuleModule<"translateChildren" | "translateArg", [], import("./util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
110
+ name: string;
111
+ };
112
+ 'no-html-links': import("@typescript-eslint/utils/ts-eslint").RuleModule<"link", [{
113
+ ignoreFullyResolved: boolean;
114
+ }], import("./util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
115
+ name: string;
116
+ };
117
+ 'prefer-docusaurus-heading': import("@typescript-eslint/utils/ts-eslint").RuleModule<"headings", [], import("./util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
118
+ name: string;
119
+ };
36
120
  };
37
121
  };
38
- export = _default;
122
+ export = compatPlugin;
package/lib/index.js CHANGED
@@ -6,26 +6,50 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  const tslib_1 = require("tslib");
9
+ const package_json_1 = require("../package.json");
9
10
  const rules_1 = tslib_1.__importDefault(require("./rules"));
10
- module.exports = {
11
+ const plugin = {
12
+ meta: { name: package_json_1.name, version: package_json_1.version, namespace: '@docusaurus' },
11
13
  rules: rules_1.default,
14
+ };
15
+ const rulesRecommended = {
16
+ '@docusaurus/string-literal-i18n-messages': 'error',
17
+ '@docusaurus/no-html-links': 'warn',
18
+ '@docusaurus/prefer-docusaurus-heading': 'warn',
19
+ };
20
+ const rulesAll = {
21
+ '@docusaurus/string-literal-i18n-messages': 'error',
22
+ '@docusaurus/no-untranslated-text': 'warn',
23
+ '@docusaurus/no-html-links': 'warn',
24
+ '@docusaurus/prefer-docusaurus-heading': 'warn',
25
+ };
26
+ // Supports both legacy/flat configs:
27
+ // https://eslint.org/docs/latest/extend/plugins#backwards-compatibility-for-legacy-configs
28
+ const compatPlugin = {
29
+ ...plugin,
12
30
  configs: {
13
31
  recommended: {
14
32
  plugins: ['@docusaurus'],
15
- rules: {
16
- '@docusaurus/string-literal-i18n-messages': 'error',
17
- '@docusaurus/no-html-links': 'warn',
18
- '@docusaurus/prefer-docusaurus-heading': 'warn',
19
- },
33
+ rules: rulesRecommended,
20
34
  },
21
35
  all: {
22
36
  plugins: ['@docusaurus'],
23
- rules: {
24
- '@docusaurus/string-literal-i18n-messages': 'error',
25
- '@docusaurus/no-untranslated-text': 'warn',
26
- '@docusaurus/no-html-links': 'warn',
27
- '@docusaurus/prefer-docusaurus-heading': 'warn',
37
+ rules: rulesAll,
38
+ },
39
+ flat: {
40
+ recommended: {
41
+ plugins: {
42
+ '@docusaurus': plugin,
43
+ },
44
+ rules: rulesRecommended,
45
+ },
46
+ all: {
47
+ plugins: {
48
+ '@docusaurus': plugin,
49
+ },
50
+ rules: rulesAll,
28
51
  },
29
52
  },
30
53
  },
31
54
  };
55
+ module.exports = compatPlugin;
@@ -5,13 +5,21 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  declare const _default: {
8
- 'no-untranslated-text': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"translateChildren", [{
8
+ 'no-untranslated-text': import("@typescript-eslint/utils/ts-eslint").RuleModule<"translateChildren", [{
9
9
  ignoredStrings: string[];
10
- }], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
11
- 'string-literal-i18n-messages': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"translateChildren" | "translateArg", [], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
12
- 'no-html-links': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"link", [{
10
+ }], import("../util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
11
+ name: string;
12
+ };
13
+ 'string-literal-i18n-messages': import("@typescript-eslint/utils/ts-eslint").RuleModule<"translateChildren" | "translateArg", [], import("../util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
14
+ name: string;
15
+ };
16
+ 'no-html-links': import("@typescript-eslint/utils/ts-eslint").RuleModule<"link", [{
13
17
  ignoreFullyResolved: boolean;
14
- }], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
15
- 'prefer-docusaurus-heading': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"headings", [], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
18
+ }], import("../util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
19
+ name: string;
20
+ };
21
+ 'prefer-docusaurus-heading': import("@typescript-eslint/utils/ts-eslint").RuleModule<"headings", [], import("../util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
22
+ name: string;
23
+ };
16
24
  };
17
25
  export default _default;
@@ -9,5 +9,7 @@ type Options = [
9
9
  ignoreFullyResolved: boolean;
10
10
  }
11
11
  ];
12
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"link", Options, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
12
+ declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"link", Options, import("../util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
13
+ name: string;
14
+ };
13
15
  export default _default;
@@ -9,15 +9,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  const util_1 = require("../util");
10
10
  const docsUrl = 'https://docusaurus.io/docs/docusaurus-core#link';
11
11
  function isFullyResolvedUrl(urlString) {
12
- try {
13
- // href gets coerced to a string when it gets rendered anyway
14
- const url = new URL(String(urlString));
15
- if (url.protocol) {
16
- return true;
17
- }
18
- }
19
- catch (e) { }
20
- return false;
12
+ const url = URL.parse(String(urlString));
13
+ return !!(url && url.protocol);
21
14
  }
22
15
  exports.default = (0, util_1.createRule)({
23
16
  name: 'no-html-links',
@@ -32,12 +25,14 @@ exports.default = (0, util_1.createRule)({
32
25
  type: 'object',
33
26
  properties: {
34
27
  ignoreFullyResolved: {
28
+ description: 'Set to true will not report any <a> tags with absolute URLs including a protocol.',
35
29
  type: 'boolean',
36
30
  },
37
31
  },
38
32
  additionalProperties: false,
39
33
  },
40
34
  ],
35
+ defaultOptions: [{ ignoreFullyResolved: false }],
41
36
  messages: {
42
37
  link: `Do not use an \`<a>\` element to navigate. Use the \`<Link />\` component from \`@docusaurus/Link\` instead. See: ${docsUrl}`,
43
38
  },
@@ -9,5 +9,7 @@ type Options = [
9
9
  ignoredStrings: string[];
10
10
  }
11
11
  ];
12
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"translateChildren", Options, import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
12
+ declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"translateChildren", Options, import("../util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
13
+ name: string;
14
+ };
13
15
  export default _default;
@@ -24,11 +24,17 @@ exports.default = (0, util_1.createRule)({
24
24
  items: {
25
25
  type: 'string',
26
26
  },
27
+ description: 'Text labels that only contain strings in this list will not be reported.',
27
28
  },
28
29
  },
29
30
  additionalProperties: false,
30
31
  },
31
32
  ],
33
+ defaultOptions: [
34
+ {
35
+ ignoredStrings: [],
36
+ },
37
+ ],
32
38
  messages: {
33
39
  translateChildren: 'All text labels in JSX should be wrapped by translate calls',
34
40
  },
@@ -4,5 +4,7 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"headings", [], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
7
+ declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"headings", [], import("../util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
8
+ name: string;
9
+ };
8
10
  export default _default;
@@ -5,5 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  type MessageIds = 'translateChildren' | 'translateArg';
8
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<MessageIds, [], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
8
+ declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, [], import("../util").PluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
9
+ name: string;
10
+ };
9
11
  export default _default;
package/lib/util.d.ts CHANGED
@@ -4,12 +4,16 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import { ESLintUtils } from '@typescript-eslint/utils';
8
- import type { TSESTree } from '@typescript-eslint/types/dist/ts-estree';
7
+ import { ESLintUtils, type TSESTree } from '@typescript-eslint/utils';
9
8
  type CheckTranslateChildOptions = {
10
9
  ignoredStrings?: string[];
11
10
  };
12
11
  export declare function isStringWithoutExpressions(text: TSESTree.Node, options?: CheckTranslateChildOptions): boolean;
13
12
  export declare function isTextLabelChild(child: TSESTree.JSXChild, options?: CheckTranslateChildOptions): boolean;
14
- export declare const createRule: <TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends import("@typescript-eslint/utils/dist/ts-eslint").RuleListener = import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<TOptions, TMessageIds, TRuleListener>>) => import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<TMessageIds, TOptions, TRuleListener>;
13
+ export interface PluginDocs {
14
+ recommended: boolean | 'error';
15
+ }
16
+ export declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, PluginDocs>>) => ESLintUtils.RuleModule<MessageIds, Options, PluginDocs, ESLintUtils.RuleListener> & {
17
+ name: string;
18
+ };
15
19
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/eslint-plugin",
3
- "version": "3.10.2",
3
+ "version": "4.0.0-canary-6808",
4
4
  "description": "ESLint plugin to enforce best Docusaurus practices.",
5
5
  "main": "lib/index.js",
6
6
  "keywords": [
@@ -18,20 +18,22 @@
18
18
  },
19
19
  "license": "MIT",
20
20
  "scripts": {
21
- "build": "tsc"
21
+ "build": "tsc",
22
+ "watch": "tsc --watch"
22
23
  },
23
24
  "dependencies": {
24
- "@typescript-eslint/utils": "^5.62.0",
25
- "tslib": "^2.6.0"
25
+ "@typescript-eslint/types": "^8.69.0",
26
+ "@typescript-eslint/utils": "^8.69.0",
27
+ "tslib": "^2.8.1"
26
28
  },
27
29
  "devDependencies": {
28
- "eslint-plugin-eslint-plugin": "^5.1.0"
30
+ "@typescript-eslint/rule-tester": "^8.69.0"
29
31
  },
30
32
  "peerDependencies": {
31
- "eslint": ">=6"
33
+ "eslint": ">=8.57.0"
32
34
  },
33
35
  "engines": {
34
- "node": ">=20.0"
36
+ "node": ">=24.14"
35
37
  },
36
- "gitHead": "f37f9035584917a97a260b91fc2842cba4f8b94f"
38
+ "gitHead": "91e445730a91fbe20dd5fefae560303a0c655aa7"
37
39
  }
package/src/index.ts CHANGED
@@ -5,28 +5,57 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ import {name, version} from '../package.json';
9
+
8
10
  import rules from './rules';
9
11
 
10
- // @ts-expect-error: TODO try to remove later
11
- export = {
12
+ const plugin = {
13
+ meta: {name, version, namespace: '@docusaurus'},
12
14
  rules,
15
+ };
16
+
17
+ const rulesRecommended = {
18
+ '@docusaurus/string-literal-i18n-messages': 'error',
19
+ '@docusaurus/no-html-links': 'warn',
20
+ '@docusaurus/prefer-docusaurus-heading': 'warn',
21
+ };
22
+
23
+ const rulesAll = {
24
+ '@docusaurus/string-literal-i18n-messages': 'error',
25
+ '@docusaurus/no-untranslated-text': 'warn',
26
+ '@docusaurus/no-html-links': 'warn',
27
+ '@docusaurus/prefer-docusaurus-heading': 'warn',
28
+ };
29
+
30
+ // Supports both legacy/flat configs:
31
+ // https://eslint.org/docs/latest/extend/plugins#backwards-compatibility-for-legacy-configs
32
+ const compatPlugin = {
33
+ ...plugin,
13
34
  configs: {
14
35
  recommended: {
15
36
  plugins: ['@docusaurus'],
16
- rules: {
17
- '@docusaurus/string-literal-i18n-messages': 'error',
18
- '@docusaurus/no-html-links': 'warn',
19
- '@docusaurus/prefer-docusaurus-heading': 'warn',
20
- },
37
+ rules: rulesRecommended,
21
38
  },
22
39
  all: {
23
40
  plugins: ['@docusaurus'],
24
- rules: {
25
- '@docusaurus/string-literal-i18n-messages': 'error',
26
- '@docusaurus/no-untranslated-text': 'warn',
27
- '@docusaurus/no-html-links': 'warn',
28
- '@docusaurus/prefer-docusaurus-heading': 'warn',
41
+ rules: rulesAll,
42
+ },
43
+ flat: {
44
+ recommended: {
45
+ plugins: {
46
+ '@docusaurus': plugin,
47
+ },
48
+ rules: rulesRecommended,
49
+ },
50
+ all: {
51
+ plugins: {
52
+ '@docusaurus': plugin,
53
+ },
54
+ rules: rulesAll,
29
55
  },
30
56
  },
31
57
  },
32
58
  };
59
+
60
+ // @ts-expect-error: TODO try to remove later
61
+ export = compatPlugin;
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import {createRule} from '../util';
9
- import type {TSESTree} from '@typescript-eslint/types/dist/ts-estree';
9
+ import type {TSESTree} from '@typescript-eslint/types';
10
10
 
11
11
  const docsUrl = 'https://docusaurus.io/docs/docusaurus-core#link';
12
12
 
@@ -19,14 +19,8 @@ type Options = [
19
19
  type MessageIds = 'link';
20
20
 
21
21
  function isFullyResolvedUrl(urlString: string): boolean {
22
- try {
23
- // href gets coerced to a string when it gets rendered anyway
24
- const url = new URL(String(urlString));
25
- if (url.protocol) {
26
- return true;
27
- }
28
- } catch (e) {}
29
- return false;
22
+ const url = URL.parse(String(urlString));
23
+ return !!(url && url.protocol);
30
24
  }
31
25
 
32
26
  export default createRule<Options, MessageIds>({
@@ -42,12 +36,15 @@ export default createRule<Options, MessageIds>({
42
36
  type: 'object',
43
37
  properties: {
44
38
  ignoreFullyResolved: {
39
+ description:
40
+ 'Set to true will not report any <a> tags with absolute URLs including a protocol.',
45
41
  type: 'boolean',
46
42
  },
47
43
  },
48
44
  additionalProperties: false,
49
45
  },
50
46
  ],
47
+ defaultOptions: [{ignoreFullyResolved: false}],
51
48
  messages: {
52
49
  link: `Do not use an \`<a>\` element to navigate. Use the \`<Link />\` component from \`@docusaurus/Link\` instead. See: ${docsUrl}`,
53
50
  },
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import {isTextLabelChild, createRule} from '../util';
9
- import type {TSESTree} from '@typescript-eslint/types/dist/ts-estree';
9
+ import type {TSESTree} from '@typescript-eslint/types';
10
10
 
11
11
  type Options = [
12
12
  {
@@ -24,6 +24,7 @@ export default createRule<Options, MessageIds>({
24
24
  'enforce text labels in JSX to be wrapped by translate calls',
25
25
  recommended: false,
26
26
  },
27
+
27
28
  schema: [
28
29
  {
29
30
  type: 'object',
@@ -33,11 +34,18 @@ export default createRule<Options, MessageIds>({
33
34
  items: {
34
35
  type: 'string',
35
36
  },
37
+ description:
38
+ 'Text labels that only contain strings in this list will not be reported.',
36
39
  },
37
40
  },
38
41
  additionalProperties: false,
39
42
  },
40
43
  ],
44
+ defaultOptions: [
45
+ {
46
+ ignoredStrings: [],
47
+ },
48
+ ],
41
49
  messages: {
42
50
  translateChildren:
43
51
  'All text labels in JSX should be wrapped by translate calls',
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import {createRule} from '../util';
9
- import type {TSESTree} from '@typescript-eslint/types/dist/ts-estree';
9
+ import type {TSESTree} from '@typescript-eslint/types';
10
10
 
11
11
  type Options = [];
12
12
  type MessageIds = 'headings';
@@ -10,7 +10,7 @@ import {
10
10
  isStringWithoutExpressions,
11
11
  createRule,
12
12
  } from '../util';
13
- import type {TSESTree} from '@typescript-eslint/types/dist/ts-estree';
13
+ import type {TSESTree} from '@typescript-eslint/types';
14
14
 
15
15
  type Options = [];
16
16
  type MessageIds = 'translateChildren' | 'translateArg';
package/src/util.ts CHANGED
@@ -5,8 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import {ESLintUtils} from '@typescript-eslint/utils';
9
- import type {TSESTree} from '@typescript-eslint/types/dist/ts-estree';
8
+ import {ESLintUtils, type TSESTree} from '@typescript-eslint/utils';
10
9
 
11
10
  type CheckTranslateChildOptions = {
12
11
  ignoredStrings?: string[];
@@ -61,7 +60,14 @@ export function isTextLabelChild(
61
60
  }
62
61
  }
63
62
 
64
- export const createRule = ESLintUtils.RuleCreator(
63
+ // Not sure if we really need this
64
+ // See https://typescript-eslint.io/blog/announcing-typescript-eslint-v8/#custom-rule-metadocs-types
65
+ // See https://github.com/typescript-eslint/typescript-eslint/pull/9025
66
+ export interface PluginDocs {
67
+ recommended: boolean | 'error';
68
+ }
69
+
70
+ export const createRule = ESLintUtils.RuleCreator<PluginDocs>(
65
71
  (name) =>
66
72
  `https://docusaurus.io/docs/api/misc/@docusaurus/eslint-plugin/${name}`,
67
73
  );