Add 'json' to the list of extensions for 'js' #174

wants to merge 3 commits into


None yet

5 participants


I was grepping in the directory of an extracted CPAN distribution
for module dependencies and noticed that META.yml had a hit while META.json didn't show up.

I almost made json it's own type, then thought maybe it should just be in with the 'js'...
Any thoughts on the matter?
Or perhaps have you specifically left json out for a reason?

My first thought is that json would be its own. Five examples:

  • JSON files usually don't have line breaks
  • yaml is its own type
  • say you have a JSON that's some sort of massive dictionary. Imagine searching for a variable name in your JS file.

(there's a Monty Python joke in here somewhere)


yeah I thought of those too...
guess I should have trusted my first instinct.

I see now that ack and ack-help-types.txt have been modified (didn't notice it last time... maybe I didn't "make" it right).

+1, either as its own type, or as part of js


Note that in the meantime you can put


in your ~/.ackrc to include .json files in searches




to avoid the warning about making a new type

dolmen commented Nov 19, 2011

@rwstauner To define a new type, use --type-set instead of --type-add:

--type-set json=.json

@hoelzro hoelzro referenced this pull request in petdance/ack2 Aug 28, 2013

Add JSON filetype #285

hoelzro commented Aug 28, 2013

This made it into ack2, so closing!

@hoelzro hoelzro closed this Aug 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment