   (defvar aggressive-indent-excluded-modes))
 
 (autoload 'push-company-backends "base-lib")
+(autoload 'flycheck-add-mode "flycheck")
 
 ;;;
 ;; Packages
 
 (use-package web-mode
-  :mode
-  (("\\.h?html?$" . web-mode)
-   ("\\.\\(tpl\\|blade\\)\\(\\.php\\)?$" . web-mode)
-   ("\\.[agj]sp$" . web-mode)
-   ("\\.as[cp]x$" . web-mode)
-   ("\\.erb$" . web-mode)
-   ("\\.mustache$" . web-mode)
-   ("\\.tsx$" . web-mode)
-   ("\\.jsx$" . web-mode)
-   ("\\.djhtml$" . web-mode)
-   ("wp-content/themes/.+/.+\\.php$" . web-mode))
+  :mode "\\.\\(phtml\\|php|[agj]sp\\|as[cp]x\\|erb\\|djhtml\\|html?\\|hbs\\|ejs\\|jade\\|swig\\|tmpl\\)$"
   :init
-  (add-hooks-pair 'web-mode 'turn-off-smartparens-mode)
-  (with-eval-after-load "company"
-    (push-company-backends 'web-mode
-                           '(company-tern
-                             company-css
-                             company-web-html
-                             company-files)))
+  (add-hooks-pair 'web-mode
+                  '(flycheck-mode
+                    turn-off-smartparens-mode))
   :config
   (setq web-mode-enable-html-entities-fontification t
         ;; Highlight enclosing tags of the element under cursor
         web-mode-enable-current-element-highlight t)
+
+  (with-eval-after-load "flycheck"
+    (flycheck-add-mode 'html-tidy 'web-mode))
 
   ;; No padding for nested sections inside HTML
   (with-eval-after-load "editorconfig"

                  (setq web-mode-block-padding 0
                        web-mode-script-padding 0
                        web-mode-style-padding 0)))))

;; Snippets and Zen Coding for HTML
(use-package emmet-mode

  :config
  (setq emmet-move-cursor-between-quotes t))

(use-package slim-mode :mode "\\.slim$"
  :config
  (with-eval-after-load "aggressive-indent"
