Skip to content

Commit 17cb7bf

Browse files
committed
chore: add new JSDoc endpoint check rule
1 parent cccee92 commit 17cb7bf

File tree

7 files changed

+644
-87
lines changed

7 files changed

+644
-87
lines changed

specification/cat/aliases/CatAliasesRequest.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { CatAliasesColumns, CatRequestBase } from '@cat/_types/CatBase'
2626
*
2727
* Get the cluster's index aliases, including filter and routing information.
2828
* This API does not return data stream aliases.
29-
*
3029
* IMPORTANT: CAT APIs are only intended for human consumption using the command line or the Kibana console. They are not intended for use by applications. For application consumption, use the aliases API.
3130
* @rest_spec_name cat.aliases
3231
* @availability stack stability=stable

specification/eslint.config.js

Lines changed: 63 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -16,85 +16,86 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
import parser from '@typescript-eslint/parser'
20-
import validator from 'eslint-plugin-es-spec'
21-
import { defineConfig } from 'eslint/config'
19+
import parser from "@typescript-eslint/parser";
20+
import validator from "eslint-plugin-es-spec";
21+
import { defineConfig } from "eslint/config";
2222

2323
export default defineConfig({
24-
files: ['**/*.ts'],
24+
files: ["**/*.ts"],
2525
languageOptions: {
2626
parser,
2727
parserOptions: {
2828
projectService: true,
29-
tsconfigRootDir: import.meta.dirname
30-
}
29+
tsconfigRootDir: import.meta.dirname,
30+
},
3131
},
32-
plugins: { 'es-spec-validator': validator },
32+
plugins: { "es-spec-validator": validator },
3333
rules: {
34-
'es-spec-validator/single-key-dictionary-key-is-string': 'error',
35-
'es-spec-validator/dictionary-key-is-string': 'error',
36-
'es-spec-validator/no-native-types': 'error',
37-
'es-spec-validator/invalid-node-types': 'error',
38-
'es-spec-validator/no-generic-number': 'error',
39-
'es-spec-validator/request-must-have-urls': 'error',
40-
'es-spec-validator/no-variants-on-responses': 'error',
41-
'es-spec-validator/no-inline-unions': 'error',
42-
'es-spec-validator/prefer-tagged-variants': 'error',
43-
'es-spec-validator/no-duplicate-type-names': [
44-
'error',
34+
"es-spec-validator/single-key-dictionary-key-is-string": "error",
35+
"es-spec-validator/dictionary-key-is-string": "error",
36+
"es-spec-validator/no-native-types": "error",
37+
"es-spec-validator/invalid-node-types": "error",
38+
"es-spec-validator/no-generic-number": "error",
39+
"es-spec-validator/request-must-have-urls": "error",
40+
"es-spec-validator/no-variants-on-responses": "error",
41+
"es-spec-validator/no-inline-unions": "error",
42+
"es-spec-validator/prefer-tagged-variants": "error",
43+
"es-spec-validator/no-duplicate-type-names": [
44+
"error",
4545
{
46-
ignoreNames: ['Request', 'Response', 'ResponseBase'],
46+
ignoreNames: ["Request", "Response", "ResponseBase"],
4747
existingDuplicates: {
4848
Action: [
49-
'indices.modify_data_stream',
50-
'indices.update_aliases',
51-
'watcher._types'
49+
"indices.modify_data_stream",
50+
"indices.update_aliases",
51+
"watcher._types",
5252
],
53-
Actions: ['ilm._types', 'security.put_privileges', 'watcher._types'],
54-
ComponentTemplate: ['cat.component_templates', 'cluster._types'],
53+
Actions: ["ilm._types", "security.put_privileges", "watcher._types"],
54+
ComponentTemplate: ["cat.component_templates", "cluster._types"],
5555
Context: [
56-
'_global.get_script_context',
57-
'_global.search._types',
58-
'nodes._types'
56+
"_global.get_script_context",
57+
"_global.search._types",
58+
"nodes._types",
5959
],
6060
DatabaseConfigurationMetadata: [
61-
'ingest.get_geoip_database',
62-
'ingest.get_ip_location_database'
61+
"ingest.get_geoip_database",
62+
"ingest.get_ip_location_database",
6363
],
64-
Datafeed: ['ml._types', 'xpack.usage'],
65-
Destination: ['_global.reindex', 'transform._types'],
66-
Feature: ['features._types', 'indices.get', 'xpack.info'],
67-
Features: ['indices.get', 'xpack.info'],
68-
Filter: ['_global.termvectors', 'ml._types'],
69-
IndexingPressure: ['cluster.stats', 'indices._types', 'nodes._types'],
70-
IndexingPressureMemory: ['indices._types', 'nodes._types'],
71-
Ingest: ['ingest._types', 'nodes._types'],
64+
Datafeed: ["ml._types", "xpack.usage"],
65+
Destination: ["_global.reindex", "transform._types"],
66+
Feature: ["features._types", "indices.get", "xpack.info"],
67+
Features: ["indices.get", "xpack.info"],
68+
Filter: ["_global.termvectors", "ml._types"],
69+
IndexingPressure: ["cluster.stats", "indices._types", "nodes._types"],
70+
IndexingPressureMemory: ["indices._types", "nodes._types"],
71+
Ingest: ["ingest._types", "nodes._types"],
7272
MigrationFeature: [
73-
'migration.get_feature_upgrade_status',
74-
'migration.post_feature_upgrade'
73+
"migration.get_feature_upgrade_status",
74+
"migration.post_feature_upgrade",
7575
],
76-
Operation: ['_global.mget', '_global.mtermvectors'],
77-
ResponseBody: ['_global.search', 'ml.evaluate_data_frame'],
78-
Phase: ['ilm._types', 'xpack.usage'],
79-
Phases: ['ilm._types', 'xpack.usage'],
80-
Pipeline: ['ingest._types', 'logstash._types'],
81-
Policy: ['enrich._types', 'ilm._types', 'slm._types'],
82-
RequestItem: ['_global.msearch', '_global.msearch_template'],
83-
ResponseItem: ['_global.bulk', '_global.mget', '_global.msearch'],
84-
RoleMapping: ['security._types', 'xpack.usage'],
85-
RuntimeFieldTypes: ['cluster.stats', 'xpack.usage'],
86-
ShardsStats: ['indices.field_usage_stats', 'snapshot._types'],
87-
ShardStats: ['ccr._types', 'indices.stats'],
88-
Source: ['_global.reindex', 'transform._types'],
76+
Operation: ["_global.mget", "_global.mtermvectors"],
77+
ResponseBody: ["_global.search", "ml.evaluate_data_frame"],
78+
Phase: ["ilm._types", "xpack.usage"],
79+
Phases: ["ilm._types", "xpack.usage"],
80+
Pipeline: ["ingest._types", "logstash._types"],
81+
Policy: ["enrich._types", "ilm._types", "slm._types"],
82+
RequestItem: ["_global.msearch", "_global.msearch_template"],
83+
ResponseItem: ["_global.bulk", "_global.mget", "_global.msearch"],
84+
RoleMapping: ["security._types", "xpack.usage"],
85+
RuntimeFieldTypes: ["cluster.stats", "xpack.usage"],
86+
ShardsStats: ["indices.field_usage_stats", "snapshot._types"],
87+
ShardStats: ["ccr._types", "indices.stats"],
88+
Source: ["_global.reindex", "transform._types"],
8989
Token: [
90-
'_global.termvectors',
91-
'security.authenticate',
92-
'security.create_service_token',
93-
'security.enroll_kibana'
94-
]
95-
}
96-
}
90+
"_global.termvectors",
91+
"security.authenticate",
92+
"security.create_service_token",
93+
"security.enroll_kibana",
94+
],
95+
},
96+
},
9797
],
98-
'es-spec-validator/no-all-string-literal-unions': 'error'
99-
}
100-
})
98+
"es-spec-validator/no-all-string-literal-unions": "error",
99+
"es-spec-validator/jsdoc-endpoint-check": "error",
100+
},
101+
});

