From b655c08f0357b5b6750bc729a8b45204b1711eee Mon Sep 17 00:00:00 2001 From: Leonard Reidy Date: Thu, 25 Jul 2019 18:57:42 +0100 Subject: [PATCH 1/2] Update README description --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index cda80eb..19b4e05 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # line-count package +### Description + +Fork of Towtow10's line-count atom package with support for `.tsx` file suffix. + ### Usage Press ctrl-alt-shift-L (line-count:open) to open an editor page showing line counts broken down by file, directory, and file type for all files in the project. @@ -69,6 +73,7 @@ File suffixes supported are .. - .svg - .swift - .ts +- .tsx - .vb - .xml - .yaml From bc2720182f2b81a94bdd763d8454e692d67cfe70 Mon Sep 17 00:00:00 2001 From: Leonard Reidy Date: Thu, 25 Jul 2019 18:59:46 +0100 Subject: [PATCH 2/2] Force sloc to treat tsx as ts files --- lib/line-count.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/line-count.coffee b/lib/line-count.coffee index 85bf0ee..b486def 100644 --- a/lib/line-count.coffee +++ b/lib/line-count.coffee @@ -68,6 +68,7 @@ suffixes = [ "svg" "swift" "ts" + "tsx" "ttslua" "vb" "vue" @@ -150,6 +151,10 @@ module.exports = if type == 'ttslua' type = 'lua' + #treat tsx as ts + if type == 'tsx' + type = 'ts' + try counts = sloc code, type catch e