Closed Robbert closed 8 years ago
Let's close all issues that are on the backburner, and reopen them when research & development becomes viable.
Nice: obviously there is a npm package called mime-db
that contains an incredible amount of media type descriptions. We could easiliy combine that with lovell's media-type
to parse them and filter them to find all extensions associated with application/json
and */*+json
media types.
Consider it done!
It would be nice if in the future, when possibly the *.jsm
file extension is introduced for JavaScript modules, all linting will automatically work.
One disadvantage is that now we're dependent on mime-db
to stay accurate... when they remove mappings for *.js
for example, it could result in publishing corrupted builds. It would be a good idea to introduce a basic test for the returned media types for the most essential media types: that is, every file extension used in this repository.
As described in issue #33, where all JSON files need to be processed, looking for
*.json
is too naive. Instead there should be a registry of file extension mappings to media types, and a file pattern generator with media type as input.An example that already is in this repository:
frameless.sublime-project
, which ends with.sublime-project
and has aapplication/json
media type.The question is: where do we define these mappings? Currently a bunch of them is already defined in
.htaccess
... Should we parse the.htaccess
file, or should we generate the.htaccess
based on another definition file?