Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
Handle multiple eslint config formats (#313)
Browse files Browse the repository at this point in the history
Eslint can be configured using `.eslintrc`/`.eslintrc.js`/`.eslintrc.json` file names
  • Loading branch information
adekbadek authored and kasparsd committed Jan 9, 2020
1 parent 31c7236 commit 86cc5e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/check-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function set_environment_variables {
fi

if [ -z "$ESLINT_CONFIG" ]; then
ESLINT_CONFIG="$( upsearch .eslintrc )"
ESLINT_CONFIG="$( upsearch .eslintrc* )"
fi
if [ -z "$ESLINT_IGNORE" ]; then
ESLINT_IGNORE="$( upsearch .eslintignore )"
Expand Down Expand Up @@ -308,7 +308,7 @@ function set_environment_variables {
done

# Make sure linter configs get copied linting directory since upsearch is relative.
for linter_file in .jshintrc .jshintignore .jscsrc .jscs.json .eslintignore .eslintrc .phpcs.xml phpcs.xml .phpcs.xml.dist phpcs.xml.dist phpcs.ruleset.xml ruleset.xml; do
for linter_file in .jshintrc .jshintignore .jscsrc .jscs.json .eslintignore .eslintrc .eslintrc.js .eslintrc.json .phpcs.xml phpcs.xml .phpcs.xml.dist phpcs.xml.dist phpcs.ruleset.xml ruleset.xml; do
if git ls-files "$linter_file" --error-unmatch > /dev/null 2>&1; then
if [ -L $linter_file ]; then
ln -fs $(git show :"$linter_file") "$LINTING_DIRECTORY/$linter_file"
Expand Down

0 comments on commit 86cc5e6

Please sign in to comment.