Skip to content

Commit

Permalink
tools: update eslint to v1.10.3
Browse files Browse the repository at this point in the history
PR-URL: #2286
Reviewed-By: Roman Reiss <me@silverwind.io>
  • Loading branch information
targos authored and silverwind committed Jan 13, 2016
1 parent ed55169 commit 2d44149
Show file tree
Hide file tree
Showing 4,279 changed files with 146,115 additions and 151,089 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
57 changes: 36 additions & 21 deletions tools/eslint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,49 @@ After that, you can run ESLint on any JavaScript file:

eslint test.js test2.js

## Configuration

After running `eslint --init`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this:

```json
{
"rules": {
"semi": [2, "always"],
"quotes": [2, "double"]
}
}
```

The names `"semi"` and `"quotes"` are the names of [rules](http://eslint.org/docs/rules) in ESLint. The number is the error level of the rule and can be one of the three values:

* `0` - turn the rule off
* `1` - turn the rule on as a warning (doesn't affect exit code)
* `2` - turn the rule on as an error (exit code will be 1)

The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](http://eslint.org/docs/user-guide/configuring)).

## Sponsors

* Development is sponsored by [Box](https://box.com)

## Team

These folks keep the project moving and are resources for help:

* Nicholas C. Zakas ([@nzakas](https://github.com/nzakas)) - project lead
* Ilya Volodin ([@ilyavolodin](https://github.com/ilyavolodin)) - reviewer
* Brandon Mills ([@btmills](https://github.com/btmills)) - reviewer
* Gyandeep Singh ([@gyandeeps](https://github.com/gyandeeps)) - reviewer
* Mathias Schreck ([@lo1tuma](https://github.com/lo1tuma)) - committer
* Gyandeep Singh ([@gyandeeps](https://github.com/gyandeeps)) - committer
* Jamund Ferguson ([@xjamundx](https://github.com/xjamundx)) - committer
* Ian VanSchooten ([@ianvs](https://github.com/ianvs)) - committer
* Toru Nagashima ([@mysticatea](https://github.com/mysticatea)) - committer
* Burak Yiğit Kaya ([@byk](https://github.com/byk)) - committer
* Alberto Rodríguez ([@alberto](https://github.com/alberto)) - committer

## Releases

We have scheduled releases every two weeks on Friday or Saturday.

## Frequently Asked Questions

Expand All @@ -67,23 +99,6 @@ If you are using both JSHint and JSCS on your files, then using just ESLint will

ESLint does both traditional linting (looking for problematic patterns) and style checking (enforcement of conventions). You can use it for both.

### Who is using ESLint?

The following projects are using ESLint to validate their JavaScript:

* [Drupal](https://www.drupal.org/node/2274223)
* [Esprima](https://github.com/ariya/esprima)
* [io.js](https://github.com/iojs/io.js/commit/f9dd34d301ab385ae316769b85ef916f9b70b6f6)
* [WebKit](https://bugs.webkit.org/show_bug.cgi?id=125048)

In addition, the following companies are using ESLint internally to validate their JavaScript:

* [Box](https://box.com)
* [CustomInk](https://customink.com)
* [Fitbit](http://www.fitbit.com)
* [HolidayCheck](http://holidaycheck.de)
* [the native web](http://www.thenativeweb.io)

### What about ECMAScript 6 support?

ESLint has full support for ECMAScript 6. By default, this support is off. You can enable ECMAScript 6 support through [configuration](http://eslint.org/docs/user-guide/configuring).
Expand All @@ -102,10 +117,10 @@ Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](ht


[npm-image]: https://img.shields.io/npm/v/eslint.svg?style=flat-square
[npm-url]: https://npmjs.org/package/eslint
[npm-url]: https://www.npmjs.com/package/eslint
[travis-image]: https://img.shields.io/travis/eslint/eslint/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/eslint/eslint
[coveralls-image]: https://img.shields.io/coveralls/eslint/eslint/master.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/eslint/eslint?branch=master
[downloads-image]: http://img.shields.io/npm/dm/eslint.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/eslint
[downloads-image]: https://img.shields.io/npm/dm/eslint.svg?style=flat-square
[downloads-url]: https://www.npmjs.com/package/eslint
38 changes: 33 additions & 5 deletions tools/eslint/bin/eslint.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,39 @@
#!/usr/bin/env node
var concat = require("concat-stream"),
configInit = require("../lib/config-initializer"),
cli = require("../lib/cli");

/**
* @fileoverview Main CLI that is run via the eslint command.
* @author Nicholas C. Zakas
* @copyright 2013 Nicholas C. Zakas. All rights reserved.
* See LICENSE file in root directory for full license.
*/

"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

var exitCode = 0,
useStdIn = (process.argv.indexOf("--stdin") > -1),
init = (process.argv.indexOf("--init") > -1);
init = (process.argv.indexOf("--init") > -1),
debug = (process.argv.indexOf("--debug") > -1);

// must do this initialization *before* other requires in order to work
if (debug) {
require("debug").enable("eslint:*");
}

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

// now we can safely include the other modules that use debug
var concat = require("concat-stream"),
cli = require("../lib/cli");

//------------------------------------------------------------------------------
// Execution
//------------------------------------------------------------------------------

if (useStdIn) {
process.stdin.pipe(concat({ encoding: "string" }, function(text) {
Expand All @@ -18,13 +46,13 @@ if (useStdIn) {
}
}));
} else if (init) {
var configInit = require("../lib/config/config-initializer");
configInit.initializeConfig(function(err) {
if (err) {
exitCode = 1;
console.error(err.message);
console.error(err.stack);
} else {
console.log("Successfully created .eslintrc file in " + process.cwd());
exitCode = 0;
}
});
Expand Down
21 changes: 21 additions & 0 deletions tools/eslint/conf/blank-script.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"type": "Program",
"body": [],
"sourceType": "script",
"range": [
0,
0
],
"loc": {
"start": {
"line": 0,
"column": 0
},
"end": {
"line": 0,
"column": 0
}
},
"comments": [],
"tokens": []
}
51 changes: 39 additions & 12 deletions tools/eslint/conf/environments.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@
*/
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

var globals = require("globals");

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = {
builtin: globals.builtin,
browser: {
Expand All @@ -16,16 +24,12 @@ module.exports = {
globals: globals.node,
ecmaFeatures: {
globalReturn: true
},
rules: {
"no-catch-shadow": 0,
"no-console": 0,
"no-mixed-requires": 2,
"no-new-require": 2,
"no-path-concat": 2,
"no-process-exit": 2,
"global-strict": [0, "always"],
"handle-callback-err": [2, "err"]
}
},
commonjs: {
globals: globals.commonjs,
ecmaFeatures: {
globalReturn: true
}
},
worker: {
Expand All @@ -40,12 +44,18 @@ module.exports = {
jasmine: {
globals: globals.jasmine
},
jest: {
globals: globals.jest
},
phantomjs: {
globals: globals.phantom
globals: globals.phantomjs
},
jquery: {
globals: globals.jquery
},
qunit: {
globals: globals.qunit
},
prototypejs: {
globals: globals.prototypejs
},
Expand All @@ -58,9 +68,24 @@ module.exports = {
mongo: {
globals: globals.mongo
},
protractor: {
globals: globals.protractor
},
applescript: {
globals: globals.applescript
},
nashorn: {
globals: globals.nashorn
},
serviceworker: {
globals: globals.serviceworker
},
embertest: {
globals: globals.embertest
},
webextensions: {
globals: globals.webextensions
},
es6: {
ecmaFeatures: {
arrowFunctions: true,
Expand All @@ -81,7 +106,9 @@ module.exports = {
objectLiteralDuplicateProperties: true,
generators: true,
destructuring: true,
classes: true
classes: true,
spread: true,
newTarget: true
}
}
};
Loading

0 comments on commit 2d44149

Please sign in to comment.