Skip to content

Commit 459ea33

Browse files
TrottMylesBorins
authored andcommitted
tools: update ESLint to version 2.1.0
Update ESLint to 2.1.0. ESLint has a number of potentially-useful new features but this change attempts to be minimal in its changes. However, some things could not be avoided reasonably. ESLint 2.1.0 found a few lint issues that ESLing 1.x missed with template strings that did not take advantage of any features of template strings, and `let` declarations where `const` sufficed. Additionally, ESLint 2.1.0 removes some granularity around enabling ES6 features. Some features (e.g., spread operator) that had been turned off in our configuration for ESLint 1.x are now permitted. PR-URL: #5214 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: jbergstroem - Johan Bergström <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Myles Borins <[email protected]>
1 parent c9928cf commit 459ea33

File tree

2,897 files changed

+109743
-122855
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,897 files changed

+109743
-122855
lines changed

tools/eslint/README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[![NPM version][npm-image]][npm-url]
22
[![build status][travis-image]][travis-url]
3+
[![Build status][appveyor-image]][appveyor-url]
34
[![Test coverage][coveralls-image]][coveralls-url]
45
[![Downloads][downloads-image]][downloads-url]
56
[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=282608)](https://www.bountysource.com/trackers/282608-eslint?utm_source=282608&utm_medium=shield&utm_campaign=TRACKER_BADGE)
67
[![Join the chat at https://gitter.im/eslint/eslint](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/eslint/eslint?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
78

89
# ESLint
910

10-
[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) | [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)
1112

1213
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:
1314

@@ -55,6 +56,7 @@ The three error levels allow you fine-grained control over how ESLint applies ru
5556
## Sponsors
5657

5758
* Development is sponsored by [Box](https://box.com)
59+
* Site search ([eslint.org](http://eslint.org)) is sponsored by [Algolia](https://www.algolia.com)
5860

5961
## Team
6062

@@ -75,6 +77,14 @@ These folks keep the project moving and are resources for help:
7577

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

80+
## Filing Issues
81+
82+
Before filing an issue, please be sure to read the guidelines for what you're reporting:
83+
84+
* [Bug Report](http://eslint.org/docs/developer-guide/contributing/reporting-bugs)
85+
* [Propose a New Rule](http://eslint.org/docs/developer-guide/contributing/new-rules)
86+
* [Request a Change](http://eslint.org/docs/developer-guide/contributing/changes)
87+
7888
## Frequently Asked Questions
7989

8090
### Why don't you like JSHint???
@@ -120,6 +130,8 @@ Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](ht
120130
[npm-url]: https://www.npmjs.com/package/eslint
121131
[travis-image]: https://img.shields.io/travis/eslint/eslint/master.svg?style=flat-square
122132
[travis-url]: https://travis-ci.org/eslint/eslint
133+
[appveyor-image]: https://ci.appveyor.com/api/projects/status/iwxmiobcvbw3b0av/branch/master?svg=true
134+
[appveyor-url]: https://ci.appveyor.com/project/nzakas/eslint/branch/master
123135
[coveralls-image]: https://img.shields.io/coveralls/eslint/eslint/master.svg?style=flat-square
124136
[coveralls-url]: https://coveralls.io/r/eslint/eslint?branch=master
125137
[downloads-image]: https://img.shields.io/npm/dm/eslint.svg?style=flat-square

tools/eslint/bin/eslint.js

+14-8
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var exitCode = 0,
2020

2121
// must do this initialization *before* other requires in order to work
2222
if (debug) {
23-
require("debug").enable("eslint:*");
23+
require("debug").enable("eslint:*,-eslint:code-path");
2424
}
2525

2626
//------------------------------------------------------------------------------
@@ -60,10 +60,16 @@ if (useStdIn) {
6060
exitCode = cli.execute(process.argv);
6161
}
6262

63-
/*
64-
* Wait for the stdout buffer to drain.
65-
* See https://github.com/eslint/eslint/issues/317
66-
*/
67-
process.on("exit", function() {
68-
process.exit(exitCode);
69-
});
63+
// https://github.com/eslint/eslint/issues/4691
64+
// In Node.js >= 0.12, you can use a cleaner way
65+
if ("exitCode" in process) {
66+
process.exitCode = exitCode;
67+
} else {
68+
/*
69+
* Wait for the stdout buffer to drain.
70+
* See https://github.com/eslint/eslint/issues/317
71+
*/
72+
process.on("exit", function() {
73+
process.exit(exitCode);
74+
});
75+
}

tools/eslint/conf/cli-options.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @fileoverview Default CLIEngineOptions.
3+
* @author Ian VanSchooten
4+
* @copyright 2016 Ian VanSchooten. All rights reserved.
5+
* See LICENSE in root directory for full license.
6+
*/
7+
8+
"use strict";
9+
10+
var DEFAULT_PARSER = require("../conf/eslint.json").parser;
11+
12+
module.exports = {
13+
configFile: null,
14+
baseConfig: false,
15+
rulePaths: [],
16+
useEslintrc: true,
17+
envs: [],
18+
globals: [],
19+
rules: {},
20+
extensions: [".js"],
21+
ignore: true,
22+
ignorePath: null,
23+
parser: DEFAULT_PARSER,
24+
cache: false,
25+
// in order to honor the cacheFile option if specified
26+
// this option should not have a default value otherwise
27+
// it will always be used
28+
cacheLocation: "",
29+
cacheFile: ".eslintcache",
30+
fix: false,
31+
allowInlineConfig: true,
32+
cwd: process.cwd()
33+
};

tools/eslint/conf/environments.js

+21-27
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,29 @@ var globals = require("globals");
1616
//------------------------------------------------------------------------------
1717

1818
module.exports = {
19-
builtin: globals.builtin,
19+
builtin: globals.es5,
2020
browser: {
2121
globals: globals.browser
2222
},
2323
node: {
2424
globals: globals.node,
25-
ecmaFeatures: {
26-
globalReturn: true
25+
parserOptions: {
26+
ecmaFeatures: {
27+
globalReturn: true
28+
}
2729
}
2830
},
2931
commonjs: {
3032
globals: globals.commonjs,
31-
ecmaFeatures: {
32-
globalReturn: true
33+
parserOptions: {
34+
ecmaFeatures: {
35+
globalReturn: true
36+
}
3337
}
3438
},
39+
"shared-node-browser": {
40+
globals: globals["shared-node-browser"]
41+
},
3542
worker: {
3643
globals: globals.worker
3744
},
@@ -80,35 +87,22 @@ module.exports = {
8087
serviceworker: {
8188
globals: globals.serviceworker
8289
},
90+
atomtest: {
91+
globals: globals.atomtest
92+
},
8393
embertest: {
8494
globals: globals.embertest
8595
},
8696
webextensions: {
8797
globals: globals.webextensions
8898
},
8999
es6: {
90-
ecmaFeatures: {
91-
arrowFunctions: true,
92-
blockBindings: true,
93-
regexUFlag: true,
94-
regexYFlag: true,
95-
templateStrings: true,
96-
binaryLiterals: true,
97-
octalLiterals: true,
98-
unicodeCodePointEscapes: true,
99-
superInFunctions: true,
100-
defaultParams: true,
101-
restParams: true,
102-
forOf: true,
103-
objectLiteralComputedProperties: true,
104-
objectLiteralShorthandMethods: true,
105-
objectLiteralShorthandProperties: true,
106-
objectLiteralDuplicateProperties: true,
107-
generators: true,
108-
destructuring: true,
109-
classes: true,
110-
spread: true,
111-
newTarget: true
100+
globals: globals.es6,
101+
parserOptions: {
102+
ecmaVersion: 6
112103
}
104+
},
105+
greasemonkey: {
106+
globals: globals.greasemonkey
113107
}
114108
};

0 commit comments

Comments
 (0)