branch: elpa/flycheck
commit c4e5e87c78fe8ca21e0d88d27c5632139901f1a0
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Use json-parse-string in stylelint parser
Replace the deprecated json-read-from-string with the modern
json-parse-string API (available since Emacs 27.1) for
consistency with the rest of the codebase.
---
flycheck.el | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/flycheck.el b/flycheck.el
index 8a123d86d4..6dbff54531 100644
--- a/flycheck.el
+++ b/flycheck.el
@@ -8160,11 +8160,13 @@ the BUFFER that was checked respectively.
See URL `https://stylelint.io/developer-guide/formatters/' for information
about the JSON format of stylelint."
- (let ((json-object-type 'plist))
-
- ;; stylelint returns a vector of result objects
- ;; Since we only passed one file, the first element is enough
- (let* ((stylelint-output (elt (json-read-from-string output) 0))
+ ;; stylelint returns a vector of result objects
+ ;; Since we only passed one file, the first element is enough
+ (let* ((stylelint-output (elt (json-parse-string output
+ :object-type 'plist
+ :null-object nil
+ :false-object nil)
+ 0))
(filename (buffer-file-name buffer))
;; Turn all deprecations into warnings
@@ -8209,7 +8211,7 @@ about the JSON format of stylelint."
(plist-get stylelint-output :warnings))))
;; Return the combined errors (deprecations, invalid options, warnings)
- (append deprecations invalid-options warnings))))
+ (append deprecations invalid-options warnings)))
(defun flycheck--stylelint-config-exists-p (checker)
"Whether there is a valid stylelint CHECKER config for the current buffer."