Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes a bug where flycheck was not showing some warnings for .tsx #157

Merged
merged 2 commits into from
Mar 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions packages/javascript/frontside-javascript.el
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,16 @@ Since `rjsx-mode' is derived from `js2-mode' this will also run there."
(add-hook 'typescript-mode-hook #'frontside-javascript--typescript-mode-hook)
(add-hook 'web-mode-hook #'frontside-javascript--tsx-web-mode-hook)

;; enable javascript-eslint checker since nowadays the eslint project is used
;; to check _both_ JavaScript AND TypeScript.
;; enable javascript-eslint checker to run after tide checkers. Tide checker
;; highlights syntax errors, and javascript eslint checker highlights linter
;; warnings
;; https://github.com/thefrontside/frontmacs/issues/156
(flycheck-add-mode 'javascript-eslint 'web-mode)
(flycheck-add-mode 'javascript-eslint 'typescript-mode)
(flycheck-add-next-checker 'typescript-tide '(warning . javascript-eslint) 'append))

(flycheck-add-next-checker 'typescript-tide 'javascript-eslint)
(flycheck-add-next-checker 'tsx-tide 'javascript-eslint)
(flycheck-add-next-checker 'jsx-tide 'javascript-eslint))

(defun frontside-javascript--typescript-mode-hook()
"Setup typescript buffers to use TIDE.
Expand Down Expand Up @@ -187,11 +192,6 @@ sees TSX code), we use `web-mode', but load and configure TIDE in order
to enable refactoring."

(when (string-equal "tsx" (file-name-extension buffer-file-name))

;; we're enabling tide-mode, but we're in web-mode, so we don't
;; want to use the tsx,jsx checkers
(setq flycheck-disabled-checkers (list 'tsx-tide 'jsx-tide))

(frontside-javascript--typescript-mode-hook)))


Expand Down