Comparing version 1.0.1 to 1.0.2
@@ -7,7 +7,7 @@ var cp = require('child_process') | ||
var JSHINT = path.join(__dirname, 'node_modules', '.bin', 'jshint') | ||
var JSHINTRC = path.join(__dirname, '.jshintrc') | ||
var JSHINTRC = path.join(__dirname, 'lib', '.jshintrc') | ||
var JSCS = path.join(__dirname, 'node_modules', '.bin', 'jscs') | ||
var JSCSRC = path.join(__dirname, '.jscsrc') | ||
var JSCS_REPORTER = path.join(__dirname, 'jscs-reporter.js') | ||
var JSCSRC = path.join(__dirname, 'lib', '.jscsrc') | ||
var JSCS_REPORTER = path.join(__dirname, 'lib', 'jscs-reporter.js') | ||
@@ -17,3 +17,3 @@ module.exports = function (dir) { | ||
files = files.filter(function (file) { | ||
return !/\/node_modules\/|\/.git\/|\.min.js$/.test(file) | ||
return !/\/node_modules\/|\/.git\/|\.min.js$|\/bundle.js$/.test(file) | ||
}) | ||
@@ -20,0 +20,0 @@ |
{ | ||
"name": "standard", | ||
"description": "JavaScript Standard Style", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Feross Aboukhadijeh", |
@@ -1,2 +0,5 @@ | ||
# standard [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] | ||
# JavaScript Standard Style | ||
[![travis][travis-image]][travis-url] | ||
[![npm][npm-image]][npm-url] | ||
[![downloads][downloads-image]][downloads-url] | ||
@@ -10,10 +13,23 @@ [travis-image]: https://img.shields.io/travis/feross/standard.svg?style=flat | ||
### JavaScript Standard Style | ||
### One Style to Rule Them All | ||
No decisions to make, no `.jshintrc` or `.jscs` files to manage. It just works. | ||
## Install | ||
```bash | ||
npm install standard | ||
``` | ||
## Rules | ||
- No semicolons ([it's fine][1] – *[really][2]!*) | ||
- Indentation is 2 spaces | ||
- Strings use single quotes | ||
- Unix-style line breaks (LF) | ||
- **2 spaces** for indentation | ||
- **Single quotes** for strings | ||
- Except to avoid escaping like `"in this lil' string"` | ||
- **Unix line breaks** (LF) | ||
- **No semicolons** | ||
- [It's totally fine.][1] *[Really!][2]* | ||
- Never start a line with `(` or `[`: | ||
- This is the *one* gotcha with omitting semicolons – *automatically checked* for you! | ||
- Always prefix with `;` like this `;[1, 2, 3].join(' ')` | ||
- Spaces after keywords: | ||
@@ -25,2 +41,4 @@ - `if (condition) { ... }` | ||
- `var self = this` | ||
- Always use `===` instead of `==` | ||
- Dozens of sanity checks to catch bugs (unused variables, typos, etc.) | ||
@@ -31,12 +49,7 @@ [1]: http://blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding | ||
To get a better idea, take a look at | ||
[a sample file](https://github.com/feross/bittorrent-dht/blob/master/client.js). | ||
[a sample file](https://github.com/feross/bittorrent-dht/blob/master/client.js) written | ||
in JavaScript Standard Style. | ||
## install | ||
## Usage | ||
```bash | ||
npm install standard | ||
``` | ||
## usage | ||
The easiest way to use `standard` is to install it globally as a Node command line | ||
@@ -60,4 +73,7 @@ program. To do so, simply run the following command in your terminal (flag `-g` installs | ||
### what you might do if you're clever | ||
The paths `node_modules/`, `.git/`, `*.min.js`, and `bundle.js` are automatically excluded | ||
when looking for `.js` files to style check. | ||
### What you might do if you're clever | ||
1. Add it to `package.json` | ||
@@ -87,4 +103,4 @@ | ||
## license | ||
## License | ||
MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10472
102