branch: elpa/flycheck
commit 8e68bb6dce2a5979275027f983d3797beaf710bb
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Remove typescript-tslint checker
TSLint has been deprecated since 2019 in favor of ESLint with
typescript-eslint. Remove the checker, its parser, and related tests.
---
doc/languages.rst | 15 -----
flycheck.el | 66 -------------------
test/specs/languages/test-typescript.el | 111 --------------------------------
3 files changed, 192 deletions(-)
diff --git a/doc/languages.rst b/doc/languages.rst
index eea8661c2d..2f389ca39e 100644
--- a/doc/languages.rst
+++ b/doc/languages.rst
@@ -1706,21 +1706,6 @@ to view the docstring of the syntax checker. Likewise,
you may use
See `javascript-oxlint`.
- .. syntax-checker:: typescript-tslint
-
- Check syntax and style with `TSLint
<https://github.com/palantir/tslint>`_.
- This checker is deprecated.
-
- .. syntax-checker-config-file:: flycheck-typescript-tslint-config
-
- .. defcustom:: flycheck-typescript-tslint-rulesdir
-
- Additional rules directory, for user created rules.
-
- .. defcustom:: flycheck-tslint-args
-
- A list of additional arguments that are passed to tslint.
-
.. supported-language:: Verilog
.. syntax-checker:: verilog-verilator
diff --git a/flycheck.el b/flycheck.el
index e245f6fe28..7adbcab6c7 100644
--- a/flycheck.el
+++ b/flycheck.el
@@ -250,7 +250,6 @@
tex-lacheck
texinfo
textlint
- typescript-tslint
verilog-verilator
vhdl-ghdl
xml-xmlstarlet
@@ -7171,32 +7170,6 @@ information about staticcheck."
errors)))
(nreverse errors)))
-(defun flycheck-parse-tslint (output checker buffer)
- "Parse TSLint errors from JSON OUTPUT.
-
-CHECKER and BUFFER denote the CHECKER that returned OUTPUT and
-the BUFFER that was checked respectively.
-
-See URL `https://palantir.github.io/tslint/' for more information
-about TSLint."
- (seq-map (lambda (message)
- (let-alist message
- (flycheck-error-new-at
- (+ 1 .startPosition.line)
- (+ 1 .startPosition.character)
- (pcase .ruleSeverity
- ("ERROR" 'error)
- ("WARNING" 'warning)
- (_ 'warning))
- .failure
- :id .ruleName
- :checker checker
- :buffer buffer
- :filename .name
- :end-line (+ 1 .endPosition.line)
- :end-column (+ 1 .endPosition.character))))
- (car (flycheck-parse-json output))))
-
(defun flycheck-parse-rust-collect-spans (span)
"Return a list of spans contained in a SPAN object."
(let ((spans))
@@ -13009,45 +12982,6 @@ See URL `https://textlint.github.io/'."
:message plugin
:face 'success)))))
-(flycheck-def-config-file-var flycheck-typescript-tslint-config
- typescript-tslint "tslint.json"
- :package-version '(flycheck . "27"))
-
-(flycheck-def-option-var flycheck-typescript-tslint-rulesdir
- nil typescript-tslint
- "The directory of custom rules for TSLint.
-
-The value of this variable is either a string containing the path
-to a directory with custom rules, or nil, to not give any custom
-rules to TSLint.
-
-Refer to the TSLint manual at URL
-`https://palantir.github.io/tslint/usage/cli/'
-for more information about the custom directory."
- :type '(choice (const :tag "No custom rules directory" nil)
- (directory :tag "Custom rules directory"))
- :safe #'flycheck-string-or-nil-p
- :package-version '(flycheck . "27"))
-
-(flycheck-def-args-var flycheck-tslint-args (typescript-tslint)
- :package-version '(flycheck . "31"))
-
-(flycheck-define-checker typescript-tslint
- "TypeScript style checker using TSLint.
-
-Note that this syntax checker is not used if
-`flycheck-typescript-tslint-config' is nil or refers to a
-non-existing file.
-
-See URL `https://github.com/palantir/tslint'."
- :command ("tslint" "--format" "json"
- (config-file "--config" flycheck-typescript-tslint-config)
- (option "--rules-dir" flycheck-typescript-tslint-rulesdir)
- (eval flycheck-tslint-args)
- source-inplace)
- :error-parser flycheck-parse-tslint
- :modes (typescript-mode typescript-ts-mode tsx-ts-mode))
-
(flycheck-def-option-var flycheck-verilator-include-path nil verilog-verilator
"A list of include directories for Verilator.
diff --git a/test/specs/languages/test-typescript.el
b/test/specs/languages/test-typescript.el
deleted file mode 100644
index f557235efd..0000000000
--- a/test/specs/languages/test-typescript.el
+++ /dev/null
@@ -1,111 +0,0 @@
-;;; test-typescript.el --- Flycheck Specs: TypeScript -*-
lexical-binding: t; -*-
-
-;; Copyright (C) 2017 Flycheck contributors
-;; Copyright (C) 2016 Sebastian Wiesner and Flycheck contributors
-
-;; Author: Saša Jovanić <[email protected]>
-
-;; This file is not part of GNU Emacs.
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Specs for TypeScript support.
-
-;;; Code:
-
-(require 'flycheck-buttercup)
-(require 'test-helpers)
-
-(describe "Language TypeScript"
- (describe "The TSLint error parser"
- (let ((json
"[{\"endPosition\":{\"character\":25,\"line\":0,\"position\":25},
- \"failure\":\"unused variable: 'invalidAlignment'\",
- \"name\":\"sample.ts\",
- \"ruleName\":\"no-unused-variable\",
- \"ruleSeverity\":\"ERROR\",
- \"startPosition\":{\"character\":9,\"line\":0,\"position\":9}},
- {\"endPosition\":{\"character\":14,\"line\":2,\"position\":76},
- \"failure\":\"missing semicolon\",
- \"name\":\"sample.ts\",
- \"ruleName\":\"semicolon\",
- \"ruleSeverity\":\"WARNING\",
- \"startPosition\":{\"character\":14,\"line\":2,\"position\":76}}]")
- (json-with-unknown-severity "no-unused-variable is deprecated. Use
the tsc compiler options --noUnusedParameters and --noUnusedLocals instead.
-
- Could not find implementations for the following rules specified in the
configuration:
- label-undefined
- no-constructor-vars
- no-duplicate-key
- no-unreachable
- use-strict
- Try upgrading TSLint and/or ensuring that you have all necessary custom
rules installed.
- If TSLint was recently upgraded, you may have old rules configured which
need to be cleaned up.
-
-[{\"endPosition\":{\"character\":25,\"line\":0,\"position\":25},
- \"failure\":\"unused variable: 'invalidAlignment'\",
- \"name\":\"sample.ts\",
- \"ruleName\":\"no-unused-variable\",
- \"ruleSeverity\":\"XXX\",
- \"startPosition\":{\"character\":9,\"line\":0,\"position\":9}}]"))
- (it "parses TSLint JSON output"
- (expect (flycheck-parse-tslint json 'checker 'buffer)
- :to-be-equal-flycheck-errors
- (list
- (flycheck-error-new-at 1 10 'error
- "unused variable: 'invalidAlignment'"
- :id "no-unused-variable"
- :checker 'checker
- :buffer 'buffer
- :filename "sample.ts"
- :end-line 1
- :end-column 26)
- (flycheck-error-new-at 3 15 'warning
- "missing semicolon"
- :id "semicolon"
- :checker 'checker
- :buffer 'buffer
- :filename "sample.ts"
- :end-line 3
- :end-column 15))))
- (it "parses TSLint JSON output with unknown severity"
- (expect (flycheck-parse-tslint json-with-unknown-severity 'checker
'buffer)
- :to-be-equal-flycheck-errors
- (list
- (flycheck-error-new-at 1 10 'warning
- "unused variable: 'invalidAlignment'"
- :id "no-unused-variable"
- :checker 'checker
- :buffer 'buffer
- :filename "sample.ts"
- :end-line 1
- :end-column 26))))))
-
- (describe "Checker tests"
- (flycheck-buttercup-def-checker-test typescript-tslint typescript nil
- (let ((flycheck-disabled-checkers '(javascript-eslint)))
- (flycheck-buttercup-should-syntax-check
- "language/typescript/sample.ts" 'typescript-mode
- '(2 23 warning "Module 'chai' is not listed as dependency in
package.json"
- :checker typescript-tslint :id "no-implicit-dependencies"
- :end-line 2 :end-column 29)
- '(5 3 warning "Forbidden 'var' keyword, use 'let' or 'const' instead"
- :checker typescript-tslint :id "no-var-keyword"
- :end-line 5 :end-column 6)
- '(6 15 warning "Missing semicolon"
- :checker typescript-tslint :id "semicolon"
- :end-line 6 :end-column 15))))))
-
-;;; test-typescript.el ends here