Skip to content

Commit 6a76485

Browse files
TrottMyles Borins
authored and
Myles Borins
committed
tools: update ESLint to 2.9.0
ESLint 2.9.0 fixes some minor bugs that we have been experiencing and introduces some new rules that we may wish to consider. PR-URL: #6498 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent 552e25c commit 6a76485

File tree

544 files changed

+22057
-30045
lines changed

Some content is hidden

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

544 files changed

+22057
-30045
lines changed

tools/eslint/CHANGELOG.md

+92
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,95 @@
1+
v2.9.0 - April 29, 2016
2+
3+
* a8a2cd8 Fix: Avoid autoconfig crashes from inline comments (fixes #5992) (#5999) (Ian VanSchooten)
4+
* 23b00e0 Upgrade: npm-license to 0.3.2 (fixes #5996) (#5998) (alberto)
5+
* 377167d Upgrade: ignore to 3.1.2 (fixes #5979) (#5988) (alberto)
6+
* 141b778 Fix: no-control-regex literal handling fixed. (fixes #5737) (#5943) (Efe Gürkan YALAMAN)
7+
* 577757d Fix: Clarify color option (fixes #5928) (#5974) (Grant Snodgrass)
8+
* e7e6581 Docs: Update CLA link (#5980) (Gustav Nikolaj)
9+
* 0be26bc Build: Add nodejs 6 to travis (fixes #5971) (#5973) (Gyandeep Singh)
10+
* e606523 New: Rule `no-unsafe-finally` (fixes #5808) (#5932) (Onur Temizkan)
11+
* 42d1ecc Chore: Add metadata to existing rules - Batch 7 (refs #5417) (#5969) (Vitor Balocco)
12+
* e2ad1ec Update: object-shorthand lints computed methods (fixes #5871) (#5963) (Chris Sauvé)
13+
* d24516a Chore: Add metadata to existing rules - Batch 6 (refs #5417) (#5966) (Vitor Balocco)
14+
* 1e7a3ef Fix: `id-match` false positive in property values (fixes #5885) (#5960) (Mike Sherov)
15+
* 51ddd4b Update: Use process @abstract when processing @return (fixes #5941) (#5945) (Simon Schick)
16+
* 52a4bea Update: Add autofix for `no-whitespace-before-property` (fixes #5927) (#5951) (alberto)
17+
* 46e058d Docs: Correct typo in configuring.md (#5957) (Nick S. Plekhanov)
18+
* 5f8abab Chore: Add metadata to existing rules - Batch 5 (refs #5417) (#5944) (Vitor Balocco)
19+
* 0562f77 Chore: Add missing newlines to test cases (fixes #5947) (Rich Trott)
20+
* fc78e78 Chore: Enable quote-props rule in eslint-config-eslint (refs #5188) (#5938) (Gyandeep Singh)
21+
* 43f6d05 Docs: Update docs to refer to column (#5937) (Sashko Stubailo)
22+
* 586478e Update: Add autofix for `comma-dangle` (fixes #3805) (#5925) (alberto)
23+
* a4f9c5a Docs: Distinguish examples in rules under Stylistic Issues part 3 (Kenneth Williams)
24+
* e7c0737 Chore: Enable no-console rule in eslint-config-eslint (refs #5188) (Kevin Partington)
25+
* 0023fe6 Build: Add “chore” to commit tags (fixes #5880) (#5929) (Mike Sherov)
26+
* 25d626a Upgrade: espree 3.1.4 (fixes #5923, fixes #5756) (Kai Cataldo)
27+
* a01b412 New: Add `no-useless-computed-key` rule (fixes #5402) (Burak Yigit Kaya)
28+
* 9afb9cb Chore: Remove workaround for espree and escope bugs (fixes #5852) (alberto)
29+
* 3ffc582 Chore: Update copyright and license info (alberto)
30+
* 249eb40 Docs: Clarify init sets up local installation (fixes #5874) (Kai Cataldo)
31+
* 6cd8c86 Docs: Describe options in rules under Possible Errors part 1 (Mark Pedrotti)
32+
* f842d18 Fix: `no-this-before-super` crash on unreachable paths (fixes #5894) (Toru Nagashima)
33+
* a02960b Docs: Fix missing delimiter in README links (Kevin Partington)
34+
* 3a9e72c Docs: Update developer guide with new standards (Nicholas C. Zakas)
35+
* cb78585 Update: Add `allowUnboundThis` to `prefer-arrow-callback` (fixes #4668) (Burak Yigit Kaya)
36+
* 02be29f Chore: Remove CLA check from bot (Nicholas C. Zakas)
37+
* 220713e Chore: Add metadata to existing rules - Batch 4 (refs #5417) (Vitor Balocco)
38+
* df53414 Chore: Include jQuery Foundation info (Nicholas C. Zakas)
39+
* f1b2992 Fix: `no-useless-escape` false positive in JSXAttribute (fixes #5882) (Toru Nagashima)
40+
* 74674ad Docs: Move `sort-imports` to 'ECMAScript 6' (Kenneth Williams)
41+
* ae69ddb Docs: Fix severity type in example (Kenneth Williams)
42+
* 19f6fff Update: Autofixing does multiple passes (refs #5329) (Nicholas C. Zakas)
43+
* 1e4b0ca Docs: Reduce length of paragraphs in rules index (Mark Pedrotti)
44+
* 8cfe1eb Docs: Fix a wrong option (Zach Orlovsky)
45+
* 8f6739f Docs: Add alberto as reviewer (alberto)
46+
* 2ae4938 Docs: Fix message for `inline-config` option (alberto)
47+
* 089900b Docs: Fix a wrong rule name in an example (Toru Nagashima)
48+
* c032b41 Docs: Fix emphasis (Toru Nagashima)
49+
* ae606f0 Docs: Update JSCS info in README (alberto)
50+
* a9c5323 Fix: Install ESLint on init if not installed (fixes #5833) (Kai Cataldo)
51+
* ed38358 Docs: Removed incorrect example (James M. Greene)
52+
* af3113c Docs: Fix config comments in indent docs (Brandon Mills)
53+
* 2b39461 Update: `commentPattern` option for `default-case` rule (fixes #5803) (Artyom Lvov)
54+
55+
v2.8.0 - April 15, 2016
56+
57+
* a8821a5 Docs: Distinguish examples in rules under Stylistic Issues part 2 (Kenneth Williams)
58+
* 76913b6 Update: Add metadata to existing rules - Batch 3 (refs #5417) (Vitor Balocco)
59+
* 34ad8d2 Fix: Check that module.paths exists (fixes #5791) (Nicholas C. Zakas)
60+
* 37239b1 Docs: Add new members of the team (Ilya Volodin)
61+
* fb3c2eb Update: allow template literals (fixes #5234) (Jonathan Haines)
62+
* 5a4a935 Update: Add metadata to existing rules - Batch 2 (refs #5417) (Vitor Balocco)
63+
* ea2e625 Fix: newline-before-return handles return as first token (fixes #5816) (Kevin Partington)
64+
* f8db9c9 Update: add nestedBinaryExpressions to no-extra-parens (fixes #3065) (Ilya Volodin)
65+
* 0045d57 Update: `allowNamedFunctions` in `prefer-arrow-callback` (fixes #5675) (alberto)
66+
* 19da72a Update: Add metadata to existing rules - Batch 1 (refs #5417) (Vitor Balocco)
67+
* cc14e43 Fix: `no-fallthrough` empty case with comment (fixes #5799) (alberto)
68+
* 13c8b14 Fix: LogicalExpression checks for short circuit (fixes #5693) (Vamshi krishna)
69+
* 73b225e Fix: Document and fix metadata (refs #5417) (Ilya Volodin)
70+
* 882d199 Docs: Improve options description in `no-redeclare` (alberto)
71+
* 6a71ceb Docs: Improve options description in `no-params-reassign` (alberto)
72+
* 24b6215 Update: Include 'typeof' in rule 'no-constant-condition' (fixes #5228) (Vamshi krishna)
73+
* a959063 Docs: Remove link to deprecated ESLintTester project (refs #3110) (Trey Thomas)
74+
* 6fd7d82 Update: Change order in `eslint --init` env options (fixes #5742) (alberto)
75+
* c59d909 Fix: Extra paren check around object arrow bodies (fixes #5789) (Brandon Mills)
76+
* 6f88546 Docs: Use double quotes for better Win compatibility (fixes #5796) (alberto)
77+
* 02743d5 Fix: catch self-assignment operators in `no-magic-number` (fixes #4400) (alberto)
78+
* c94e74e Docs: Make rule descriptions more consistent (Kenneth Williams)
79+
* 6028252 Docs: Distinguish examples in rules under Stylistic Issues part 1 (Mark Pedrotti)
80+
* ccd8ca9 Fix: Added property onlyDeclaration to id-match rule (fixes #3488) (Gajus Kuizinas)
81+
* 6703c02 Update: no-useless-escape / exact locations of errors (fixes #5751) (Onur Temizkan)
82+
* 3d84b91 Fix: ignore trailing whitespace in template literal (fixes #5786) (Kai Cataldo)
83+
* b0e6bc4 Update: add allowEmptyCatch option to no-empty (fixes #5800) (Kai Cataldo)
84+
* f1f1dd7 Docs: Add @pedrottimark as a committer (Brandon Mills)
85+
* 228f201 Update: `commentPattern` option for `no-fallthrough` rule (fixes #5757) (Artyom Lvov)
86+
* 41db670 Docs: Clarify disable inline comments (Kai Cataldo)
87+
* 9c9a295 Docs: Add note about shell vs node glob parameters in cli (alberto)
88+
* 5308ff9 Docs: Add code backticks to sentence in fixable rules (Mark Pedrotti)
89+
* 965ec06 Docs: fix the examples for space-before-function-paren. (Craig Silverstein)
90+
* 2b202fc Update: Add ignore option to space-before-function-parens (fixes #4127) (Craig Silverstein)
91+
* 24c12ba Fix: improve `constructor-super` errors for literals (fixes #5449) (Toru Nagashima)
92+
193
v2.7.0 - April 4, 2016
294

395
* 134cb1f Revert "Update: adds nestedBinaryExpressions for no-extra-parens rule (fixes #3065)" (Ilya Volodin)

tools/eslint/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ESLint
2-
Copyright (c) 2013 Nicholas C. Zakas. All rights reserved.
2+
Copyright jQuery Foundation and other contributors, https://jquery.org/
33

44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal

tools/eslint/README.md

+25-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@
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) | [Chat Room](https://gitter.im/eslint/eslint)
11+
[Website](http://eslint.org) |
12+
[Configuring](http://eslint.org/docs/user-guide/configuring) |
13+
[Rules](http://eslint.org/docs/rules/) |
14+
[Contributing](http://eslint.org/docs/developer-guide/contributing) |
15+
[Reporting Bugs](http://eslint.org/docs/developer-guide/contributing/reporting-bugs) |
16+
[Code of Conduct](https://jquery.org/conduct/) |
17+
[Twitter](https://twitter.com/geteslint) |
18+
[Mailing List](https://groups.google.com/group/eslint) |
19+
[Chat Room](https://gitter.im/eslint/eslint)
1220

1321
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:
1422

@@ -32,6 +40,8 @@ After that, you can run ESLint on any JavaScript file:
3240

3341
eslint test.js test2.js
3442

43+
**Note:** `eslint --init` is intended for setting up and configuring ESLint on a per-project basis and will perform a local installation of ESLint and its plugins in the directory in which it is run. If you prefer using a global installation of ESLint, any plugins used in your configuration must also be installed globally.
44+
3545
## Configuration
3646

3747
After running `eslint --init`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this:
@@ -67,13 +77,19 @@ These folks keep the project moving and are resources for help:
6777
* Brandon Mills ([@btmills](https://github.com/btmills)) - reviewer
6878
* Gyandeep Singh ([@gyandeeps](https://github.com/gyandeeps)) - reviewer
6979
* Toru Nagashima ([@mysticatea](https://github.com/mysticatea)) - reviewer
80+
* Alberto Rodríguez ([@alberto](https://github.com/alberto)) - reviewer
7081
* Mathias Schreck ([@lo1tuma](https://github.com/lo1tuma)) - committer
7182
* Jamund Ferguson ([@xjamundx](https://github.com/xjamundx)) - committer
7283
* Ian VanSchooten ([@ianvs](https://github.com/ianvs)) - committer
7384
* Burak Yiğit Kaya ([@byk](https://github.com/byk)) - committer
74-
* Alberto Rodríguez ([@alberto](https://github.com/alberto)) - committer
7585
* Kai Cataldo ([@kaicataldo](https://github.com/kaicataldo)) - committer
7686
* Michael Ficarra ([@michaelficarra](https://github.com/michaelficarra)) - committer
87+
* Mark Pedrotti ([@pedrottimark](https://github.com/pedrottimark)) - committer
88+
* Oleg Gaidarenko ([@markelog](https://github.com/markelog)) - committer
89+
* Mike Sherov [@mikesherov](https://github.com/mikesherov)) - committer
90+
* Henry Zhu ([@hzoo](https://github.com/hzoo)) - committer
91+
* Marat Dulin ([@mdevils](https://github.com/mdevils)) - committer
92+
* Alexej Yaroshevich ([@zxqfox](https://github.com/zxqfox)) - committer
7793

7894
## Releases
7995

@@ -98,15 +114,19 @@ I do like JSHint. And I like Anton and Rick. Neither of those were deciding fact
98114

99115
That's not really a question, but I got it. I'm not trying to convince you that ESLint is better than JSHint. The only thing I know is that ESLint is better than JSHint for what I'm doing. In the off chance you're doing something similar, it might be better for you. Otherwise, keep using JSHint, I'm certainly not going to tell you to stop using it.
100116

101-
### How does ESLint performance compare to JSHint and JSCS?
117+
### How does ESLint performance compare to JSHint?
102118

103119
ESLint is slower than JSHint, usually 2-3x slower on a single file. This is because ESLint uses Espree to construct an AST before it can evaluate your code whereas JSHint evaluates your code as it's being parsed. The speed is also based on the number of rules you enable; the more rules you enable, the slower the process.
104120

105121
Despite being slower, we believe that ESLint is fast enough to replace JSHint without causing significant pain.
106122

107-
ESLint is faster than JSCS, as ESLint uses a single-pass traversal for analysis whereas JSCS using a querying model.
123+
### I heard ESLint is going to replace JSCS?
124+
125+
Yes. Since we are solving the same problems, ESLint and JSCS teams have decided to join forces and work together in the development of ESLint instead of competing with each other. You can read more about this in both [ESLint](http://eslint.org/blog/2016/04/welcoming-jscs-to-eslint) and [JSCS](https://medium.com/@markelog/jscs-end-of-the-line-bc9bf0b3fdb2#.u76sx334n) announcements.
126+
127+
### So, should I stop using JSCS and start using ESLint?
108128

109-
If you are using both JSHint and JSCS on your files, then using just ESLint will be faster.
129+
Not yet. We are still working to smooth the transition. You can see our progress [here](https://github.com/eslint/eslint/milestones/JSCS%20Compatibility). We’ll announce when all of the changes necessary to support JSCS users in ESLint are complete and will start encouraging JSCS users to switch to ESLint at that time. Meanwhile, we recommend you to upgrade to JSCS 3.0 and provide feedback to the team.
110130

111131
### Is ESLint just linting or does it also check style?
112132

tools/eslint/bin/eslint.js

100644100755
-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
/**
44
* @fileoverview Main CLI that is run via the eslint command.
55
* @author Nicholas C. Zakas
6-
* @copyright 2013 Nicholas C. Zakas. All rights reserved.
7-
* See LICENSE file in root directory for full license.
86
*/
97

108
"use strict";

tools/eslint/conf/cli-options.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* @fileoverview Default CLIEngineOptions.
33
* @author Ian VanSchooten
4-
* @copyright 2016 Ian VanSchooten. All rights reserved.
5-
* See LICENSE in root directory for full license.
64
*/
75

86
"use strict";

tools/eslint/conf/environments.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* @fileoverview Defines environment settings and globals.
33
* @author Elan Shanker
4-
* @copyright 2014 Elan Shanker. All rights reserved.
54
*/
65
"use strict";
76

tools/eslint/conf/eslint.json

+2
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,13 @@
109109
"no-unmodified-loop-condition": "off",
110110
"no-unneeded-ternary": "off",
111111
"no-unreachable": "error",
112+
"no-unsafe-finally": "off",
112113
"no-unused-expressions": "off",
113114
"no-unused-labels": "error",
114115
"no-unused-vars": "error",
115116
"no-use-before-define": "off",
116117
"no-useless-call": "off",
118+
"no-useless-computed-key": "off",
117119
"no-useless-concat": "off",
118120
"no-useless-constructor": "off",
119121
"no-useless-escape": "off",

tools/eslint/lib/ast-utils.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* @fileoverview Common utils for AST.
33
* @author Gyandeep Singh
4-
* @copyright 2015 Gyandeep Singh. All rights reserved.
5-
* See LICENSE file in root directory for full license.
64
*/
75

86
"use strict";

tools/eslint/lib/cli-engine.js

+82-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* @fileoverview Main CLI object.
33
* @author Nicholas C. Zakas
4-
* @copyright 2014 Nicholas C. Zakas. All rights reserved.
5-
* See LICENSE in root directory for full license.
64
*/
75

86
"use strict";
@@ -115,6 +113,79 @@ function calculateStatsPerRun(results) {
115113
});
116114
}
117115

116+
/**
117+
* Performs multiple autofix passes over the text until as many fixes as possible
118+
* have been applied.
119+
* @param {string} text The source text to apply fixes to.
120+
* @param {Object} config The ESLint config object to use.
121+
* @param {Object} options The ESLint options object to use.
122+
* @param {string} options.filename The filename from which the text was read.
123+
* @param {boolean} options.allowInlineConfig Flag indicating if inline comments
124+
* should be allowed.
125+
* @returns {Object} The result of the fix operation as returned from the
126+
* SourceCodeFixer.
127+
* @private
128+
*/
129+
function multipassFix(text, config, options) {
130+
131+
var messages = [],
132+
fixedResult,
133+
fixed = false,
134+
passNumber = 0,
135+
lastMessageCount,
136+
MAX_PASSES = 10;
137+
138+
/**
139+
* This loop continues until one of the following is true:
140+
*
141+
* 1. No more fixes have been applied.
142+
* 2. There are no more linting errors reported.
143+
* 3. The number of linting errors is no different between two passes.
144+
* 4. Ten passes have been made.
145+
*
146+
* That means anytime a fix is successfully applied, there will be another pass.
147+
* Essentially, guaranteeing a minimum of two passes.
148+
*/
149+
do {
150+
passNumber++;
151+
lastMessageCount = messages.length;
152+
153+
debug("Linting code for " + options.filename + " (pass " + passNumber + ")");
154+
messages = eslint.verify(text, config, options);
155+
156+
debug("Generating fixed text for " + options.filename + " (pass " + passNumber + ")");
157+
fixedResult = SourceCodeFixer.applyFixes(eslint.getSourceCode(), messages);
158+
159+
// keep track if any fixes were ever applied - important for return value
160+
fixed = fixed || fixedResult.fixed;
161+
162+
// update to use the fixed output instead of the original text
163+
text = fixedResult.output;
164+
165+
} while (
166+
fixedResult.fixed && fixedResult.messages.length > 0 &&
167+
fixedResult.messages.length !== lastMessageCount &&
168+
passNumber < MAX_PASSES
169+
);
170+
171+
172+
/*
173+
* If the last result had fixes, we need to lint again to me sure we have
174+
* the most up-to-date information.
175+
*/
176+
if (fixedResult.fixed) {
177+
fixedResult.messages = eslint.verify(text, config, options);
178+
}
179+
180+
181+
// ensure the last result properly reflects if fixes were done
182+
fixedResult.fixed = fixed;
183+
fixedResult.output = text;
184+
185+
return fixedResult;
186+
187+
}
188+
118189
/**
119190
* Processes an source code using ESLint.
120191
* @param {string} text The source code to check.
@@ -179,15 +250,17 @@ function processText(text, configHelper, filename, fix, allowInlineConfig) {
179250

180251
} else {
181252

182-
messages = eslint.verify(text, config, {
183-
filename: filename,
184-
allowInlineConfig: allowInlineConfig
185-
});
186-
187253
if (fix) {
188-
debug("Generating fixed text for " + filename);
189-
fixedResult = SourceCodeFixer.applyFixes(eslint.getSourceCode(), messages);
254+
fixedResult = multipassFix(text, config, {
255+
filename: filename,
256+
allowInlineConfig: allowInlineConfig
257+
});
190258
messages = fixedResult.messages;
259+
} else {
260+
messages = eslint.verify(text, config, {
261+
filename: filename,
262+
allowInlineConfig: allowInlineConfig
263+
});
191264
}
192265
}
193266

tools/eslint/lib/code-path-analysis/code-path-analyzer.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* @fileoverview A class of the code path analyzer.
33
* @author Toru Nagashima
4-
* @copyright 2015 Toru Nagashima. All rights reserved.
5-
* See LICENSE file in root directory for full license.
64
*/
75

86
"use strict";

tools/eslint/lib/code-path-analysis/code-path-segment.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* @fileoverview A class of the code path segment.
33
* @author Toru Nagashima
4-
* @copyright 2015 Toru Nagashima. All rights reserved.
5-
* See LICENSE file in root directory for full license.
64
*/
75

86
"use strict";
@@ -11,8 +9,7 @@
119
// Requirements
1210
//------------------------------------------------------------------------------
1311

14-
var assert = require("assert"),
15-
debug = require("./debug-helpers");
12+
var debug = require("./debug-helpers");
1613

1714
//------------------------------------------------------------------------------
1815
// Helpers
@@ -178,7 +175,13 @@ CodePathSegment.newNext = function(id, allPrevSegments) {
178175
* @returns {CodePathSegment} The created segment.
179176
*/
180177
CodePathSegment.newUnreachable = function(id, allPrevSegments) {
181-
return new CodePathSegment(id, flattenUnusedSegments(allPrevSegments), false);
178+
var segment = new CodePathSegment(id, flattenUnusedSegments(allPrevSegments), false);
179+
180+
// In `if (a) return a; foo();` case, the unreachable segment preceded by
181+
// the return statement is not used but must not be remove.
182+
CodePathSegment.markUsed(segment);
183+
184+
return segment;
182185
};
183186

184187
/**
@@ -203,7 +206,9 @@ CodePathSegment.newDisconnected = function(id, allPrevSegments) {
203206
* @returns {void}
204207
*/
205208
CodePathSegment.markUsed = function(segment) {
206-
assert(!segment.internal.used, segment.id + " is marked twice.");
209+
if (segment.internal.used) {
210+
return;
211+
}
207212
segment.internal.used = true;
208213

209214
var i;

tools/eslint/lib/code-path-analysis/code-path-state.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* @fileoverview A class to manage state of generating a code path.
33
* @author Toru Nagashima
4-
* @copyright 2015 Toru Nagashima. All rights reserved.
5-
* See LICENSE file in root directory for full license.
64
*/
75

86
"use strict";

0 commit comments

Comments
 (0)