AlDanial / cloc

cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.
GNU General Public License v2.0
19.42k stars 1.02k forks source link

JavaScript counter not recognizing CJS and MJS files #643

Closed jlarmstrongiv closed 2 years ago

jlarmstrongiv commented 2 years ago

Describe the bug The JavaScript file count is incorrect. It does not count .cjs and .mjs files.

cloc; OS; OS version

Expected result Accurate file count with all types of JS files.

Additional context Unfortunately, I do not know perl, but I’m assuming tests should be updated here https://github.com/AlDanial/cloc/blob/9c833b0d158e81c7b03a6d6170aa6c483b277470/Unix/t/00_C.t

AlDanial commented 2 years ago

.cjs was missing but .mjs was already defined in 1.92

$ ./cloc-1.92.pl --show-ext  | grep JavaScript
_js             -> JavaScript
bones           -> JavaScript
es6             -> JavaScript
jake            -> JavaScript
jakefile        -> JavaScript
js              -> JavaScript
jsb             -> JavaScript
jscad           -> JavaScript
jsfl            -> JavaScript
jsm             -> JavaScript
jss             -> JavaScript
mjs             -> JavaScript
njs             -> JavaScript
pac             -> JavaScript
sjs             -> JavaScript
ssjs            -> JavaScript
xsjs            -> JavaScript
xsjslib         -> JavaScript
jlarmstrongiv commented 2 years ago

@AlDanial thank you 🚀