Skip to content

Commit f4a4985

Browse files
committed
Check if our checker can be used before enforcing it.
The buffer could be in some derived mode that flycheck wont activate the checker for, which results in errors if we try to enforce it.
1 parent bd83268 commit f4a4985

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drupal/flycheck.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ so no need to highlight it twice."
5353
(set (make-local-variable 'flycheck-phpcs-standard) drupal/phpcs-standard)
5454

5555
(when drupal/flycheck-phpcs-js-and-css
56-
(if (apply 'derived-mode-p (append drupal-css-modes drupal-js-modes))
56+
(if (and (apply 'derived-mode-p (append drupal-css-modes drupal-js-modes))
57+
(flycheck-may-use-checker 'css-js-phpcs)
58+
)
5759
(set (make-local-variable 'flycheck-checker) 'css-js-phpcs)
5860
)
5961
)

0 commit comments

Comments
 (0)