Avoiding a specific flycheck decoration is not built-in but can easily be added.
The flycheck overlays are generated by
flycheck-add-overlay which is luckily only called via the hook
Functions in that hook are run with a single arg -- the error -- until one of them succeeds.
The strategy is to add a function in
flycheck-process-error-functions in front of
flycheck-add-overlay that returns
t when the error should be ignored.
That function can be added locally for buffers in
In the following example flycheck errors are ignored in
emacs-lisp-mode if the line with the error ends in
;noflycheck. You can add the code to your init file.
(defcustom flycheck-elisp-noflycheck-marker ";noflycheck"
"Flycheck line regions marked with this marker string are ignored."
(defun flycheck-elisp-noflycheck (err)
"Ignore flycheck if line of ERR ends with `flycheck-elisp-noflycheck-marker'."
(goto-char (cdr (flycheck-error-line-region err)))
(max (- (point) (length flycheck-elisp-noflycheck-marker))
(defun elisp-noflycheck-hook ()
"Add the ;;;###noflycheck thing to elisp."
(add-hook 'flycheck-process-error-functions #'flycheck-elisp-noflycheck nil t))
(add-hook 'emacs-lisp-mode-hook #'elisp-noflycheck-hook)
The application in your usage example would be like follows.
(require 'prelude-packages) ;noflycheck