Skip to content

Commit 2e0352d

Browse files
targosMyles Borins
authored and
Myles Borins
committed
tools: update eslint to v1.10.3
PR-URL: #2286 Reviewed-By: Roman Reiss <[email protected]>
1 parent a2998a1 commit 2e0352d

File tree

4,279 files changed

+146115
-151089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,279 files changed

+146115
-151089
lines changed

tools/eslint/README.md

+36-21
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,49 @@ After that, you can run ESLint on any JavaScript file:
3131

3232
eslint test.js test2.js
3333

34+
## Configuration
35+
36+
After running `eslint --init`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this:
37+
38+
```json
39+
{
40+
"rules": {
41+
"semi": [2, "always"],
42+
"quotes": [2, "double"]
43+
}
44+
}
45+
```
46+
47+
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:
48+
49+
* `0` - turn the rule off
50+
* `1` - turn the rule on as a warning (doesn't affect exit code)
51+
* `2` - turn the rule on as an error (exit code will be 1)
52+
53+
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)).
54+
55+
## Sponsors
56+
57+
* Development is sponsored by [Box](https://box.com)
58+
3459
## Team
3560

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

3863
* Nicholas C. Zakas ([@nzakas](https://github.com/nzakas)) - project lead
3964
* Ilya Volodin ([@ilyavolodin](https://github.com/ilyavolodin)) - reviewer
4065
* Brandon Mills ([@btmills](https://github.com/btmills)) - reviewer
66+
* Gyandeep Singh ([@gyandeeps](https://github.com/gyandeeps)) - reviewer
4167
* Mathias Schreck ([@lo1tuma](https://github.com/lo1tuma)) - committer
42-
* Gyandeep Singh ([@gyandeeps](https://github.com/gyandeeps)) - committer
4368
* Jamund Ferguson ([@xjamundx](https://github.com/xjamundx)) - committer
69+
* Ian VanSchooten ([@ianvs](https://github.com/ianvs)) - committer
70+
* Toru Nagashima ([@mysticatea](https://github.com/mysticatea)) - committer
71+
* Burak Yiğit Kaya ([@byk](https://github.com/byk)) - committer
72+
* Alberto Rodríguez ([@alberto](https://github.com/alberto)) - committer
73+
74+
## Releases
4475

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

4678
## Frequently Asked Questions
4779

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

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

70-
### Who is using ESLint?
71-
72-
The following projects are using ESLint to validate their JavaScript:
73-
74-
* [Drupal](https://www.drupal.org/node/2274223)
75-
* [Esprima](https://github.com/ariya/esprima)
76-
* [io.js](https://github.com/iojs/io.js/commit/f9dd34d301ab385ae316769b85ef916f9b70b6f6)
77-
* [WebKit](https://bugs.webkit.org/show_bug.cgi?id=125048)
78-
79-
In addition, the following companies are using ESLint internally to validate their JavaScript:
80-
81-
* [Box](https://box.com)
82-
* [CustomInk](https://customink.com)
83-
* [Fitbit](http://www.fitbit.com)
84-
* [HolidayCheck](http://holidaycheck.de)
85-
* [the native web](http://www.thenativeweb.io)
86-
87102
### What about ECMAScript 6 support?
88103

89104
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).
@@ -102,10 +117,10 @@ Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](ht
102117

103118

104119
[npm-image]: https://img.shields.io/npm/v/eslint.svg?style=flat-square
105-
[npm-url]: https://npmjs.org/package/eslint
120+
[npm-url]: https://www.npmjs.com/package/eslint
106121
[travis-image]: https://img.shields.io/travis/eslint/eslint/master.svg?style=flat-square
107122
[travis-url]: https://travis-ci.org/eslint/eslint
108123
[coveralls-image]: https://img.shields.io/coveralls/eslint/eslint/master.svg?style=flat-square
109124
[coveralls-url]: https://coveralls.io/r/eslint/eslint?branch=master
110-
[downloads-image]: http://img.shields.io/npm/dm/eslint.svg?style=flat-square
111-
[downloads-url]: https://npmjs.org/package/eslint
125+
[downloads-image]: https://img.shields.io/npm/dm/eslint.svg?style=flat-square
126+
[downloads-url]: https://www.npmjs.com/package/eslint

tools/eslint/bin/eslint.js

+33-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,39 @@
11
#!/usr/bin/env node
2-
var concat = require("concat-stream"),
3-
configInit = require("../lib/config-initializer"),
4-
cli = require("../lib/cli");
2+
3+
/**
4+
* @fileoverview Main CLI that is run via the eslint command.
5+
* @author Nicholas C. Zakas
6+
* @copyright 2013 Nicholas C. Zakas. All rights reserved.
7+
* See LICENSE file in root directory for full license.
8+
*/
9+
10+
"use strict";
11+
12+
//------------------------------------------------------------------------------
13+
// Helpers
14+
//------------------------------------------------------------------------------
515

616
var exitCode = 0,
717
useStdIn = (process.argv.indexOf("--stdin") > -1),
8-
init = (process.argv.indexOf("--init") > -1);
18+
init = (process.argv.indexOf("--init") > -1),
19+
debug = (process.argv.indexOf("--debug") > -1);
20+
21+
// must do this initialization *before* other requires in order to work
22+
if (debug) {
23+
require("debug").enable("eslint:*");
24+
}
25+
26+
//------------------------------------------------------------------------------
27+
// Requirements
28+
//------------------------------------------------------------------------------
29+
30+
// now we can safely include the other modules that use debug
31+
var concat = require("concat-stream"),
32+
cli = require("../lib/cli");
33+
34+
//------------------------------------------------------------------------------
35+
// Execution
36+
//------------------------------------------------------------------------------
937

1038
if (useStdIn) {
1139
process.stdin.pipe(concat({ encoding: "string" }, function(text) {
@@ -18,13 +46,13 @@ if (useStdIn) {
1846
}
1947
}));
2048
} else if (init) {
49+
var configInit = require("../lib/config/config-initializer");
2150
configInit.initializeConfig(function(err) {
2251
if (err) {
2352
exitCode = 1;
2453
console.error(err.message);
2554
console.error(err.stack);
2655
} else {
27-
console.log("Successfully created .eslintrc file in " + process.cwd());
2856
exitCode = 0;
2957
}
3058
});

tools/eslint/conf/blank-script.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"type": "Program",
3+
"body": [],
4+
"sourceType": "script",
5+
"range": [
6+
0,
7+
0
8+
],
9+
"loc": {
10+
"start": {
11+
"line": 0,
12+
"column": 0
13+
},
14+
"end": {
15+
"line": 0,
16+
"column": 0
17+
}
18+
},
19+
"comments": [],
20+
"tokens": []
21+
}

tools/eslint/conf/environments.js

+39-12
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
*/
66
"use strict";
77

8+
//------------------------------------------------------------------------------
9+
// Requirements
10+
//------------------------------------------------------------------------------
11+
812
var globals = require("globals");
913

14+
//------------------------------------------------------------------------------
15+
// Public Interface
16+
//------------------------------------------------------------------------------
17+
1018
module.exports = {
1119
builtin: globals.builtin,
1220
browser: {
@@ -16,16 +24,12 @@ module.exports = {
1624
globals: globals.node,
1725
ecmaFeatures: {
1826
globalReturn: true
19-
},
20-
rules: {
21-
"no-catch-shadow": 0,
22-
"no-console": 0,
23-
"no-mixed-requires": 2,
24-
"no-new-require": 2,
25-
"no-path-concat": 2,
26-
"no-process-exit": 2,
27-
"global-strict": [0, "always"],
28-
"handle-callback-err": [2, "err"]
27+
}
28+
},
29+
commonjs: {
30+
globals: globals.commonjs,
31+
ecmaFeatures: {
32+
globalReturn: true
2933
}
3034
},
3135
worker: {
@@ -40,12 +44,18 @@ module.exports = {
4044
jasmine: {
4145
globals: globals.jasmine
4246
},
47+
jest: {
48+
globals: globals.jest
49+
},
4350
phantomjs: {
44-
globals: globals.phantom
51+
globals: globals.phantomjs
4552
},
4653
jquery: {
4754
globals: globals.jquery
4855
},
56+
qunit: {
57+
globals: globals.qunit
58+
},
4959
prototypejs: {
5060
globals: globals.prototypejs
5161
},
@@ -58,9 +68,24 @@ module.exports = {
5868
mongo: {
5969
globals: globals.mongo
6070
},
71+
protractor: {
72+
globals: globals.protractor
73+
},
6174
applescript: {
6275
globals: globals.applescript
6376
},
77+
nashorn: {
78+
globals: globals.nashorn
79+
},
80+
serviceworker: {
81+
globals: globals.serviceworker
82+
},
83+
embertest: {
84+
globals: globals.embertest
85+
},
86+
webextensions: {
87+
globals: globals.webextensions
88+
},
6489
es6: {
6590
ecmaFeatures: {
6691
arrowFunctions: true,
@@ -81,7 +106,9 @@ module.exports = {
81106
objectLiteralDuplicateProperties: true,
82107
generators: true,
83108
destructuring: true,
84-
classes: true
109+
classes: true,
110+
spread: true,
111+
newTarget: true
85112
}
86113
}
87114
};

0 commit comments

Comments
 (0)