branch: elpa/flycheck
commit 44bed1fbc48a76f6c3a9fb9021f6c4d92fb14577
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Remove javascript-jshint checker
JSHint has been largely superseded by ESLint, which is the default
JavaScript checker. ESLint and oxlint cover the same modes.
Update docs to use javascript-standard as the dir-local example.
---
doc/developer/developing.rst | 4 +---
doc/languages.rst | 15 ++-----------
doc/user/syntax-checkers.rst | 14 ++++++------
flycheck.el | 40 ---------------------------------
test/specs/languages/test-javascript.el | 31 ++-----------------------
5 files changed, 12 insertions(+), 92 deletions(-)
diff --git a/doc/developer/developing.rst b/doc/developer/developing.rst
index 328df12a0d..567cdf1619 100644
--- a/doc/developer/developing.rst
+++ b/doc/developer/developing.rst
@@ -199,9 +199,7 @@ JavaScript checkers provided by Flycheck:
.. code-block:: console
javascript-eslint
- javascript-jshint
- javascript-gjslint
- javascript-jscs
+ javascript-oxlint
javascript-standard
If a buffer is in ``js-mode``, Flycheck will try first to enable
diff --git a/doc/languages.rst b/doc/languages.rst
index 15edfe9cb4..e224e80a6a 100644
--- a/doc/languages.rst
+++ b/doc/languages.rst
@@ -671,10 +671,9 @@ to view the docstring of the syntax checker. Likewise,
you may use
.. supported-language:: Javascript
- Flycheck checks Javascript with one of `javascript-eslint` or
- `javascript-jshint`.
+ Flycheck checks Javascript with `javascript-eslint`.
- Alternatively `javascript-standard` is used instead all of the former ones.
+ Alternatively `javascript-standard` is used instead.
.. syntax-checker:: javascript-eslint
@@ -698,16 +697,6 @@ to view the docstring of the syntax checker. Likewise,
you may use
Lint JavaScript and TypeScript with `oxlint <https://oxc.rs/>`_.
- .. syntax-checker:: javascript-jshint
-
- Check syntax and lint with `JSHint <http://jshint.com/>`_.
-
- .. defcustom:: flycheck-jshint-extract-javascript
-
- Whether to extract Javascript from HTML before linting.
-
- .. syntax-checker-config-file:: flycheck-jshintrc
-
.. syntax-checker:: javascript-standard
Check syntax and code style with Standard_ or Semistandard_.
diff --git a/doc/user/syntax-checkers.rst b/doc/user/syntax-checkers.rst
index 2e2412f33b..9e4346d49c 100644
--- a/doc/user/syntax-checkers.rst
+++ b/doc/user/syntax-checkers.rst
@@ -109,13 +109,13 @@ Under the hood `C-c ! s` sets `flycheck-checker`:
We recommend to set `flycheck-checker` via directory local variables to enforce
a specific syntax checker for a project. For instance, Flycheck usually
prefers
`javascript-eslint` for Javascript buffers, but if your project uses
-`javascript-jshint` instead you can tell Flycheck to use `javascript-jshint`
for
-all Javascript buffers of your project with the following command in the
-top-level directory of your project: :kbd:`M-x add-dir-local-variable RET
-js-mode RET flycheck-checker RET javascript-jshint`. A new buffer pops up that
-shows the newly created entry in the directory variables. Save this buffer and
-kill it. From now on Flycheck will check all Javascript files of this project
-with JSHint.
+`javascript-standard` instead you can tell Flycheck to use
+`javascript-standard` for all Javascript buffers of your project with the
+following command in the top-level directory of your project: :kbd:`M-x
+add-dir-local-variable RET js-mode RET flycheck-checker RET
+javascript-standard`. A new buffer pops up that shows the newly created entry
+in the directory variables. Save this buffer and kill it. From now on
Flycheck
+will check all Javascript files of this project with Standard.
.. seealso::
diff --git a/flycheck.el b/flycheck.el
index b065d76720..0d2915c242 100644
--- a/flycheck.el
+++ b/flycheck.el
@@ -164,7 +164,6 @@
html-tidy
javascript-eslint
javascript-oxlint
- javascript-jshint
javascript-standard
json-python-json
json-jq
@@ -9828,45 +9827,6 @@ See URL `https://github.com/htacg/tidy-html5'."
" - Warning: " (message) line-end))
:modes (html-mode mhtml-mode nxhtml-mode))
-(flycheck-def-config-file-var flycheck-jshintrc javascript-jshint ".jshintrc")
-
-(flycheck-def-option-var flycheck-jshint-extract-javascript nil
- javascript-jshint
- "Whether jshint should extract Javascript from HTML.
-
-If nil no extract rule is given to jshint. If `auto' only
-extract Javascript if a HTML file is detected. If `always' or
-`never' extract Javascript always or never respectively.
-
-Refer to the jshint manual at the URL
-`https://jshint.com/docs/cli/#flags' for more information."
- :type
- '(choice (const :tag "No extraction rule" nil)
- (const :tag "Try to extract Javascript when detecting HTML files"
- auto)
- (const :tag "Always try to extract Javascript" always)
- (const :tag "Never try to extract Javascript" never))
- :safe #'symbolp
- :package-version '(flycheck . "26"))
-
-(flycheck-define-checker javascript-jshint
- "A Javascript syntax and style checker using jshint.
-
-See URL `https://www.jshint.com'."
- :command ("jshint" "--reporter=checkstyle"
- "--filename" source-original
- (config-file "--config" flycheck-jshintrc)
- (option "--extract=" flycheck-jshint-extract-javascript
- concat flycheck-option-symbol)
- "-")
- :standard-input t
- :error-parser flycheck-parse-checkstyle
- :error-filter
- (lambda (errors)
- (flycheck-remove-error-file-names
- "stdin" (flycheck-dequalify-error-ids errors)))
- :modes (js-mode js2-mode js3-mode rjsx-mode js-ts-mode))
-
(flycheck-def-args-var flycheck-eslint-args javascript-eslint
:package-version '(flycheck . "32"))
diff --git a/test/specs/languages/test-javascript.el
b/test/specs/languages/test-javascript.el
index 0b42c66588..530cc99c21 100644
--- a/test/specs/languages/test-javascript.el
+++ b/test/specs/languages/test-javascript.el
@@ -74,41 +74,14 @@
:end-column 2))))))
(describe "Checker tests"
- (flycheck-buttercup-def-checker-test javascript-jshint javascript
syntax-error
- ;; Silence JS2 and JS3 parsers
- (let ((js2-mode-show-parse-errors nil)
- (js2-mode-show-strict-warnings nil)
- (js3-mode-show-parse-errors nil)
- (inhibit-message t)
- (flycheck-disabled-checkers
- '(javascript-eslint javascript-gjslint)))
- (flycheck-buttercup-should-syntax-check
- "language/javascript/syntax-error.js" '(js-mode js2-mode js3-mode
rjsx-mode)
- '(3 1 error "Unrecoverable syntax error. (75% scanned)."
- :checker javascript-jshint :id "E041")
- '(3 25 error "Expected an identifier and instead saw ')'."
- :checker javascript-jshint :id "E030"))))
-
- (flycheck-buttercup-def-checker-test javascript-jshint javascript nil
- (let ((flycheck-jshintrc "jshintrc")
- (inhibit-message t)
- (flycheck-disabled-checkers
- '(javascript-eslint javascript-gjslint)))
- (flycheck-buttercup-should-syntax-check
- "language/javascript/warnings.js" '(js-mode js2-mode js3-mode
rjsx-mode)
- '(4 9 warning "'foo' is defined but never used." :id "W098"
- :checker javascript-jshint))))
-
(flycheck-buttercup-def-checker-test javascript-eslint javascript error
- (let ((flycheck-disabled-checkers '(javascript-jshint))
- (inhibit-message t))
+ (let ((inhibit-message t))
(flycheck-buttercup-should-syntax-check
"language/javascript/syntax-error.js" flycheck-test-javascript-modes
'(3 25 error "Parsing error: Unexpected token )" :checker
javascript-eslint))))
(flycheck-buttercup-def-checker-test javascript-eslint javascript warning
- (let ((flycheck-disabled-checkers '(javascript-jshint))
- (inhibit-message t))
+ (let ((inhibit-message t))
(flycheck-buttercup-should-syntax-check
"language/javascript/warnings.js" flycheck-test-javascript-modes
'(3 2 warning "Use the function form of 'use strict'." :id "strict"