From 8a2d676fe9ca8a184b3ef32e0a793f80234aaebd Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Thu, 3 Feb 2022 11:38:40 +0000 Subject: [PATCH] Add cjs as a JavaScript file extension CJS is (was?) used for CommonJS modules in Node. It's not recommended now (https://github.com/nodejs/modules/issues/293) but Node docs mention it (https://nodejs.org/docs/latest/api/modules.html#file-modules), so presumably some code out there uses it. Also Standard JS' pre-commit hook definition applies to such files with `files` rather than `type` (due to lack of identify support): https://github.com/standard/standard/blob/master/.pre-commit-hooks.yaml . --- identify/extensions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/identify/extensions.py b/identify/extensions.py index 8c0286b..417352d 100644 --- a/identify/extensions.py +++ b/identify/extensions.py @@ -18,6 +18,7 @@ 'cc': {'text', 'c++'}, 'cfg': {'text'}, 'chs': {'text', 'c2hs'}, + 'cjs': {'text', 'javascript'}, 'clj': {'text', 'clojure'}, 'cljc': {'text', 'clojure'}, 'cljs': {'text', 'clojure', 'clojurescript'},