Permalink
Browse files

Moved JSHint options into a separate file.

This way I can use them with jshint-i and other non-make.js tools.
  • Loading branch information...
1 parent e0eeef6 commit aafef946c4c027fcfd362a4181dcac459db4c069 @valueof valueof committed Nov 13, 2012
Showing with 15 additions and 15 deletions.
  1. +14 −0 jshint.json
  2. +1 −15 make.js
View
14 jshint.json
@@ -0,0 +1,14 @@
+{
+ "es5": true,
+ "boss": true,
+ "node": true,
+ "strict": true,
+ "white": true,
+ "smarttabs": true,
+ "maxlen": 100,
+ "newcap": false,
+ "undef": true,
+ "unused": true,
+ "onecase": true,
+ "indent": 2
+}
View
16 make.js
@@ -12,21 +12,7 @@ var TESTS = [
"tests/next/unit/"
];
-var OPTIONS = {
- es5: true,
- boss: true,
- node: true,
- globalstrict: true,
- strict: true,
- white: true,
- smarttabs: true,
- maxlen: 100,
- newcap: false,
- undef: true,
- unused: true,
- onecase: true,
- indent: 2
-};
+var OPTIONS = JSON.parse(cat("./jshint.json"));
target.all = function () {
target.lint();

6 comments on commit aafef94

@Krinkle

Maybe name it .jshintrc? Or isn't used the same way?

@valueof
JSHint member

I don't like dot files. There's no reason why this file should be hidden.

@Krinkle

So maybe jshint-cli should look for a different filename? I don't know who came up with the name, but that's the standardised name that jshint itself looks for (I didn't invent it). If you don't like it yourself..

I'd like to have jshint files be editable and have them lint with jshint itself – without having to pass --config <path>/json.config manually which is not an option in editors (platforms) as they are linted on-the-fly (e.g. in Sublime Text 2) with the expectation that the file .jshintrc exists.

@valueof
JSHint member

How does the fact that JSHint source code doesn't use .jshintrc file name prevents you from using it in your own projects? Unless you spend considerate amount of time hacking on JSHint itself I don't really see how this commit is an issue.

@valueof
JSHint member

To be clear, I don't plan to remove support for .jshintrc.

@Krinkle

@antonkovalyov I was indeed referring to editing JSHint itself. From a community contribution point of view. I don't do that a lot myself, but it seems like a reasonable courtesy to any and all contributors to be able to write patches for you to jshint in their editors without having to put hacks in place in their working copy.

So support both. .jshintrc and whatever filename you find acceptable, and use it here.

Please sign in to comment.