diff --git a/.eslintrc.js b/.eslintrc.js index d80507467bc041..3a51903e0dddc1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -83,6 +83,7 @@ module.exports = { 'func-call-spacing': 'error', 'func-name-matching': 'error', 'func-style': ['error', 'declaration', { allowArrowFunctions: true }], + 'getter-return': 'error', 'indent': ['error', 2, { ArrayExpression: 'first', CallExpression: { arguments: 'first' }, diff --git a/.travis.yml b/.travis.yml index 3de388e838436f..2569b44ec39e83 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: cpp cache: ccache os: linux +dist: xenial matrix: include: - name: "First commit message adheres to guidelines at https://goo.gl/p2fr5Q" @@ -24,9 +25,9 @@ matrix: sources: - ubuntu-toolchain-r-test packages: - - g++-4.9 + - g++-6 install: - - export CC='ccache gcc-4.9' CXX='ccache g++-4.9' JOBS=2 + - export CC='ccache gcc-6' CXX='ccache g++-6' JOBS=2 - ./configure - make -j2 V= script: diff --git a/CHANGELOG.md b/CHANGELOG.md index 7872590bf6a86c..c6aaf39b20ff87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,8 @@ release.
| Directory | -Purpose | -
|---|---|
| assert | -
- Benchmarks for the assert subsystem.
- |
-
| buffers | -
- Benchmarks for the buffer subsystem.
- |
-
| child_process | -
- Benchmarks for the child_process subsystem.
- |
-
| crypto | -
- Benchmarks for the crypto subsystem.
- |
-
| dgram | -
- Benchmarks for the dgram subsystem.
- |
-
| domain | -
- Benchmarks for the domain subsystem.
- |
-
| es | -- Benchmarks for various new ECMAScript features and their - pre-ES2015 counterparts. - | -
| events | -
- Benchmarks for the events subsystem.
- |
-
| fixtures | -- Benchmarks fixtures used in various benchmarks throughout - the benchmark suite. - | -
| fs | -
- Benchmarks for the fs subsystem.
- |
-
| http | -
- Benchmarks for the http subsystem.
- |
-
| http2 | -
- Benchmarks for the http2 subsystem.
- |
-
| misc | -- Miscellaneous benchmarks and benchmarks for shared - internal modules. - | -
| module | -
- Benchmarks for the module subsystem.
- |
-
| net | -
- Benchmarks for the net subsystem.
- |
-
| path | -
- Benchmarks for the path subsystem.
- |
-
| process | -
- Benchmarks for the process subsystem.
- |
-
| querystring | -
- Benchmarks for the querystring subsystem.
- |
-
| streams | -
- Benchmarks for the streams subsystem.
- |
-
| string_decoder | -
- Benchmarks for the string_decoder subsystem.
- |
-
| timers | -
- Benchmarks for the timers subsystem, including
- setTimeout, setInterval, .etc.
- |
-
| tls | -
- Benchmarks for the tls subsystem.
- |
-
| url | -
- Benchmarks for the url subsystem, including the legacy
- url implementation and the WHATWG URL implementation.
- |
-
| util | -
- Benchmarks for the util subsystem.
- |
-
| vm | -
- Benchmarks for the vm subsystem.
- |
-
i){r.message("Move definitions to the end of the file (after the node at line `"+t+"`)",e)}}else if(t===null){t=i}}}},,function(e){"use strict";var r={}.hasOwnProperty;e.exports=stringify;function stringify(e){if(!e||typeof e!=="object"){return null}if(r.call(e,"position")||r.call(e,"type")){return position(e.position)}if(r.call(e,"start")||r.call(e,"end")){return position(e)}if(r.call(e,"line")||r.call(e,"column")){return point(e)}return null}function point(e){if(!e||typeof e!=="object"){e={}}return index(e.line)+":"+index(e.column)}function position(e){if(!e||typeof e!=="object"){e={}}return point(e.start)+"-"+point(e.end)}function index(e){return e&&typeof e==="number"?e:1}},,,function(e,r,t){"use strict";var i=t(197);var n=t(520);var a=t(770);var u=t(981);var s=t(314);var o=t(787);e.exports=parseEntities;var f={}.hasOwnProperty;var l=String.fromCharCode;var c=Function.prototype;var h={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:false,nonTerminated:true};var p="named";var v="hexadecimal";var d="decimal";var D={};D[v]=16;D[d]=10;var m={};m[p]=s;m[d]=a;m[v]=u;var g=1;var E=2;var A=3;var C=4;var y=5;var w=6;var x=7;var b={};b[g]="Named character references must be terminated by a semicolon";b[E]="Numeric character references must be terminated by a semicolon";b[A]="Named character references cannot be empty";b[C]="Numeric character references cannot be empty";b[y]="Named character references must be known";b[w]="Numeric character references cannot be disallowed";b[x]="Numeric character references cannot be outside the permissible Unicode range";function parseEntities(e,r){var t={};var i;var n;if(!r){r={}}for(n in h){i=r[n];t[n]=i===null||i===undefined?h[n]:i}if(t.position.indent||t.position.start){t.indent=t.position.indent||[];t.position=t.position.start}return parse(e,t)}function parse(e,r){var t=r.additional;var a=r.nonTerminated;var u=r.text;var h=r.reference;var F=r.warning;var S=r.textContext;var B=r.referenceContext;var k=r.warningContext;var O=r.position;var P=r.indent||[];var T=e.length;var I=0;var M=-1;var L=O.column||1;var R=O.line||1;var j="";var N=[];var U;var J;var z;var X;var q;var _;var G;var W;var V;var H;var Y;var $;var Z;var Q;var K;var ee;var re;var te;var ie;ee=now();W=F?parseError:c;I--;T++;while(++I 0){var t=peek();if(!a.isHexDigit(t)){throw invalidChar(read())}e+=read()}return String.fromCodePoint(parseInt(e,16))}var C={start:function start(){if(h.type==="eof"){throw invalidEOF()}push()},beforePropertyName:function beforePropertyName(){switch(h.type){case"identifier":case"string":p=h.value;s="afterPropertyName";return;case"punctuator":pop();return;case"eof":throw invalidEOF()}},afterPropertyName:function afterPropertyName(){if(h.type==="eof"){throw invalidEOF()}s="beforePropertyValue"},beforePropertyValue:function beforePropertyValue(){if(h.type==="eof"){throw invalidEOF()}push()},beforeArrayValue:function beforeArrayValue(){if(h.type==="eof"){throw invalidEOF()}if(h.type==="punctuator"&&h.value==="]"){pop();return}push()},afterPropertyValue:function afterPropertyValue(){if(h.type==="eof"){throw invalidEOF()}switch(h.value){case",":s="beforePropertyName";return;case"}":pop()}},afterArrayValue:function afterArrayValue(){if(h.type==="eof"){throw invalidEOF()}switch(h.value){case",":s="beforeArrayValue";return;case"]":pop()}},end:function end(){}};function push(){var e=void 0;switch(h.type){case"punctuator":switch(h.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=h.value;break}if(v===undefined){v=e}else{var r=o[o.length-1];if(Array.isArray(r)){r.push(e)}else{r[p]=e}}if(e!==null&&(typeof e==="undefined"?"undefined":i(e))==="object"){o.push(e);if(Array.isArray(e)){s="beforeArrayValue"}else{s="beforePropertyName"}}else{var t=o[o.length-1];if(t==null){s="end"}else if(Array.isArray(t)){s="afterArrayValue"}else{s="afterPropertyValue"}}}function pop(){o.pop();var e=o[o.length-1];if(e==null){s="end"}else if(Array.isArray(e)){s="afterArrayValue"}else{s="afterPropertyValue"}}function invalidChar(e){if(e===undefined){return syntaxError("JSON5: invalid end of input at "+l+":"+c)}return syntaxError("JSON5: invalid character '"+formatChar(e)+"' at "+l+":"+c)}function invalidEOF(){return syntaxError("JSON5: invalid end of input at "+l+":"+c)}function invalidIdentifier(){c-=5;return syntaxError("JSON5: invalid identifier character at "+l+":"+c)}function separatorChar(e){console.warn("JSON5: '"+e+"' is not valid ECMAScript; consider escaping")}function formatChar(e){var r={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(r[e]){return r[e]}if(e<" "){var t=e.charCodeAt(0).toString(16);return"\\x"+("00"+t).substring(t.length)}return e}function syntaxError(e){var r=new SyntaxError(e);r.lineNumber=l;r.columnNumber=c;return r}e.exports=r["default"]},function(e,r,t){"use strict";var i=t(66);var n=t(589);var a=t(151).silent;var u=t(342)();e.exports=loadPlugin;loadPlugin.resolve=resolvePlugin;var s=process.versions.electron!==undefined;var o=process.argv[1]||"";var f=process.env.NVM_BIN;var l=s||o.indexOf(u)===0;var c=process.platform==="win32";var h=c?"":"lib";var p=n.resolve(u,h,"node_modules");if(s&&f&&!i.existsSync(p)){p=n.resolve(f,"..",h,"node_modules")}function loadPlugin(e,r){return t(73)(resolvePlugin(e,r)||e)}function resolvePlugin(e,r){var t=r||{};var i=t.prefix;var n=t.cwd;var u;var s;var o;var f;var c;var h;var v="";if(n&&typeof n==="object"){s=n.concat()}else{s=[n||process.cwd()]}if(e.charAt(0)!=="."){if(t.global==null?l:t.global){s.push(p)}if(i){i=i.charAt(i.length-1)==="-"?i:i+"-";if(e.charAt(0)==="@"){h=e.indexOf("/");if(h!==-1){v=e.slice(0,h+1);e=e.slice(h+1)}}if(e.slice(0,i.length)!==i){c=v+i+e}e=v+e}}o=s.length;f=-1;while(++f =l&&C!==o){m=r.indexOf(o,m+1);continue}}A=r.slice(m+1);if(u(D,d,c,[e,A,true])){break}if(d.list.call(c,e,A,true)&&(c.inList||p||v&&!n(i.left(A).charAt(0)))){break}E=m;m=r.indexOf(o,m+1);if(m!==-1&&i(r.slice(E,m))===""){m=E;break}}A=r.slice(0,m);if(i(A)===""){e(A);return null}if(t){return true}w=e.now();A=a(A);return e(A)({type:"paragraph",children:c.tokenizeInline(A,w)})}},function(e,r,t){"use strict";var i=t(775);var n=t(9);e.exports=unherit;function unherit(e){var r;var t;var a;n(Of,e);n(From,Of);r=Of.prototype;for(t in r){a=r[t];if(a&&typeof a==="object"){r[t]="concat"in a?a.concat():i(a)}}return Of;function From(r){return e.apply(this,r)}function Of(){if(!(this instanceof Of)){return new From(arguments)}return e.apply(this,arguments)}}},function(e,r,t){"use strict";var i=t(775);var n=t(260);e.exports=parse;var a="\n";var u=/\r\n|\r/g;function parse(){var e=this;var r=String(e.file);var t={line:1,column:1,offset:0};var s=i(t);var o;r=r.replace(u,a);if(r.charCodeAt(0)===65279){r=r.slice(1);s.column++;s.offset++}o={type:"root",children:e.tokenizeBlock(r,s),position:{start:t,end:e.eof||i(t)}};if(!e.options.position){n(o,true)}return o}},function(e,r,t){"use strict";var i=t(136)("unified-engine:file-pipeline:queue");var n=t(356);var a=t(817);e.exports=queue;function queue(e,r,t,u){var s=r.history[0];var o=t.complete;var f=true;if(!o){o={};t.complete=o}i("Queueing `%s`",s);o[s]=u;t.valueOf().forEach(each);if(!f){i("Not flushing: some files cannot be flushed");return}t.complete={};t.pipeline.run(t,done);function each(e){var r=e.history[0];if(n(e).fatal){return}if(a(o[r])){i("`%s` can be flushed",r)}else{i("Interupting flush: `%s` is not finished",r);f=false}}function done(e){i("Flushing: all files can be flushed");for(s in o){o[s](e)}}}},function(e,r,t){"use strict";var i=t(100);var n=t(434);var a=t(998);var u=t(220);var s=t(97);e.exports=i("remark-lint:no-heading-indent",noHeadingIndent);var o=u.start;function noHeadingIndent(e,r){var t=String(r);var i=t.length;a(e,"heading",visitor);function visitor(e){var a;var u;var f;var l;var c;if(s(e)){return}a=o(e);u=a.offset;f=u-1;while(++f1;var p=c;var v=r.path;if(!u(p)){a("Not copying");return i()}p=f(e.cwd,p);a("Copying `%s`",v);s(p,onstatfile);function onstatfile(e,r){if(e){if(e.code!=="ENOENT"||c.charAt(c.length-1)===n.sep){return i(new Error("Cannot read output directory. Error:\n"+e.message))}s(o(p),onstatparent)}else{done(r.isDirectory())}}function onstatparent(e){if(e){i(new Error("Cannot read parent directory. Error:\n"+e.message))}else{done(false)}}function done(e){if(!e&&h){return i(new Error("Cannot write multiple files to single output: "+p))}r[e?"dirname":"path"]=l(r.cwd,p);a("Copying document from %s to %s",v,r.path);i()}}},,,function(e,r,t){"use strict";var i=t(100);var n=t(998);var a=t(97);e.exports=i("remark-lint:no-shell-dollars",noShellDollars);var u="Do not use dollar signs before shell-commands";var s=["sh","bash","bats","cgi","command","fcgi","ksh","tmux","tool","zsh"];function noShellDollars(e,r){n(e,"code",visitor);function visitor(e){var t;var i;var n;var o;if(!a(e)&&e.lang&&s.indexOf(e.lang)!==-1){t=e.value.split("\n");n=t.length;o=-1;if(n<=1){return}while(++o 1){if(F){C+=b.slice(0,b.length-1);b=b.charAt(b.length-1)}else{C+=b;b=""}}I=e.now();e(C)({type:"tableCell",children:m.tokenizeInline(k,I)},y)}e(b+F);b="";k=""}}else{if(b){k+=b;b=""}k+=F;if(F===f&&g!==w-2){k+=R.charAt(g+1);g++}if(F===l){P=1;while(R.charAt(g+1)===F){k+=F;g++;P++}if(!T){T=P}else if(P>=T){T=0}}}O=false;g++}if(!M){e(a+E)}}return N}},,function(e){e.exports=require("buffer")},function(e){"use strict";e.exports=escapes;var r=["\\","`","*","{","}","[","]","(",")","#","+","-",".","!","_",">"];var t=r.concat(["~","|"]);var i=t.concat(["\n",'"',"$","%","&","'",",","/",":",";","<","=","?","@","^"]);escapes.default=r;escapes.gfm=t;escapes.commonmark=i;function escapes(e){var n=e||{};if(n.commonmark){return i}return n.gfm?t:r}},,,,,function(e){e.exports=function isBuffer(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}},,,function(e,r,t){"use strict";var i=t(100);var n=t(998);var a=t(220);var u=t(97);e.exports=i("remark-lint:rule-style",ruleStyle);var s=a.start;var o=a.end;function ruleStyle(e,r,t){var i=String(r);t=typeof t==="string"&&t!=="consistent"?t:null;if(t!==null&&/[^-_* ]/.test(t)){r.fail("Invalid preferred rule-style: provide a valid markdown rule, or `'consistent'`")}n(e,"thematicBreak",visitor);function visitor(e){var n=s(e).offset;var a=o(e).offset;var f;if(!u(e)){f=i.slice(n,a);if(t){if(f!==t){r.message("Rules should use `"+t+"`",e)}}else{t=f}}}}},,,,function(e){"use strict";e.exports=footnoteReference;var r="[";var t="]";var i="^";function footnoteReference(e){return r+i+(e.label||e.identifier)+t}},,,,,,function(e,r,t){"use strict";var i=t(589);var n=t(471);var a=t(329);e.exports=Ignore;Ignore.prototype.check=check;var u=i.dirname;var s=i.relative;var o=i.resolve;function Ignore(e){this.cwd=e.cwd;this.findUp=new a({filePath:e.ignorePath,cwd:e.cwd,detect:e.detectIgnore,names:e.ignoreName?[e.ignoreName]:[],create:create})}function check(e,r){var t=this;t.findUp.load(e,done);function done(i,n){var a;if(i){r(i)}else if(n){a=s(n.filePath,o(t.cwd,e));r(null,a?n.ignores(a):false)}else{r(null,false)}}}function create(e,r){var t=n().add(String(e));t.filePath=u(r);return t}},,,,,function(e){"use strict";e.exports=text;function text(e,r,t){var i=this;var n;var a;var u;var s;var o;var f;var l;var c;var h;var p;if(t){return true}n=i.inlineMethods;s=n.length;a=i.inlineTokenizers;u=-1;h=r.length;while(++u i){r.message("Move definitions to the end of the file (after the node at line `"+t+"`)",e)}}else if(t===null){t=i}}}},,function(e){"use strict";var r={}.hasOwnProperty;e.exports=stringify;function stringify(e){if(!e||typeof e!=="object"){return null}if(r.call(e,"position")||r.call(e,"type")){return position(e.position)}if(r.call(e,"start")||r.call(e,"end")){return position(e)}if(r.call(e,"line")||r.call(e,"column")){return point(e)}return null}function point(e){if(!e||typeof e!=="object"){e={}}return index(e.line)+":"+index(e.column)}function position(e){if(!e||typeof e!=="object"){e={}}return point(e.start)+"-"+point(e.end)}function index(e){return e&&typeof e==="number"?e:1}},,,function(e,r,t){"use strict";var i=t(197);var n=t(520);var a=t(770);var u=t(981);var s=t(314);var o=t(787);e.exports=parseEntities;var f={}.hasOwnProperty;var l=String.fromCharCode;var c=Function.prototype;var h={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:false,nonTerminated:true};var p="named";var v="hexadecimal";var d="decimal";var D={};D[v]=16;D[d]=10;var m={};m[p]=s;m[d]=a;m[v]=u;var g=1;var E=2;var A=3;var C=4;var y=5;var w=6;var x=7;var b={};b[g]="Named character references must be terminated by a semicolon";b[E]="Numeric character references must be terminated by a semicolon";b[A]="Named character references cannot be empty";b[C]="Numeric character references cannot be empty";b[y]="Named character references must be known";b[w]="Numeric character references cannot be disallowed";b[x]="Numeric character references cannot be outside the permissible Unicode range";function parseEntities(e,r){var t={};var i;var n;if(!r){r={}}for(n in h){i=r[n];t[n]=i===null||i===undefined?h[n]:i}if(t.position.indent||t.position.start){t.indent=t.position.indent||[];t.position=t.position.start}return parse(e,t)}function parse(e,r){var t=r.additional;var a=r.nonTerminated;var u=r.text;var h=r.reference;var F=r.warning;var S=r.textContext;var B=r.referenceContext;var k=r.warningContext;var O=r.position;var P=r.indent||[];var T=e.length;var I=0;var M=-1;var L=O.column||1;var R=O.line||1;var j="";var N=[];var U;var J;var z;var X;var q;var G;var _;var W;var V;var H;var Y;var $;var Z;var Q;var K;var ee;var re;var te;var ie;ee=now();W=F?parseError:c;I--;T++;while(++I 0){var t=peek();if(!a.isHexDigit(t)){throw invalidChar(read())}e+=read()}return String.fromCodePoint(parseInt(e,16))}var C={start:function start(){if(h.type==="eof"){throw invalidEOF()}push()},beforePropertyName:function beforePropertyName(){switch(h.type){case"identifier":case"string":p=h.value;s="afterPropertyName";return;case"punctuator":pop();return;case"eof":throw invalidEOF()}},afterPropertyName:function afterPropertyName(){if(h.type==="eof"){throw invalidEOF()}s="beforePropertyValue"},beforePropertyValue:function beforePropertyValue(){if(h.type==="eof"){throw invalidEOF()}push()},beforeArrayValue:function beforeArrayValue(){if(h.type==="eof"){throw invalidEOF()}if(h.type==="punctuator"&&h.value==="]"){pop();return}push()},afterPropertyValue:function afterPropertyValue(){if(h.type==="eof"){throw invalidEOF()}switch(h.value){case",":s="beforePropertyName";return;case"}":pop()}},afterArrayValue:function afterArrayValue(){if(h.type==="eof"){throw invalidEOF()}switch(h.value){case",":s="beforeArrayValue";return;case"]":pop()}},end:function end(){}};function push(){var e=void 0;switch(h.type){case"punctuator":switch(h.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=h.value;break}if(v===undefined){v=e}else{var r=o[o.length-1];if(Array.isArray(r)){r.push(e)}else{r[p]=e}}if(e!==null&&(typeof e==="undefined"?"undefined":i(e))==="object"){o.push(e);if(Array.isArray(e)){s="beforeArrayValue"}else{s="beforePropertyName"}}else{var t=o[o.length-1];if(t==null){s="end"}else if(Array.isArray(t)){s="afterArrayValue"}else{s="afterPropertyValue"}}}function pop(){o.pop();var e=o[o.length-1];if(e==null){s="end"}else if(Array.isArray(e)){s="afterArrayValue"}else{s="afterPropertyValue"}}function invalidChar(e){if(e===undefined){return syntaxError("JSON5: invalid end of input at "+l+":"+c)}return syntaxError("JSON5: invalid character '"+formatChar(e)+"' at "+l+":"+c)}function invalidEOF(){return syntaxError("JSON5: invalid end of input at "+l+":"+c)}function invalidIdentifier(){c-=5;return syntaxError("JSON5: invalid identifier character at "+l+":"+c)}function separatorChar(e){console.warn("JSON5: '"+e+"' is not valid ECMAScript; consider escaping")}function formatChar(e){var r={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(r[e]){return r[e]}if(e<" "){var t=e.charCodeAt(0).toString(16);return"\\x"+("00"+t).substring(t.length)}return e}function syntaxError(e){var r=new SyntaxError(e);r.lineNumber=l;r.columnNumber=c;return r}e.exports=r["default"]},function(e,r,t){"use strict";var i=t(66);var n=t(589);var a=t(151).silent;var u=t(342)();e.exports=loadPlugin;loadPlugin.resolve=resolvePlugin;var s=process.versions.electron!==undefined;var o=process.argv[1]||"";var f=process.env.NVM_BIN;var l=s||o.indexOf(u)===0;var c=process.platform==="win32";var h=c?"":"lib";var p=n.resolve(u,h,"node_modules");if(s&&f&&!i.existsSync(p)){p=n.resolve(f,"..",h,"node_modules")}function loadPlugin(e,r){return t(73)(resolvePlugin(e,r)||e)}function resolvePlugin(e,r){var t=r||{};var i=t.prefix;var n=t.cwd;var u;var s;var o;var f;var c;var h;var v="";if(n&&typeof n==="object"){s=n.concat()}else{s=[n||process.cwd()]}if(e.charAt(0)!=="."){if(t.global==null?l:t.global){s.push(p)}if(i){i=i.charAt(i.length-1)==="-"?i:i+"-";if(e.charAt(0)==="@"){h=e.indexOf("/");if(h!==-1){v=e.slice(0,h+1);e=e.slice(h+1)}}if(e.slice(0,i.length)!==i){c=v+i+e}e=v+e}}o=s.length;f=-1;while(++f =l&&C!==o){m=r.indexOf(o,m+1);continue}}A=r.slice(m+1);if(u(D,d,c,[e,A,true])){break}if(d.list.call(c,e,A,true)&&(c.inList||p||v&&!n(i.left(A).charAt(0)))){break}E=m;m=r.indexOf(o,m+1);if(m!==-1&&i(r.slice(E,m))===""){m=E;break}}A=r.slice(0,m);if(i(A)===""){e(A);return null}if(t){return true}w=e.now();A=a(A);return e(A)({type:"paragraph",children:c.tokenizeInline(A,w)})}},function(e,r,t){"use strict";var i=t(775);var n=t(9);e.exports=unherit;function unherit(e){var r;var t;var a;n(Of,e);n(From,Of);r=Of.prototype;for(t in r){a=r[t];if(a&&typeof a==="object"){r[t]="concat"in a?a.concat():i(a)}}return Of;function From(r){return e.apply(this,r)}function Of(){if(!(this instanceof Of)){return new From(arguments)}return e.apply(this,arguments)}}},function(e,r,t){"use strict";var i=t(775);var n=t(260);e.exports=parse;var a="\n";var u=/\r\n|\r/g;function parse(){var e=this;var r=String(e.file);var t={line:1,column:1,offset:0};var s=i(t);var o;r=r.replace(u,a);if(r.charCodeAt(0)===65279){r=r.slice(1);s.column++;s.offset++}o={type:"root",children:e.tokenizeBlock(r,s),position:{start:t,end:e.eof||i(t)}};if(!e.options.position){n(o,true)}return o}},function(e,r,t){"use strict";var i=t(136)("unified-engine:file-pipeline:queue");var n=t(356);var a=t(817);e.exports=queue;function queue(e,r,t,u){var s=r.history[0];var o=t.complete;var f=true;if(!o){o={};t.complete=o}i("Queueing `%s`",s);o[s]=u;t.valueOf().forEach(each);if(!f){i("Not flushing: some files cannot be flushed");return}t.complete={};t.pipeline.run(t,done);function each(e){var r=e.history[0];if(n(e).fatal){return}if(a(o[r])){i("`%s` can be flushed",r)}else{i("Interupting flush: `%s` is not finished",r);f=false}}function done(e){i("Flushing: all files can be flushed");for(s in o){o[s](e)}}}},function(e,r,t){"use strict";var i=t(100);var n=t(434);var a=t(998);var u=t(220);var s=t(97);e.exports=i("remark-lint:no-heading-indent",noHeadingIndent);var o=u.start;function noHeadingIndent(e,r){var t=String(r);var i=t.length;a(e,"heading",visitor);function visitor(e){var a;var u;var f;var l;var c;if(s(e)){return}a=o(e);u=a.offset;f=u-1;while(++f1;var p=c;var v=r.path;if(!u(p)){a("Not copying");return i()}p=f(e.cwd,p);a("Copying `%s`",v);s(p,onstatfile);function onstatfile(e,r){if(e){if(e.code!=="ENOENT"||c.charAt(c.length-1)===n.sep){return i(new Error("Cannot read output directory. Error:\n"+e.message))}s(o(p),onstatparent)}else{done(r.isDirectory())}}function onstatparent(e){if(e){i(new Error("Cannot read parent directory. Error:\n"+e.message))}else{done(false)}}function done(e){if(!e&&h){return i(new Error("Cannot write multiple files to single output: "+p))}r[e?"dirname":"path"]=l(r.cwd,p);a("Copying document from %s to %s",v,r.path);i()}}},,,function(e,r,t){"use strict";var i=t(100);var n=t(998);var a=t(97);e.exports=i("remark-lint:no-shell-dollars",noShellDollars);var u="Do not use dollar signs before shell-commands";var s=["sh","bash","bats","cgi","command","fcgi","ksh","tmux","tool","zsh"];function noShellDollars(e,r){n(e,"code",visitor);function visitor(e){var t;var i;var n;var o;if(!a(e)&&e.lang&&s.indexOf(e.lang)!==-1){t=e.value.split("\n");n=t.length;o=-1;if(n<=1){return}while(++o 1){if(F){C+=b.slice(0,b.length-1);b=b.charAt(b.length-1)}else{C+=b;b=""}}I=e.now();e(C)({type:"tableCell",children:m.tokenizeInline(k,I)},y)}e(b+F);b="";k=""}}else{if(b){k+=b;b=""}k+=F;if(F===f&&g!==w-2){k+=R.charAt(g+1);g++}if(F===l){P=1;while(R.charAt(g+1)===F){k+=F;g++;P++}if(!T){T=P}else if(P>=T){T=0}}}O=false;g++}if(!M){e(a+E)}}return N}},,function(e){e.exports=require("buffer")},function(e){"use strict";e.exports=escapes;var r=["\\","`","*","{","}","[","]","(",")","#","+","-",".","!","_",">"];var t=r.concat(["~","|"]);var i=t.concat(["\n",'"',"$","%","&","'",",","/",":",";","<","=","?","@","^"]);escapes.default=r;escapes.gfm=t;escapes.commonmark=i;function escapes(e){var n=e||{};if(n.commonmark){return i}return n.gfm?t:r}},,,,,function(e){e.exports=function isBuffer(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}},,,function(e,r,t){"use strict";var i=t(100);var n=t(998);var a=t(220);var u=t(97);e.exports=i("remark-lint:rule-style",ruleStyle);var s=a.start;var o=a.end;function ruleStyle(e,r,t){var i=String(r);t=typeof t==="string"&&t!=="consistent"?t:null;if(t!==null&&/[^-_* ]/.test(t)){r.fail("Invalid preferred rule-style: provide a valid markdown rule, or `'consistent'`")}n(e,"thematicBreak",visitor);function visitor(e){var n=s(e).offset;var a=o(e).offset;var f;if(!u(e)){f=i.slice(n,a);if(t){if(f!==t){r.message("Rules should use `"+t+"`",e)}}else{t=f}}}}},,,,function(e){"use strict";e.exports=footnoteReference;var r="[";var t="]";var i="^";function footnoteReference(e){return r+i+(e.label||e.identifier)+t}},,,,,,function(e,r,t){"use strict";var i=t(589);var n=t(471);var a=t(329);e.exports=Ignore;Ignore.prototype.check=check;var u=i.dirname;var s=i.relative;var o=i.resolve;function Ignore(e){this.cwd=e.cwd;this.findUp=new a({filePath:e.ignorePath,cwd:e.cwd,detect:e.detectIgnore,names:e.ignoreName?[e.ignoreName]:[],create:create})}function check(e,r){var t=this;t.findUp.load(e,done);function done(i,n){var a;if(i){r(i)}else if(n){a=s(n.filePath,o(t.cwd,e));r(null,a?n.ignores(a):false)}else{r(null,false)}}}function create(e,r){var t=n().add(String(e));t.filePath=u(r);return t}},,,,,function(e){"use strict";e.exports=text;function text(e,r,t){var i=this;var n;var a;var u;var s;var o;var f;var l;var c;var h;var p;if(t){return true}n=i.inlineMethods;s=n.length;a=i.inlineTokenizers;u=-1;h=r.length;while(++u0||Y===x&&I.inLink||M&&Y===B&&r.charAt(G+1)===B||M&&Y===S&&(I.inTable||alignment(r,G))||Y===b&&G>0&&G
=97&&r<=102||r>=65&&r<=70||r>=48&&r<=57}},,,,function(e){"use strict";var r=Object.prototype.toString;e.exports=function(e){var t;return r.call(e)==="[object Object]"&&(t=Object.getPrototypeOf(e),t===null||t===Object.getPrototypeOf({}))}},,,,,,function(e,r,t){"use strict";var i=t(973);e.exports=function(e){if(i(e)){return false}if(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141)){return true}return false}},function(e,r,t){var i=t(281).Writable;var n=t(9);var a=t(621);if(typeof Uint8Array==="undefined"){var u=t(372).Uint8Array}else{var u=Uint8Array}function ConcatStream(e,r){if(!(this instanceof ConcatStream))return new ConcatStream(e,r);if(typeof e==="function"){r=e;e={}}if(!e)e={};var t=e.encoding;var n=false;if(!t){n=true}else{t=String(t).toLowerCase();if(t==="u8"||t==="uint8"){t="uint8array"}}i.call(this,{objectMode:true});this.encoding=t;this.shouldInferEncoding=n;if(r)this.on("finish",function(){r(this.getBody())});this.body=[]}e.exports=ConcatStream;n(ConcatStream,i);ConcatStream.prototype._write=function(e,r,t){this.body.push(e);t()};ConcatStream.prototype.inferEncoding=function(e){var r=e===undefined?this.body[0]:e;if(Buffer.isBuffer(r))return"buffer";if(typeof Uint8Array!=="undefined"&&r instanceof Uint8Array)return"uint8array";if(Array.isArray(r))return"array";if(typeof r==="string")return"string";if(Object.prototype.toString.call(r)==="[object Object]")return"object";return"buffer"};ConcatStream.prototype.getBody=function(){if(!this.encoding&&this.body.length===0)return[];if(this.shouldInferEncoding)this.encoding=this.inferEncoding();if(this.encoding==="array")return arrayConcat(this.body);if(this.encoding==="string")return stringConcat(this.body);if(this.encoding==="buffer")return bufferConcat(this.body);if(this.encoding==="uint8array")return u8Concat(this.body);return this.body};var s=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"};function isArrayish(e){return/Array\]$/.test(Object.prototype.toString.call(e))}function isBufferish(e){return typeof e==="string"||isArrayish(e)||e&&typeof e.subarray==="function"}function stringConcat(e){var r=[];var t=false;for(var i=0;i0||Y===x&&I.inLink||M&&Y===B&&r.charAt(_+1)===B||M&&Y===S&&(I.inTable||alignment(r,_))||Y===b&&_>0&&_
=97&&r<=102||r>=65&&r<=70||r>=48&&r<=57}},,,,function(e){"use strict";var r=Object.prototype.toString;e.exports=function(e){var t;return r.call(e)==="[object Object]"&&(t=Object.getPrototypeOf(e),t===null||t===Object.getPrototypeOf({}))}},,,,,,function(e,r,t){"use strict";var i=t(973);e.exports=function(e){if(i(e)){return false}if(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141)){return true}return false}},function(e,r,t){var i=t(281).Writable;var n=t(9);var a=t(621);if(typeof Uint8Array==="undefined"){var u=t(372).Uint8Array}else{var u=Uint8Array}function ConcatStream(e,r){if(!(this instanceof ConcatStream))return new ConcatStream(e,r);if(typeof e==="function"){r=e;e={}}if(!e)e={};var t=e.encoding;var n=false;if(!t){n=true}else{t=String(t).toLowerCase();if(t==="u8"||t==="uint8"){t="uint8array"}}i.call(this,{objectMode:true});this.encoding=t;this.shouldInferEncoding=n;if(r)this.on("finish",function(){r(this.getBody())});this.body=[]}e.exports=ConcatStream;n(ConcatStream,i);ConcatStream.prototype._write=function(e,r,t){this.body.push(e);t()};ConcatStream.prototype.inferEncoding=function(e){var r=e===undefined?this.body[0]:e;if(Buffer.isBuffer(r))return"buffer";if(typeof Uint8Array!=="undefined"&&r instanceof Uint8Array)return"uint8array";if(Array.isArray(r))return"array";if(typeof r==="string")return"string";if(Object.prototype.toString.call(r)==="[object Object]")return"object";return"buffer"};ConcatStream.prototype.getBody=function(){if(!this.encoding&&this.body.length===0)return[];if(this.shouldInferEncoding)this.encoding=this.inferEncoding();if(this.encoding==="array")return arrayConcat(this.body);if(this.encoding==="string")return stringConcat(this.body);if(this.encoding==="buffer")return bufferConcat(this.body);if(this.encoding==="uint8array")return u8Concat(this.body);return this.body};var s=Array.isArray||function(e){return Object.prototype.toString.call(e)=="[object Array]"};function isArrayish(e){return/Array\]$/.test(Object.prototype.toString.call(e))}function isBufferish(e){return typeof e==="string"||isArrayish(e)||e&&typeof e.subarray==="function"}function stringConcat(e){var r=[];var t=false;for(var i=0;iSilver Sponsors
Bronze Sponsors
-
+
## Technology Sponsors
diff --git a/tools/node_modules/eslint/lib/config/config-file.js b/tools/node_modules/eslint/lib/config/config-file.js
index 492800b7a3cf6a..80344f50973df2 100644
--- a/tools/node_modules/eslint/lib/config/config-file.js
+++ b/tools/node_modules/eslint/lib/config/config-file.js
@@ -541,7 +541,7 @@ function loadFromDisk(resolvedPath, configContext) {
const ruleMap = configContext.linterContext.getRules();
// validate the configuration before continuing
- validator.validate(config, resolvedPath.configFullName, ruleMap.get.bind(ruleMap), configContext.linterContext.environments);
+ validator.validate(config, ruleMap.get.bind(ruleMap), configContext.linterContext.environments, resolvedPath.configFullName);
/*
* If an `extends` property is defined, it represents a configuration file to use as
diff --git a/tools/node_modules/eslint/lib/config/config-validator.js b/tools/node_modules/eslint/lib/config/config-validator.js
index 2345b28893c6e4..386db77750238d 100644
--- a/tools/node_modules/eslint/lib/config/config-validator.js
+++ b/tools/node_modules/eslint/lib/config/config-validator.js
@@ -116,7 +116,7 @@ function validateRuleSchema(rule, localOptions) {
* no source is prepended to the message.
* @returns {void}
*/
-function validateRuleOptions(rule, ruleId, options, source) {
+function validateRuleOptions(rule, ruleId, options, source = null) {
if (!rule) {
return;
}
@@ -140,11 +140,11 @@ function validateRuleOptions(rule, ruleId, options, source) {
/**
* Validates an environment object
* @param {Object} environment The environment config object to validate.
- * @param {string} source The name of the configuration source to report in any errors.
* @param {Environments} envContext Env context
+ * @param {string} source The name of the configuration source to report in any errors.
* @returns {void}
*/
-function validateEnvironment(environment, source, envContext) {
+function validateEnvironment(environment, envContext, source = null) {
// not having an environment is ok
if (!environment) {
@@ -163,11 +163,11 @@ function validateEnvironment(environment, source, envContext) {
/**
* Validates a rules config object
* @param {Object} rulesConfig The rules config object to validate.
- * @param {string} source The name of the configuration source to report in any errors.
* @param {function(string): {create: Function}} ruleMapper A mapper function from strings to loaded rules
+ * @param {string} source The name of the configuration source to report in any errors.
* @returns {void}
*/
-function validateRules(rulesConfig, source, ruleMapper) {
+function validateRules(rulesConfig, ruleMapper, source = null) {
if (!rulesConfig) {
return;
}
@@ -228,7 +228,7 @@ const emitDeprecationWarning = lodash.memoize((source, errorCode) => {
* @param {string} source The name of the configuration source to report in any errors.
* @returns {void}
*/
-function validateConfigSchema(config, source) {
+function validateConfigSchema(config, source = null) {
validateSchema = validateSchema || ajv.compile(configSchema);
if (!validateSchema(config)) {
@@ -252,19 +252,19 @@ function validateConfigSchema(config, source) {
/**
* Validates an entire config object.
* @param {Object} config The config object to validate.
- * @param {string} source The name of the configuration source to report in any errors.
* @param {function(string): {create: Function}} ruleMapper A mapper function from rule IDs to defined rules
* @param {Environments} envContext The env context
+ * @param {string} source The name of the configuration source to report in any errors.
* @returns {void}
*/
-function validate(config, source, ruleMapper, envContext) {
+function validate(config, ruleMapper, envContext, source = null) {
validateConfigSchema(config, source);
- validateRules(config.rules, source, ruleMapper);
- validateEnvironment(config.env, source, envContext);
+ validateRules(config.rules, ruleMapper, source);
+ validateEnvironment(config.env, envContext, source);
for (const override of config.overrides || []) {
- validateRules(override.rules, source, ruleMapper);
- validateEnvironment(override.env, source, envContext);
+ validateRules(override.rules, ruleMapper, source);
+ validateEnvironment(override.env, envContext, source);
}
}
diff --git a/tools/node_modules/eslint/lib/linter.js b/tools/node_modules/eslint/lib/linter.js
index 88448d90f8aa5f..be38b99087de74 100644
--- a/tools/node_modules/eslint/lib/linter.js
+++ b/tools/node_modules/eslint/lib/linter.js
@@ -747,10 +747,15 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parser
nodeQueue.forEach(traversalInfo => {
currentNode = traversalInfo.node;
- if (traversalInfo.isEntering) {
- eventGenerator.enterNode(currentNode);
- } else {
- eventGenerator.leaveNode(currentNode);
+ try {
+ if (traversalInfo.isEntering) {
+ eventGenerator.enterNode(currentNode);
+ } else {
+ eventGenerator.leaveNode(currentNode);
+ }
+ } catch (err) {
+ err.currentNode = currentNode;
+ throw err;
}
});
@@ -901,8 +906,15 @@ module.exports = class Linter {
options.filename
);
} catch (err) {
+ err.message += `\nOccurred while linting ${options.filename}`;
debug("An error occurred while traversing");
debug("Filename:", options.filename);
+ if (err.currentNode) {
+ const { line } = err.currentNode.loc.start;
+
+ debug("Line:", line);
+ err.message += `:${line}`;
+ }
debug("Parser Options:", parserOptions);
debug("Parser Path:", parserName);
debug("Settings:", settings);
diff --git a/tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js b/tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js
index ad0d70da66cc76..6fc1268e7534ee 100644
--- a/tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js
+++ b/tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js
@@ -4,11 +4,7 @@
*/
"use strict";
-const {
- isArrowToken,
- isParenthesised,
- isOpeningParenToken
-} = require("../util/ast-utils");
+const { isCommentToken, isNotOpeningParenToken } = require("../util/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
@@ -39,153 +35,7 @@ module.exports = {
create(context) {
const sourceCode = context.getSourceCode();
-
- //----------------------------------------------------------------------
- // Helpers
- //----------------------------------------------------------------------
- /**
- * Gets the applicable preference for a particular keyword
- * @returns {string} The applicable option for the keyword, e.g. 'beside'
- */
- function getOption() {
- return context.options[0] || "beside";
- }
-
- /**
- * Formats the comments depending on whether it's a line or block comment.
- * @param {Comment[]} comments The array of comments between the arrow and body
- * @param {Integer} column The column number of the first token
- * @returns {string} A string of comment text joined by line breaks
- */
- function formatComments(comments, column) {
- const whiteSpaces = " ".repeat(column);
-
- return `${comments.map(comment => {
-
- if (comment.type === "Line") {
- return `//${comment.value}`;
- }
-
- return `/*${comment.value}*/`;
- }).join(`\n${whiteSpaces}`)}\n${whiteSpaces}`;
- }
-
- /**
- * Finds the first token to prepend comments to depending on the parent type
- * @param {Node} node The validated node
- * @returns {Token|Node} The node to prepend comments to
- */
- function findFirstToken(node) {
- switch (node.parent.type) {
- case "VariableDeclarator":
-
- // If the parent is first or only declarator, return the declaration, else, declarator
- return sourceCode.getFirstToken(
- node.parent.parent.declarations.length === 1 ||
- node.parent.parent.declarations[0].id.name === node.parent.id.name
- ? node.parent.parent : node.parent
- );
- case "CallExpression":
- case "Property":
-
- // find the object key
- return sourceCode.getFirstToken(node.parent);
- default:
- return node;
- }
- }
-
- /**
- * Helper function for adding parentheses fixes for nodes containing nested arrow functions
- * @param {Fixer} fixer Fixer
- * @param {Token} arrow - The arrow token
- * @param {ASTNode} arrowBody - The arrow function body
- * @returns {Function[]} autofixer -- wraps function bodies with parentheses
- */
- function addParentheses(fixer, arrow, arrowBody) {
- const parenthesesFixes = [];
- let closingParentheses = "";
-
- let followingBody = arrowBody;
- let currentArrow = arrow;
-
- while (currentArrow) {
- if (!isParenthesised(sourceCode, followingBody)) {
- parenthesesFixes.push(
- fixer.insertTextAfter(currentArrow, " (")
- );
-
- const paramsToken = sourceCode.getTokenBefore(currentArrow, token =>
- isOpeningParenToken(token) || token.type === "Identifier");
-
- const whiteSpaces = " ".repeat(paramsToken.loc.start.column);
-
- closingParentheses = `\n${whiteSpaces})${closingParentheses}`;
- }
-
- currentArrow = sourceCode.getTokenAfter(currentArrow, isArrowToken);
-
- if (currentArrow) {
- followingBody = sourceCode.getTokenAfter(currentArrow, token => !isOpeningParenToken(token));
- }
- }
-
- return [...parenthesesFixes,
- fixer.insertTextAfter(arrowBody, closingParentheses)
- ];
- }
-
- /**
- * Autofixes the function body to collapse onto the same line as the arrow.
- * If comments exist, prepends the comments before the arrow function.
- * If the function body contains arrow functions, appends the function bodies with parentheses.
- * @param {Token} arrowToken The arrow token.
- * @param {ASTNode} arrowBody the function body
- * @param {ASTNode} node The evaluated node
- * @returns {Function} autofixer -- validates the node to adhere to besides
- */
- function autoFixBesides(arrowToken, arrowBody, node) {
- return fixer => {
- const placeBesides = fixer.replaceTextRange([arrowToken.range[1], arrowBody.range[0]], " ");
-
- const comments = sourceCode.getCommentsInside(node).filter(comment =>
- comment.loc.start.line < arrowBody.loc.start.line);
-
- if (comments.length) {
-
- // If the grandparent is not a variable declarator
- if (
- arrowBody.parent &&
- arrowBody.parent.parent &&
- arrowBody.parent.parent.type !== "VariableDeclarator"
- ) {
-
- // If any arrow functions follow, return the necessary parens fixes.
- if (sourceCode.getTokenAfter(arrowToken, isArrowToken) && arrowBody.parent.parent.type !== "VariableDeclarator") {
- return addParentheses(fixer, arrowToken, arrowBody);
- }
-
- // If any arrow functions precede, the necessary fixes have already been returned, so return null.
- if (sourceCode.getTokenBefore(arrowToken, isArrowToken) && arrowBody.parent.parent.type !== "VariableDeclarator") {
- return null;
- }
- }
-
- const firstToken = findFirstToken(node);
-
- const commentText = formatComments(comments, firstToken.loc.start.column);
-
- const commentBeforeExpression = fixer.insertTextBeforeRange(
- firstToken.range,
- commentText
- );
-
- return [placeBesides, commentBeforeExpression];
- }
-
- return placeBesides;
- };
- }
+ const option = context.options[0] || "beside";
/**
* Validates the location of an arrow function body
@@ -193,35 +43,30 @@ module.exports = {
* @returns {void}
*/
function validateExpression(node) {
- const option = getOption();
-
- let tokenBefore = sourceCode.getTokenBefore(node.body);
- const hasParens = tokenBefore.value === "(";
-
- if (node.type === "BlockStatement") {
+ if (node.body.type === "BlockStatement") {
return;
}
- let fixerTarget = node.body;
+ const arrowToken = sourceCode.getTokenBefore(node.body, isNotOpeningParenToken);
+ const firstTokenOfBody = sourceCode.getTokenAfter(arrowToken);
- if (hasParens) {
-
- // Gets the first token before the function body that is not an open paren
- tokenBefore = sourceCode.getTokenBefore(node.body, token => token.value !== "(");
- fixerTarget = sourceCode.getTokenAfter(tokenBefore);
- }
-
- if (tokenBefore.loc.end.line === fixerTarget.loc.start.line && option === "below") {
+ if (arrowToken.loc.end.line === firstTokenOfBody.loc.start.line && option === "below") {
context.report({
- node: fixerTarget,
+ node: firstTokenOfBody,
messageId: "expected",
- fix: fixer => fixer.insertTextBefore(fixerTarget, "\n")
+ fix: fixer => fixer.insertTextBefore(firstTokenOfBody, "\n")
});
- } else if (tokenBefore.loc.end.line !== fixerTarget.loc.start.line && option === "beside") {
+ } else if (arrowToken.loc.end.line !== firstTokenOfBody.loc.start.line && option === "beside") {
context.report({
- node: fixerTarget,
+ node: firstTokenOfBody,
messageId: "unexpected",
- fix: autoFixBesides(tokenBefore, fixerTarget, node)
+ fix(fixer) {
+ if (sourceCode.getFirstTokenBetween(arrowToken, firstTokenOfBody, { includeComments: true, filter: isCommentToken })) {
+ return null;
+ }
+
+ return fixer.replaceTextRange([arrowToken.range[1], firstTokenOfBody.range[0]], " ");
+ }
});
}
}
diff --git a/tools/node_modules/eslint/lib/testers/rule-tester.js b/tools/node_modules/eslint/lib/testers/rule-tester.js
index 6d1bba989fdeea..f1d915531323a0 100644
--- a/tools/node_modules/eslint/lib/testers/rule-tester.js
+++ b/tools/node_modules/eslint/lib/testers/rule-tester.js
@@ -379,7 +379,7 @@ class RuleTester {
}
}
- validator.validate(config, "rule-tester", ruleMap.get.bind(ruleMap), new Environments());
+ validator.validate(config, ruleMap.get.bind(ruleMap), new Environments(), "rule-tester");
return {
messages: linter.verify(code, config, filename, true),
diff --git a/tools/node_modules/eslint/lib/util/glob-utils.js b/tools/node_modules/eslint/lib/util/glob-utils.js
index b05c354439dc42..33cb8e7c885a17 100644
--- a/tools/node_modules/eslint/lib/util/glob-utils.js
+++ b/tools/node_modules/eslint/lib/util/glob-utils.js
@@ -70,6 +70,10 @@ function processPath(options) {
* @private
*/
return function(pathname) {
+ if (pathname === "") {
+ return "";
+ }
+
let newPath = pathname;
const resolvedPath = path.resolve(cwd, pathname);
@@ -201,6 +205,13 @@ function listFilesToProcess(globPatterns, providedOptions) {
debug("Creating list of files to process.");
const resolvedPathsByGlobPattern = resolvedGlobPatterns.map(pattern => {
+ if (pattern === "") {
+ return [{
+ filename: "",
+ behavior: SILENTLY_IGNORE
+ }];
+ }
+
const file = path.resolve(cwd, pattern);
if (options.globInputPaths === false || (fs.existsSync(file) && fs.statSync(file).isFile())) {
@@ -240,7 +251,7 @@ function listFilesToProcess(globPatterns, providedOptions) {
});
const allPathDescriptors = resolvedPathsByGlobPattern.reduce((pathsForAllGlobs, pathsForCurrentGlob, index) => {
- if (pathsForCurrentGlob.every(pathDescriptor => pathDescriptor.behavior === SILENTLY_IGNORE)) {
+ if (pathsForCurrentGlob.every(pathDescriptor => pathDescriptor.behavior === SILENTLY_IGNORE && pathDescriptor.filename !== "")) {
throw new (pathsForCurrentGlob.length ? AllFilesIgnoredError : NoFilesFoundError)(globPatterns[index]);
}
diff --git a/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope.js b/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope.js
index b3c5040bb1ae1c..f0c3006c601f62 100644
--- a/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope.js
+++ b/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope.js
@@ -49,11 +49,6 @@ function isStrictScope(scope, block, isMethodDefinition, useDirective) {
return true;
}
- // ArrowFunctionExpression's scope is always strict scope.
- if (block.type === Syntax.ArrowFunctionExpression) {
- return true;
- }
-
if (isMethodDefinition) {
return true;
}
@@ -67,6 +62,10 @@ function isStrictScope(scope, block, isMethodDefinition, useDirective) {
}
if (scope.type === "function") {
+ if (block.type === Syntax.ArrowFunctionExpression && block.body.type !== Syntax.BlockStatement) {
+ return false;
+ }
+
if (block.type === Syntax.Program) {
body = block;
} else {
diff --git a/tools/node_modules/eslint/node_modules/eslint-scope/package.json b/tools/node_modules/eslint/node_modules/eslint-scope/package.json
index 1d38e549770ca7..f3239af383b050 100644
--- a/tools/node_modules/eslint/node_modules/eslint-scope/package.json
+++ b/tools/node_modules/eslint/node_modules/eslint-scope/package.json
@@ -47,5 +47,5 @@
"publish-release": "eslint-publish-release",
"test": "node Makefile.js test"
},
- "version": "4.0.2"
+ "version": "4.0.3"
}
\ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/index.js b/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/index.js
index 96e0292c8e2f64..9788c96dfa3b0c 100644
--- a/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/index.js
+++ b/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/index.js
@@ -1,4 +1,7 @@
'use strict';
const ansiRegex = require('ansi-regex');
-module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;
+const stripAnsi = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
+
+module.exports = stripAnsi;
+module.exports.default = stripAnsi;
diff --git a/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/package.json b/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/package.json
index 6715407030ba32..0c379e41c1aa24 100644
--- a/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/package.json
+++ b/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/package.json
@@ -12,16 +12,18 @@
"ansi-regex": "^4.1.0"
},
"deprecated": false,
- "description": "Strip ANSI escape codes",
+ "description": "Strip ANSI escape codes from a string",
"devDependencies": {
- "ava": "^0.25.0",
- "xo": "^0.23.0"
+ "ava": "^1.3.1",
+ "tsd-check": "^0.5.0",
+ "xo": "^0.24.0"
},
"engines": {
"node": ">=6"
},
"files": [
- "index.js"
+ "index.js",
+ "index.d.ts"
],
"homepage": "https://github.com/chalk/strip-ansi#readme",
"keywords": [
@@ -55,7 +57,7 @@
"url": "git+https://github.com/chalk/strip-ansi.git"
},
"scripts": {
- "test": "xo && ava"
+ "test": "xo && ava && tsd-check"
},
- "version": "5.1.0"
+ "version": "5.2.0"
}
\ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/readme.md b/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/readme.md
index 2f47184208027c..8681fe8af44242 100644
--- a/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/readme.md
+++ b/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/readme.md
@@ -1,6 +1,6 @@
# strip-ansi [](https://travis-ci.org/chalk/strip-ansi)
-> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
+> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string
---
@@ -31,7 +31,7 @@ const stripAnsi = require('strip-ansi');
stripAnsi('\u001B[4mUnicorn\u001B[0m');
//=> 'Unicorn'
-stripAnsi('\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007');
+stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
//=> 'Click'
```
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/strip-ansi/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/strip-ansi/index.js
index 96e0292c8e2f64..9788c96dfa3b0c 100644
--- a/tools/node_modules/eslint/node_modules/table/node_modules/strip-ansi/index.js
+++ b/tools/node_modules/eslint/node_modules/table/node_modules/strip-ansi/index.js
@@ -1,4 +1,7 @@
'use strict';
const ansiRegex = require('ansi-regex');
-module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;
+const stripAnsi = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
+
+module.exports = stripAnsi;
+module.exports.default = stripAnsi;
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/strip-ansi/package.json b/tools/node_modules/eslint/node_modules/table/node_modules/strip-ansi/package.json
index 6715407030ba32..0c379e41c1aa24 100644
--- a/tools/node_modules/eslint/node_modules/table/node_modules/strip-ansi/package.json
+++ b/tools/node_modules/eslint/node_modules/table/node_modules/strip-ansi/package.json
@@ -12,16 +12,18 @@
"ansi-regex": "^4.1.0"
},
"deprecated": false,
- "description": "Strip ANSI escape codes",
+ "description": "Strip ANSI escape codes from a string",
"devDependencies": {
- "ava": "^0.25.0",
- "xo": "^0.23.0"
+ "ava": "^1.3.1",
+ "tsd-check": "^0.5.0",
+ "xo": "^0.24.0"
},
"engines": {
"node": ">=6"
},
"files": [
- "index.js"
+ "index.js",
+ "index.d.ts"
],
"homepage": "https://github.com/chalk/strip-ansi#readme",
"keywords": [
@@ -55,7 +57,7 @@
"url": "git+https://github.com/chalk/strip-ansi.git"
},
"scripts": {
- "test": "xo && ava"
+ "test": "xo && ava && tsd-check"
},
- "version": "5.1.0"
+ "version": "5.2.0"
}
\ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/strip-ansi/readme.md b/tools/node_modules/eslint/node_modules/table/node_modules/strip-ansi/readme.md
index 2f47184208027c..8681fe8af44242 100644
--- a/tools/node_modules/eslint/node_modules/table/node_modules/strip-ansi/readme.md
+++ b/tools/node_modules/eslint/node_modules/table/node_modules/strip-ansi/readme.md
@@ -1,6 +1,6 @@
# strip-ansi [](https://travis-ci.org/chalk/strip-ansi)
-> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
+> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string
---
@@ -31,7 +31,7 @@ const stripAnsi = require('strip-ansi');
stripAnsi('\u001B[4mUnicorn\u001B[0m');
//=> 'Unicorn'
-stripAnsi('\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007');
+stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
//=> 'Click'
```
diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json
index c07c99868f1a43..21b7223286026e 100644
--- a/tools/node_modules/eslint/package.json
+++ b/tools/node_modules/eslint/package.json
@@ -18,7 +18,7 @@
"debug": "^4.0.1",
"doctrine": "^3.0.0",
"eslint-plugin-markdown": "^1.0.0",
- "eslint-scope": "^4.0.2",
+ "eslint-scope": "^4.0.3",
"eslint-utils": "^1.3.1",
"eslint-visitor-keys": "^1.0.0",
"espree": "^5.0.1",
@@ -64,11 +64,11 @@
"coveralls": "^3.0.1",
"dateformat": "^3.0.3",
"ejs": "^2.6.1",
+ "eslint-config-eslint": "file:packages/eslint-config-eslint",
"eslint-plugin-eslint-plugin": "^2.0.1",
+ "eslint-plugin-internal-rules": "file:tools/internal-rules",
"eslint-plugin-node": "^8.0.0",
- "eslint-plugin-rulesdir": "^0.1.0",
"eslint-release": "^1.2.0",
- "eslint-rule-composer": "^0.3.0",
"eslump": "^2.0.0",
"esprima": "^4.0.1",
"istanbul": "^0.4.5",
@@ -135,5 +135,5 @@
"test": "node Makefile.js test",
"webpack": "node Makefile.js webpack"
},
- "version": "5.15.1"
+ "version": "5.15.3"
}
\ No newline at end of file