mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-22 14:10:56 -05:00
added config parameter
This commit is contained in:
parent
9f7cb36b5c
commit
f381c47e22
2 changed files with 61 additions and 4 deletions
|
@ -273,7 +273,7 @@ function BuildFileList() {
|
||||||
############################
|
############################
|
||||||
# Get the JavaScript files #
|
# Get the JavaScript files #
|
||||||
############################
|
############################
|
||||||
elif [ "$FILE_TYPE" == "js" ] || [ "$FILE_TYPE" == "jsx" ]; then
|
elif [ "$FILE_TYPE" == "js" ]; then
|
||||||
################################
|
################################
|
||||||
# Append the file to the array #
|
# Append the file to the array #
|
||||||
################################
|
################################
|
||||||
|
@ -284,9 +284,36 @@ function BuildFileList() {
|
||||||
##########################################################
|
##########################################################
|
||||||
READ_ONLY_CHANGE_FLAG=1
|
READ_ONLY_CHANGE_FLAG=1
|
||||||
############################
|
############################
|
||||||
|
# Get the JSX files #
|
||||||
|
############################
|
||||||
|
elif [ "$FILE_TYPE" == "jsx" ]; then
|
||||||
|
################################
|
||||||
|
# Append the file to the array #
|
||||||
|
################################
|
||||||
|
FILE_ARRAY_JSX+=("$FILE")
|
||||||
|
##########################################################
|
||||||
|
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
|
||||||
|
##########################################################
|
||||||
|
READ_ONLY_CHANGE_FLAG=1
|
||||||
|
############################
|
||||||
|
# Get the TSX files #
|
||||||
|
############################
|
||||||
|
elif [ "$FILE_TYPE" == "tsx" ]; then
|
||||||
|
################################
|
||||||
|
# Append the file to the array #
|
||||||
|
################################
|
||||||
|
FILE_ARRAY_TSX+=("$FILE")
|
||||||
|
##########################################################
|
||||||
|
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
|
||||||
|
##########################################################
|
||||||
|
READ_ONLY_CHANGE_FLAG=1
|
||||||
|
########################
|
||||||
|
# Get the Golang files #
|
||||||
|
########################
|
||||||
|
############################
|
||||||
# Get the TypeScript files #
|
# Get the TypeScript files #
|
||||||
############################
|
############################
|
||||||
elif [ "$FILE_TYPE" == "ts" ] || [ "$FILE_TYPE" == "tsx" ]; then
|
elif [ "$FILE_TYPE" == "ts" ]; then
|
||||||
################################
|
################################
|
||||||
# Append the file to the array #
|
# Append the file to the array #
|
||||||
################################
|
################################
|
||||||
|
|
|
@ -191,6 +191,8 @@ FILE_ARRAY_CFN=() # Array of files to check
|
||||||
FILE_ARRAY_COFFEESCRIPT=() # Array of files to check
|
FILE_ARRAY_COFFEESCRIPT=() # Array of files to check
|
||||||
FILE_ARRAY_JAVASCRIPT_ES=() # Array of files to check
|
FILE_ARRAY_JAVASCRIPT_ES=() # Array of files to check
|
||||||
FILE_ARRAY_JAVASCRIPT_STANDARD=() # Array of files to check
|
FILE_ARRAY_JAVASCRIPT_STANDARD=() # Array of files to check
|
||||||
|
FILE_ARRAY_JSX=() # Array of files to check
|
||||||
|
FILE_ARRAY_TSX=() # Array of files to check
|
||||||
FILE_ARRAY_TYPESCRIPT_ES=() # Array of files to check
|
FILE_ARRAY_TYPESCRIPT_ES=() # Array of files to check
|
||||||
FILE_ARRAY_TYPESCRIPT_STANDARD=() # Array of files to check
|
FILE_ARRAY_TYPESCRIPT_STANDARD=() # Array of files to check
|
||||||
FILE_ARRAY_DOCKER=() # Array of files to check
|
FILE_ARRAY_DOCKER=() # Array of files to check
|
||||||
|
@ -781,6 +783,8 @@ Footer() {
|
||||||
[ "$ERRORS_FOUND_ANSIBLE" -ne 0 ] ||
|
[ "$ERRORS_FOUND_ANSIBLE" -ne 0 ] ||
|
||||||
[ "$ERRORS_FOUND_JAVASCRIPT_ES" -ne 0 ] ||
|
[ "$ERRORS_FOUND_JAVASCRIPT_ES" -ne 0 ] ||
|
||||||
[ "$ERRORS_FOUND_JAVASCRIPT_STANDARD" -ne 0 ] ||
|
[ "$ERRORS_FOUND_JAVASCRIPT_STANDARD" -ne 0 ] ||
|
||||||
|
[ "$ERRORS_FOUND_JSX" -ne 0 ] ||
|
||||||
|
[ "$ERRORS_FOUND_TSX" -ne 0 ] ||
|
||||||
[ "$ERRORS_FOUND_TYPESCRIPT_ES" -ne 0 ] ||
|
[ "$ERRORS_FOUND_TYPESCRIPT_ES" -ne 0 ] ||
|
||||||
[ "$ERRORS_FOUND_TYPESCRIPT_STANDARD" -ne 0 ] ||
|
[ "$ERRORS_FOUND_TYPESCRIPT_STANDARD" -ne 0 ] ||
|
||||||
[ "$ERRORS_FOUND_DOCKER" -ne 0 ] ||
|
[ "$ERRORS_FOUND_DOCKER" -ne 0 ] ||
|
||||||
|
@ -1080,7 +1084,7 @@ if [ "$VALIDATE_JAVASCRIPT_ES" == "true" ]; then
|
||||||
# Lint the Javascript files #
|
# Lint the Javascript files #
|
||||||
#############################
|
#############################
|
||||||
# LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY"
|
# LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY"
|
||||||
LintCodebase "JAVASCRIPT_ES" "eslint" "eslint --no-eslintrc -c $JAVASCRIPT_LINTER_RULES" ".*\.\(jsx\?\)\$" "${FILE_ARRAY_JAVASCRIPT_ES[@]}"
|
LintCodebase "JAVASCRIPT_ES" "eslint" "eslint --no-eslintrc -c $JAVASCRIPT_LINTER_RULES" ".*\.\(js\)\$" "${FILE_ARRAY_JAVASCRIPT_ES[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
######################
|
######################
|
||||||
|
@ -1098,6 +1102,32 @@ if [ "$VALIDATE_JAVASCRIPT_STANDARD" == "true" ]; then
|
||||||
LintCodebase "JAVASCRIPT_STANDARD" "standard" "standard $JAVASCRIPT_STANDARD_LINTER_RULES" ".*\.\(js\)\$" "${FILE_ARRAY_JAVASCRIPT_STANDARD[@]}"
|
LintCodebase "JAVASCRIPT_STANDARD" "standard" "standard $JAVASCRIPT_STANDARD_LINTER_RULES" ".*\.\(js\)\$" "${FILE_ARRAY_JAVASCRIPT_STANDARD[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
######################
|
||||||
|
# JSX LINTING #
|
||||||
|
######################
|
||||||
|
if [ "$VALIDATE_JSX" == "true" ]; then
|
||||||
|
#############################
|
||||||
|
# Lint the JSX files #
|
||||||
|
#############################
|
||||||
|
# LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY"
|
||||||
|
LintCodebase "JSX" "eslint" "eslint --no-eslintrc -c $JAVASCRIPT_LINTER_RULES" ".*\.\(jsx\)\$" "${FILE_ARRAY_JSX[@]}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
######################
|
||||||
|
# TSX LINTING #
|
||||||
|
######################
|
||||||
|
if [ "$VALIDATE_TSX" == "true" ]; then
|
||||||
|
#################################
|
||||||
|
# Get Typescript standard rules #
|
||||||
|
#################################
|
||||||
|
GetStandardRules "typescript"
|
||||||
|
#############################
|
||||||
|
# Lint the TSX files #
|
||||||
|
#############################
|
||||||
|
LintCodebase "TSX" "eslint" "eslint --no-eslintrc -c $TYPESCRIPT_LINTER_RULES" ".*\.\(tsx\)\$" "${FILE_ARRAY_TSX[@]}"
|
||||||
|
fi
|
||||||
|
|
||||||
######################
|
######################
|
||||||
# TYPESCRIPT LINTING #
|
# TYPESCRIPT LINTING #
|
||||||
######################
|
######################
|
||||||
|
@ -1105,7 +1135,7 @@ if [ "$VALIDATE_TYPESCRIPT_ES" == "true" ]; then
|
||||||
#############################
|
#############################
|
||||||
# Lint the Typescript files #
|
# Lint the Typescript files #
|
||||||
#############################
|
#############################
|
||||||
LintCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c $TYPESCRIPT_LINTER_RULES" ".*\.\(tsx\?\)\$" "${FILE_ARRAY_TYPESCRIPT_ES[@]}"
|
LintCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c $TYPESCRIPT_LINTER_RULES" ".*\.\(ts\)\$" "${FILE_ARRAY_TYPESCRIPT_ES[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
######################
|
######################
|
||||||
|
|
Loading…
Reference in a new issue