 
 (delete 'mode-line-mule-info mode-line-format)
 (delete 'mode-line-position mode-line-format)
+(push '(flycheck-mode (:eval flycheck-mode-line)) mode-line-modes)
 (setq-default mode-line-format
               (append
                mode-line-format


(defvar flycheck-mode-line "")

(defvar mode-line-right-format
  (list
   (propertize " " 'display '((space :width 2)))
   '(:eval flycheck-mode-line)
   (propertize " " 'display '((space :width 1)))
   '(:eval mode-line-position)
   '(:eval mode-line-mule-info))
  "The mode line to display on the right side.")

(with-eval-after-load 'flycheck
  (setq flycheck-mode-line
        '(:eval
          (let ((text (pcase flycheck-last-status-change
                        (`not-checked "")
                        (`no-checker "-")
                        (`running "⟲")
                        (`errored "!")
                        (`finished
                         (let-alist (flycheck-count-errors flycheck-current-errors)
                           (propertize (format "☒ %s ⚠%s" (or .error 0) (or .warning 0))
                                       'face (cond (.error 'error)
                                                   (.warning 'warning)
                                                   (t 'unspecified)))))
                        (`interrupted ".")
                        (`suspicious "?"))))
            (concat mode-line-space
                    text
                    mode-line-space)))))

(provide 'base-modeline)
;;; base-modeline.el ends here
