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

Commit 420f1ba

Browse files
authored
Handle prettier with eslint (#314)
Props @adekbadek
1 parent 86cc5e6 commit 420f1ba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/check-diff.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,10 @@ function set_environment_variables {
308308
done
309309

310310
# Make sure linter configs get copied linting directory since upsearch is relative.
311-
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
311+
#
312+
# Eslint might depend on Prettier (https://github.com/prettier/eslint-plugin-prettier), so prettier config has to be copied into the linting directory.
313+
# Both Eslint and Prettier might be configured as keys in package.json, so this file needs to also be imported.
314+
for linter_file in .jshint* .jscs* .eslint* package.json .prettier* .phpcs* phpcs* ruleset.xml; do
312315
if git ls-files "$linter_file" --error-unmatch > /dev/null 2>&1; then
313316
if [ -L $linter_file ]; then
314317
ln -fs $(git show :"$linter_file") "$LINTING_DIRECTORY/$linter_file"

0 commit comments

Comments
 (0)