json-logic-js icon indicating copy to clipboard operation
json-logic-js copied to clipboard

Lint and minify code

Open FluorescentHallucinogen opened this issue 7 years ago • 3 comments

Please lint and minify the source code.

FluorescentHallucinogen avatar Nov 01 '16 08:11 FluorescentHallucinogen

I lint the code continuously with JSHint while I'm developing, and I'm not seeing any errors. (If I paste logic.js into jshint.com I get three warnings, but all three are safe typeof checks as part of the Universal Module Loader pattern, so not sure what recourse I have to improve that.) Is there a specific problem you're seeing that I'm not?

If you don't mind me asking, how are you using the library that it's more helpful for me to pre-minimize it? I include it into my production projects with Bower then pack it into a bigger bundle with either Gulp or Require.JS, so having the library minified by itself never seemed useful--that's not some cosmic truth, that's my little use case.

jwadhams avatar Nov 01 '16 14:11 jwadhams

Have you tried ESLint (http://eslint.org)? :wink:

Since you use Git tags, if you'll minify logic.js, you'll can serve it directly from GitHub with proper Content-Type header using RawGit (https://rawgit.com), a free service based on MaxCDN's (https://maxcdn.com) super fast global CDN.

It will be possible to simply add <script src="https://cdn.rawgit.com/jwadhams/json-logic-js/v1.0.9/logic.min.js"></script> to the web page to start using JSONLogic in the browser environment.

BTW, could you please rename the main file from logic.js to json-logic.js?

FluorescentHallucinogen avatar Nov 01 '16 18:11 FluorescentHallucinogen

BTW, you can add ESLint into your continuous integration pipeline to verify pull requests with automatic builds (Travis-CI (https://travis-ci.org) is free for open-source projects) and also integrate it with your IDE.

FluorescentHallucinogen avatar Nov 01 '16 18:11 FluorescentHallucinogen