@@ -43,6 +43,7 @@ skip_c_benchmarks="${SKIP_LINT_C_BENCHMARKS}"
43
43
skip_c_tests_fixtures=" ${SKIP_LINT_C_TESTS_FIXTURES} "
44
44
skip_shell=" ${SKIP_LINT_SHELL} "
45
45
skip_typescript_declarations=" ${SKIP_LINT_TYPESCRIPT_DECLARATIONS} "
46
+ skip_typescript_tests=" ${SKIP_LINT_TYPESCRIPT_TESTS} "
46
47
skip_license_headers=" ${SKIP_LINT_LICENSE_HEADERS} "
47
48
48
49
# Determine root directory:
@@ -66,6 +67,9 @@ eslint_tests_conf="${root}/etc/eslint/.eslintrc.tests.js"
66
67
# Define the path to ESLint configuration file for linting benchmarks:
67
68
eslint_benchmarks_conf=" ${root} /etc/eslint/.eslintrc.benchmarks.js"
68
69
70
+ # Define the path to ESLint configuration file for linting TypeScript definition tests:
71
+ eslint_typescript_tests_conf=" ${root} /etc/eslint/.eslintrc.typescript.tests.js"
72
+
69
73
# Define the path to cppcheck configuration file for linting examples:
70
74
cppcheck_examples_suppressions_list=" ${root} /etc/cppcheck/suppressions.examples.txt"
71
75
@@ -354,7 +358,7 @@ run_lint() {
354
358
fi
355
359
# Lint TypeScript declaration files...
356
360
if [[ -z " ${skip_typescript_declarations} " ]]; then
357
- files=$( echo " ${changed_files} " | grep ' /docs/types/.*\.ts$' | tr ' \n' ' ' )
361
+ files=$( echo " ${changed_files} " | grep ' /docs/types/.*\.d. ts$' | tr ' \n' ' ' )
358
362
if [[ -n " ${files} " ]]; then
359
363
make TYPESCRIPT_DECLARATIONS_LINTER=eslint FILES=" ${files} " lint-typescript-declarations-files > /dev/null >&2
360
364
if [[ " $? " -ne 0 ]]; then
@@ -364,6 +368,18 @@ run_lint() {
364
368
fi
365
369
fi
366
370
fi
371
+ # Lint TypeScript declaration test files...
372
+ if [[ -z " ${skip_typescript_tests} " ]]; then
373
+ files=$( echo " ${changed_files} " | grep ' /docs/types/test.ts$' | tr ' \n' ' ' )
374
+ if [[ -n " ${files} " ]]; then
375
+ make TYPESCRIPT_DECLARATIONS_LINTER=eslint FILES=" ${files} " ESLINT_TS_CONF=" ${eslint_typescript_tests_conf} " lint-typescript-declarations-files > /dev/null >&2
376
+ if [[ " $? " -ne 0 ]]; then
377
+ echo ' ' >&2
378
+ echo ' TypeScript test file lint errors.' >&2
379
+ return 1
380
+ fi
381
+ fi
382
+ fi
367
383
# Lint license headers...
368
384
if [[ -z " ${skip_license_headers} " ]]; then
369
385
files=$( echo " ${changed_files} " | tr ' \n' ' ' )
0 commit comments