validator/eslint-plugin-es-spec.js

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,32 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
import singleKeyDict from './rules/single-key-dictionary-key-is-string.js'
20-
import dict from './rules/dictionary-key-is-string.js'
21-
import noNativeTypes from './rules/no-native-types.js'
22-
import invalidNodeTypes from './rules/invalid-node-types.js'
23-
import noGenericNumber from './rules/no-generic-number.js'
24-
import requestMustHaveUrls from './rules/request-must-have-urls.js'
25-
import noVariantsOnResponses from './rules/no-variants-on-responses.js'
26-
import noInlineUnions from './rules/no-inline-unions.js'
27-
import preferTaggedVariants from './rules/prefer-tagged-variants.js'
28-
import noDuplicateTypeNames from './rules/no-duplicate-type-names.js'
29-
import noAllStringLiteralUnions from './rules/no-all-string-literal-unions.js'
19+
import singleKeyDict from "./rules/single-key-dictionary-key-is-string.js";
20+
import dict from "./rules/dictionary-key-is-string.js";
21+
import noNativeTypes from "./rules/no-native-types.js";
22+
import invalidNodeTypes from "./rules/invalid-node-types.js";
23+
import noGenericNumber from "./rules/no-generic-number.js";
24+
import requestMustHaveUrls from "./rules/request-must-have-urls.js";
25+
import noVariantsOnResponses from "./rules/no-variants-on-responses.js";
26+
import noInlineUnions from "./rules/no-inline-unions.js";
27+
import preferTaggedVariants from "./rules/prefer-tagged-variants.js";
28+
import noDuplicateTypeNames from "./rules/no-duplicate-type-names.js";
29+
import noAllStringLiteralUnions from "./rules/no-all-string-literal-unions.js";
30+
import jsdocEndpointCheck from "./rules/jsdoc-endpoint-check.js";
3031

3132
export default {
3233
rules: {
33-
'single-key-dictionary-key-is-string': singleKeyDict,
34-
'dictionary-key-is-string': dict,
35-
'no-native-types': noNativeTypes,
36-
'invalid-node-types': invalidNodeTypes,
37-
'no-generic-number': noGenericNumber,
38-
'request-must-have-urls': requestMustHaveUrls,
39-
'no-variants-on-responses': noVariantsOnResponses,
40-
'no-inline-unions': noInlineUnions,
41-
'prefer-tagged-variants': preferTaggedVariants,
42-
'no-duplicate-type-names': noDuplicateTypeNames,
43-
'no-all-string-literal-unions': noAllStringLiteralUnions
44-
}
45-
}
34+
"single-key-dictionary-key-is-string": singleKeyDict,
35+
"dictionary-key-is-string": dict,
36+
"no-native-types": noNativeTypes,
37+
"invalid-node-types": invalidNodeTypes,
38+
"no-generic-number": noGenericNumber,
39+
"request-must-have-urls": requestMustHaveUrls,
40+
"no-variants-on-responses": noVariantsOnResponses,
41+
"no-inline-unions": noInlineUnions,
42+
"prefer-tagged-variants": preferTaggedVariants,
43+
"no-duplicate-type-names": noDuplicateTypeNames,
44+
"no-all-string-literal-unions": noAllStringLiteralUnions,
45+
"jsdoc-endpoint-check": jsdocEndpointCheck,
46+
},
47+
};

0 commit comments

Comments
 (0)