Skip to content

Commit 3ce59ab

Browse files
silverwindMylesBorins
authored andcommitted
tools: update ESLint to 2.7.0
PR-URL: #6132 Reviewed-By: Brian White <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: thefourtheye <[email protected]>
1 parent 1af0e44 commit 3ce59ab

File tree

2,040 files changed

+40599
-36892
lines changed

Some content is hidden

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

2,040 files changed

+40599
-36892
lines changed

tools/eslint/CHANGELOG.md

+2,892
Large diffs are not rendered by default.

tools/eslint/README.md

+20-12
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# ESLint
1010

11-
[Website](http://eslint.org) | [Configuring](http://eslint.org/docs/user-guide/configuring) | [Rules](http://eslint.org/docs/rules/) | [Contributing](http://eslint.org/docs/developer-guide/contributing) | [Reporting Bugs](http://eslint.org/docs/developer-guide/contributing/reporting-bugs) | [Twitter](https://twitter.com/geteslint) | [Mailing List](https://groups.google.com/group/eslint)
11+
[Website](http://eslint.org) | [Configuring](http://eslint.org/docs/user-guide/configuring) | [Rules](http://eslint.org/docs/rules/) | [Contributing](http://eslint.org/docs/developer-guide/contributing) | [Reporting Bugs](http://eslint.org/docs/developer-guide/contributing/reporting-bugs) | [Twitter](https://twitter.com/geteslint) | [Mailing List](https://groups.google.com/group/eslint) | [Chat Room](https://gitter.im/eslint/eslint)
1212

1313
ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions:
1414

@@ -39,17 +39,17 @@ After running `eslint --init`, you'll have a `.eslintrc` file in your directory.
3939
```json
4040
{
4141
"rules": {
42-
"semi": [2, "always"],
43-
"quotes": [2, "double"]
42+
"semi": ["error", "always"],
43+
"quotes": ["error", "double"]
4444
}
4545
}
4646
```
4747

4848
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:
4949

50-
* `0` - turn the rule off
51-
* `1` - turn the rule on as a warning (doesn't affect exit code)
52-
* `2` - turn the rule on as an error (exit code will be 1)
50+
* `"off"` or `0` - turn the rule off
51+
* `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code)
52+
* `"error"` or `2` - turn the rule on as an error (exit code will be 1)
5353

5454
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)).
5555

@@ -66,12 +66,14 @@ These folks keep the project moving and are resources for help:
6666
* Ilya Volodin ([@ilyavolodin](https://github.com/ilyavolodin)) - reviewer
6767
* Brandon Mills ([@btmills](https://github.com/btmills)) - reviewer
6868
* Gyandeep Singh ([@gyandeeps](https://github.com/gyandeeps)) - reviewer
69+
* Toru Nagashima ([@mysticatea](https://github.com/mysticatea)) - reviewer
6970
* Mathias Schreck ([@lo1tuma](https://github.com/lo1tuma)) - committer
7071
* Jamund Ferguson ([@xjamundx](https://github.com/xjamundx)) - committer
7172
* Ian VanSchooten ([@ianvs](https://github.com/ianvs)) - committer
72-
* Toru Nagashima ([@mysticatea](https://github.com/mysticatea)) - committer
7373
* Burak Yiğit Kaya ([@byk](https://github.com/byk)) - committer
7474
* Alberto Rodríguez ([@alberto](https://github.com/alberto)) - committer
75+
* Kai Cataldo ([@kaicataldo](https://github.com/kaicataldo)) - committer
76+
* Michael Ficarra ([@michaelficarra](https://github.com/michaelficarra)) - committer
7577

7678
## Releases
7779

@@ -83,6 +85,7 @@ Before filing an issue, please be sure to read the guidelines for what you're re
8385

8486
* [Bug Report](http://eslint.org/docs/developer-guide/contributing/reporting-bugs)
8587
* [Propose a New Rule](http://eslint.org/docs/developer-guide/contributing/new-rules)
88+
* [Proposing a Rule Change](http://eslint.org/docs/developer-guide/contributing/rule-changes)
8689
* [Request a Change](http://eslint.org/docs/developer-guide/contributing/changes)
8790

8891
## Frequently Asked Questions
@@ -109,18 +112,23 @@ If you are using both JSHint and JSCS on your files, then using just ESLint will
109112

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

112-
### What about ECMAScript 6 support?
113-
114-
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).
115-
116115
### Does ESLint support JSX?
117116

118117
Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](http://eslint.org/docs/user-guide/configuring).). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics.
119118

120-
### What about ECMAScript 7/2016 and experimental features?
119+
### What about ECMAScript 6 support?
120+
121+
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).
122+
123+
### What about experimental features?
121124

122125
ESLint doesn't natively support experimental ECMAScript language features. You can use [babel-eslint](https://github.com/babel/babel-eslint) to use any option available in Babel.
123126

127+
Once a language feature has been adopted into the ECMAScript standard, we will accept
128+
issues and pull requests related to the new feature, subject to our [contributing
129+
guidelines](http://eslint.org/docs/developer-guide/contributing). Until then, please use
130+
the appropriate parser and plugin(s) for your experimental feature.
131+
124132
### Where to ask for help?
125133

126134
Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](https://gitter.im/eslint/eslint)

tools/eslint/bin/eslint.js

100755100644
+20-1
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,31 @@ if (debug) {
2929

3030
// now we can safely include the other modules that use debug
3131
var concat = require("concat-stream"),
32-
cli = require("../lib/cli");
32+
cli = require("../lib/cli"),
33+
path = require("path"),
34+
fs = require("fs");
3335

3436
//------------------------------------------------------------------------------
3537
// Execution
3638
//------------------------------------------------------------------------------
3739

40+
process.on("uncaughtException", function(err){
41+
// lazy load
42+
var lodash = require("lodash");
43+
44+
if (typeof err.messageTemplate === "string" && err.messageTemplate.length > 0) {
45+
var template = lodash.template(fs.readFileSync(path.resolve(__dirname, "../messages/" + err.messageTemplate + ".txt"), "utf-8"));
46+
47+
console.log("\nOops! Something went wrong! :(");
48+
console.log("\n" + template(err.messageData || {}));
49+
} else {
50+
console.log(err.message);
51+
console.log(err.stack);
52+
}
53+
54+
process.exit(1);
55+
});
56+
3857
if (useStdIn) {
3958
process.stdin.pipe(concat({ encoding: "string" }, function(text) {
4059
try {

tools/eslint/conf/cli-options.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,5 @@ module.exports = {
2828
cacheLocation: "",
2929
cacheFile: ".eslintcache",
3030
fix: false,
31-
allowInlineConfig: true,
32-
cwd: process.cwd()
31+
allowInlineConfig: true
3332
};

0 commit comments

Comments
 (0)