Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Stylistic fixes for CONTRIBUTING and README

  • Loading branch information...
commit 3103342b0a72f943acbb41e279b9b7d4ef78adb8 1 parent 18d6ca4
@valueof valueof authored
Showing with 10 additions and 5 deletions.
  1. +8 −3 CONTRIBUTING.md
  2. +2 −2 README.md
View
11 CONTRIBUTING.md
@@ -35,20 +35,22 @@ many people contributed. —[idiomatic.js](https://github.com/rwldrn/idiomatic.j
* [Smart tabs](http://www.emacswiki.org/SmartTabs) are okay.
* Use one space after `if`, `for`, `while`, etc.
* Use one space after `function` for anonymous functions but not for named functions:
+
```javascript
var a = function () {};
function a() {}
```
+
* Feel free to indent variable assignments or property definitions if it makes the code look better. But don't abuse that:
-```javascript
+```javascript
// Good
var next = token.peak();
var prev = token.peak(-1);
var cur = token.current;
var scope = {
- name: '(global)',
+ name: "(global)",
parent: parentScope,
vars: [],
uses: []
@@ -58,16 +60,19 @@ var scope = {
var cur = token.current;
var isSemicolon = cur.isPunctuator(";");
```
+
* Wrap multi-line comments with new lines on both sides.
### Variables
* Use one `var` per variable unless you don't assign any values to it (and it's short enough):
+
```javascript
var token = tokens.find(index);
var scope = scopes.current;
var next, prev, cur;
```
+
* Don't be overly descriptive with your variable names but don't abuse one-letter variables either. Find a sweet spot somewhere in between.
### Comments
@@ -84,8 +89,8 @@ var next, prev, cur;
* Don't use comma-first notation.
* Try not to chain stuff unless it **really** helps (e.g. in tests).
* Don't short-circuit expressions if you're not assigning the result:
-```javascript
+```javascript
// Good
token = token || tokens.find(0);
View
4 README.md
@@ -44,13 +44,13 @@ use them, clone this repo and run our build command:
Contributing
------------
-Look for a file named CONTRIBUTING.md in this repository. It contains our contributing
+Look for a file named `CONTRIBUTING.md` in this repository. It contains our contributing
guidelines. We also have [a mailing list](http://groups.google.com/group/jshint/).
License
-------
-JSHint is distributed under the MIT License. One file (`src/stable/jshint.js`) is
+JSHint is distributed under the MIT License. One file and one file only (src/stable/jshint.js) is
distributed under the slightly modified MIT License.
Attribution
Please sign in to comment.
Something went wrong with that request. Please try again.