Skip to content

Commit 89d9381

Browse files
authored
Run custom eslint rules as part of CI (#5199)
1 parent 07e5936 commit 89d9381

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
SHELL := /bin/bash
22

3-
validate: ## Validate a given endpoint request or response
3+
validate: lint ## Validate a given endpoint request or response
44
@node compiler/run-validations.js --api $(api) --type $(type) --branch $(branch)
5-
@npm run lint --prefix specification
65

76
validate-no-cache: ## Validate a given endpoint request or response without local cache
87
@node compiler/run-validations.js --api $(api) --type $(type) --branch $(branch) --no-cache
@@ -86,6 +85,9 @@ generate-language-examples-with-java:
8685
@node docs/examples/generate-language-examples.js java
8786
@npm run format:fix-examples --prefix compiler
8887

88+
lint:
89+
@npm run lint --prefix specification
90+
8991
lint-docs: ## Lint the OpenAPI documents after overlays
9092
@npx @redocly/cli lint "output/openapi/elasticsearch-*.json" --config "docs/linters/redocly.yaml" --format stylish --max-problems 500
9193

@@ -95,7 +97,7 @@ lint-docs-stateful: ## Lint only the elasticsearch-openapi-docs-final.json file
9597
lint-docs-serverless: ## Lint only the serverless OpenAPI document after overlays
9698
@npx @redocly/cli lint "output/openapi/elasticsearch-serverless-openapi-docs-final.json" --config "docs/linters/redocly.yaml" --format stylish --max-problems 500
9799

98-
contrib: | generate license-check spec-format-fix transform-to-openapi filter-for-serverless lint-docs ## Pre contribution target
100+
contrib: | lint generate license-check spec-format-fix transform-to-openapi filter-for-serverless lint-docs ## Pre contribution target
99101

100102
help: ## Display help
101103
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

specification/eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ export default defineConfig({
3434
'es-spec-validator/single-key-dictionary-key-is-string': 'error',
3535
'es-spec-validator/dictionary-key-is-string': 'error',
3636
'es-spec-validator/no-native-types': 'error',
37-
'es-spec-validator/invalid-node-types': 'warn'
37+
'es-spec-validator/invalid-node-types': 'error'
3838
}
3939
})

0 commit comments

Comments
 (0)