eslint / eslint

Find and fix problems in your JavaScript code.
https://eslint.org
MIT License
24.94k stars 4.51k forks source link

Parsing error: Unexpected token = (destructuring) #11317

Closed iamogbz closed 5 years ago

iamogbz commented 5 years ago

Tell us about your environment

What parser (default, Babel-ESLint, etc.) are you using? default

Please show your full configuration:

Configuration ```sh yarn run v1.7.0 $ /Users/Emmanuel/Sources/yvm/node_modules/.bin/eslint --print-config . ``` ```js { "globals": { "__dirname": false, "__filename": false, "Buffer": false, "clearImmediate": false, "clearInterval": false, "clearTimeout": false, "console": false, "exports": true, "global": false, "Intl": false, "module": false, "process": false, "queueMicrotask": false, "require": false, "setImmediate": false, "setInterval": false, "setTimeout": false, "TextDecoder": false, "TextEncoder": false, "URL": false, "URLSearchParams": false, "AbortController": false, "AbortSignal": false, "addEventListener": false, "alert": false, "AnalyserNode": false, "Animation": false, "AnimationEffectReadOnly": false, "AnimationEffectTiming": false, "AnimationEffectTimingReadOnly": false, "AnimationEvent": false, "AnimationPlaybackEvent": false, "AnimationTimeline": false, "applicationCache": false, "ApplicationCache": false, "ApplicationCacheErrorEvent": false, "atob": false, "Attr": false, "Audio": false, "AudioBuffer": false, "AudioBufferSourceNode": false, "AudioContext": false, "AudioDestinationNode": false, "AudioListener": false, "AudioNode": false, "AudioParam": false, "AudioProcessingEvent": false, "AudioScheduledSourceNode": false, "AudioWorkletGlobalScope ": false, "AudioWorkletNode": false, "AudioWorkletProcessor": false, "BarProp": false, "BaseAudioContext": false, "BatteryManager": false, "BeforeUnloadEvent": false, "BiquadFilterNode": false, "Blob": false, "BlobEvent": false, "blur": false, "BroadcastChannel": false, "btoa": false, "BudgetService": false, "ByteLengthQueuingStrategy": false, "Cache": false, "caches": false, "CacheStorage": false, "cancelAnimationFrame": false, "cancelIdleCallback": false, "CanvasCaptureMediaStreamTrack": false, "CanvasGradient": false, "CanvasPattern": false, "CanvasRenderingContext2D": false, "ChannelMergerNode": false, "ChannelSplitterNode": false, "CharacterData": false, "clientInformation": false, "ClipboardEvent": false, "close": false, "closed": false, "CloseEvent": false, "Comment": false, "CompositionEvent": false, "confirm": false, "ConstantSourceNode": false, "ConvolverNode": false, "CountQueuingStrategy": false, "createImageBitmap": false, "Credential": false, "CredentialsContainer": false, "crypto": false, "Crypto": false, "CryptoKey": false, "CSS": false, "CSSConditionRule": false, "CSSFontFaceRule": false, "CSSGroupingRule": false, "CSSImportRule": false, "CSSKeyframeRule": false, "CSSKeyframesRule": false, "CSSMediaRule": false, "CSSNamespaceRule": false, "CSSPageRule": false, "CSSRule": false, "CSSRuleList": false, "CSSStyleDeclaration": false, "CSSStyleRule": false, "CSSStyleSheet": false, "CSSSupportsRule": false, "CustomElementRegistry": false, "customElements": false, "CustomEvent": false, "DataTransfer": false, "DataTransferItem": false, "DataTransferItemList": false, "defaultstatus": false, "defaultStatus": false, "DelayNode": false, "DeviceMotionEvent": false, "DeviceOrientationEvent": false, "devicePixelRatio": false, "dispatchEvent": false, "document": false, "Document": false, "DocumentFragment": false, "DocumentType": false, "DOMError": false, "DOMException": false, "DOMImplementation": false, "DOMMatrix": false, "DOMMatrixReadOnly": false, "DOMParser": false, "DOMPoint": false, "DOMPointReadOnly": false, "DOMQuad": false, "DOMRect": false, "DOMRectReadOnly": false, "DOMStringList": false, "DOMStringMap": false, "DOMTokenList": false, "DragEvent": false, "DynamicsCompressorNode": false, "Element": false, "ErrorEvent": false, "event": false, "Event": false, "EventSource": false, "EventTarget": false, "external": false, "fetch": false, "File": false, "FileList": false, "FileReader": false, "find": false, "focus": false, "FocusEvent": false, "FontFace": false, "FontFaceSetLoadEvent": false, "FormData": false, "frameElement": false, "frames": false, "GainNode": false, "Gamepad": false, "GamepadButton": false, "GamepadEvent": false, "getComputedStyle": false, "getSelection": false, "HashChangeEvent": false, "Headers": false, "history": false, "History": false, "HTMLAllCollection": false, "HTMLAnchorElement": false, "HTMLAreaElement": false, "HTMLAudioElement": false, "HTMLBaseElement": false, "HTMLBodyElement": false, "HTMLBRElement": false, "HTMLButtonElement": false, "HTMLCanvasElement": false, "HTMLCollection": false, "HTMLContentElement": false, "HTMLDataElement": false, "HTMLDataListElement": false, "HTMLDetailsElement": false, "HTMLDialogElement": false, "HTMLDirectoryElement": false, "HTMLDivElement": false, "HTMLDListElement": false, "HTMLDocument": false, "HTMLElement": false, "HTMLEmbedElement": false, "HTMLFieldSetElement": false, "HTMLFontElement": false, "HTMLFormControlsCollection": false, "HTMLFormElement": false, "HTMLFrameElement": false, "HTMLFrameSetElement": false, "HTMLHeadElement": false, "HTMLHeadingElement": false, "HTMLHRElement": false, "HTMLHtmlElement": false, "HTMLIFrameElement": false, "HTMLImageElement": false, "HTMLInputElement": false, "HTMLLabelElement": false, "HTMLLegendElement": false, "HTMLLIElement": false, "HTMLLinkElement": false, "HTMLMapElement": false, "HTMLMarqueeElement": false, "HTMLMediaElement": false, "HTMLMenuElement": false, "HTMLMetaElement": false, "HTMLMeterElement": false, "HTMLModElement": false, "HTMLObjectElement": false, "HTMLOListElement": false, "HTMLOptGroupElement": false, "HTMLOptionElement": false, "HTMLOptionsCollection": false, "HTMLOutputElement": false, "HTMLParagraphElement": false, "HTMLParamElement": false, "HTMLPictureElement": false, "HTMLPreElement": false, "HTMLProgressElement": false, "HTMLQuoteElement": false, "HTMLScriptElement": false, "HTMLSelectElement": false, "HTMLShadowElement": false, "HTMLSlotElement": false, "HTMLSourceElement": false, "HTMLSpanElement": false, "HTMLStyleElement": false, "HTMLTableCaptionElement": false, "HTMLTableCellElement": false, "HTMLTableColElement": false, "HTMLTableElement": false, "HTMLTableRowElement": false, "HTMLTableSectionElement": false, "HTMLTemplateElement": false, "HTMLTextAreaElement": false, "HTMLTimeElement": false, "HTMLTitleElement": false, "HTMLTrackElement": false, "HTMLUListElement": false, "HTMLUnknownElement": false, "HTMLVideoElement": false, "IDBCursor": false, "IDBCursorWithValue": false, "IDBDatabase": false, "IDBFactory": false, "IDBIndex": false, "IDBKeyRange": false, "IDBObjectStore": false, "IDBOpenDBRequest": false, "IDBRequest": false, "IDBTransaction": false, "IDBVersionChangeEvent": false, "IdleDeadline": false, "IIRFilterNode": false, "Image": false, "ImageBitmap": false, "ImageBitmapRenderingContext": false, "ImageCapture": false, "ImageData": false, "indexedDB": false, "innerHeight": false, "innerWidth": false, "InputEvent": false, "IntersectionObserver": false, "IntersectionObserverEntry": false, "isSecureContext": false, "KeyboardEvent": false, "KeyframeEffect": false, "KeyframeEffectReadOnly": false, "length": false, "localStorage": false, "location": false, "Location": false, "locationbar": false, "matchMedia": false, "MediaDeviceInfo": false, "MediaDevices": false, "MediaElementAudioSourceNode": false, "MediaEncryptedEvent": false, "MediaError": false, "MediaKeyMessageEvent": false, "MediaKeySession": false, "MediaKeyStatusMap": false, "MediaKeySystemAccess": false, "MediaList": false, "MediaQueryList": false, "MediaQueryListEvent": false, "MediaRecorder": false, "MediaSettingsRange": false, "MediaSource": false, "MediaStream": false, "MediaStreamAudioDestinationNode": false, "MediaStreamAudioSourceNode": false, "MediaStreamEvent": false, "MediaStreamTrack": false, "MediaStreamTrackEvent": false, "menubar": false, "MessageChannel": false, "MessageEvent": false, "MessagePort": false, "MIDIAccess": false, "MIDIConnectionEvent": false, "MIDIInput": false, "MIDIInputMap": false, "MIDIMessageEvent": false, "MIDIOutput": false, "MIDIOutputMap": false, "MIDIPort": false, "MimeType": false, "MimeTypeArray": false, "MouseEvent": false, "moveBy": false, "moveTo": false, "MutationEvent": false, "MutationObserver": false, "MutationRecord": false, "name": false, "NamedNodeMap": false, "NavigationPreloadManager": false, "navigator": false, "Navigator": false, "NetworkInformation": false, "Node": false, "NodeFilter": false, "NodeIterator": false, "NodeList": false, "Notification": false, "OfflineAudioCompletionEvent": false, "OfflineAudioContext": false, "offscreenBuffering": false, "OffscreenCanvas": true, "onabort": true, "onafterprint": true, "onanimationend": true, "onanimationiteration": true, "onanimationstart": true, "onappinstalled": true, "onauxclick": true, "onbeforeinstallprompt": true, "onbeforeprint": true, "onbeforeunload": true, "onblur": true, "oncancel": true, "oncanplay": true, "oncanplaythrough": true, "onchange": true, "onclick": true, "onclose": true, "oncontextmenu": true, "oncuechange": true, "ondblclick": true, "ondevicemotion": true, "ondeviceorientation": true, "ondeviceorientationabsolute": true, "ondrag": true, "ondragend": true, "ondragenter": true, "ondragleave": true, "ondragover": true, "ondragstart": true, "ondrop": true, "ondurationchange": true, "onemptied": true, "onended": true, "onerror": true, "onfocus": true, "ongotpointercapture": true, "onhashchange": true, "oninput": true, "oninvalid": true, "onkeydown": true, "onkeypress": true, "onkeyup": true, "onlanguagechange": true, "onload": true, "onloadeddata": true, "onloadedmetadata": true, "onloadstart": true, "onlostpointercapture": true, "onmessage": true, "onmessageerror": true, "onmousedown": true, "onmouseenter": true, "onmouseleave": true, "onmousemove": true, "onmouseout": true, "onmouseover": true, "onmouseup": true, "onmousewheel": true, "onoffline": true, "ononline": true, "onpagehide": true, "onpageshow": true, "onpause": true, "onplay": true, "onplaying": true, "onpointercancel": true, "onpointerdown": true, "onpointerenter": true, "onpointerleave": true, "onpointermove": true, "onpointerout": true, "onpointerover": true, "onpointerup": true, "onpopstate": true, "onprogress": true, "onratechange": true, "onrejectionhandled": true, "onreset": true, "onresize": true, "onscroll": true, "onsearch": true, "onseeked": true, "onseeking": true, "onselect": true, "onstalled": true, "onstorage": true, "onsubmit": true, "onsuspend": true, "ontimeupdate": true, "ontoggle": true, "ontransitionend": true, "onunhandledrejection": true, "onunload": true, "onvolumechange": true, "onwaiting": true, "onwheel": true, "open": false, "openDatabase": false, "opener": false, "Option": false, "origin": false, "OscillatorNode": false, "outerHeight": false, "outerWidth": false, "PageTransitionEvent": false, "pageXOffset": false, "pageYOffset": false, "PannerNode": false, "parent": false, "Path2D": false, "PaymentAddress": false, "PaymentRequest": false, "PaymentRequestUpdateEvent": false, "PaymentResponse": false, "performance": false, "Performance": false, "PerformanceEntry": false, "PerformanceLongTaskTiming": false, "PerformanceMark": false, "PerformanceMeasure": false, "PerformanceNavigation": false, "PerformanceNavigationTiming": false, "PerformanceObserver": false, "PerformanceObserverEntryList": false, "PerformancePaintTiming": false, "PerformanceResourceTiming": false, "PerformanceTiming": false, "PeriodicWave": false, "Permissions": false, "PermissionStatus": false, "personalbar": false, "PhotoCapabilities": false, "Plugin": false, "PluginArray": false, "PointerEvent": false, "PopStateEvent": false, "postMessage": false, "Presentation": false, "PresentationAvailability": false, "PresentationConnection": false, "PresentationConnectionAvailableEvent": false, "PresentationConnectionCloseEvent": false, "PresentationConnectionList": false, "PresentationReceiver": false, "PresentationRequest": false, "print": false, "ProcessingInstruction": false, "ProgressEvent": false, "PromiseRejectionEvent": false, "prompt": false, "PushManager": false, "PushSubscription": false, "PushSubscriptionOptions": false, "RadioNodeList": false, "Range": false, "ReadableStream": false, "registerProcessor": false, "RemotePlayback": false, "removeEventListener": false, "Request": false, "requestAnimationFrame": false, "requestIdleCallback": false, "resizeBy": false, "ResizeObserver": false, "ResizeObserverEntry": false, "resizeTo": false, "Response": false, "RTCCertificate": false, "RTCDataChannel": false, "RTCDataChannelEvent": false, "RTCDtlsTransport": false, "RTCIceCandidate": false, "RTCIceGatherer": false, "RTCIceTransport": false, "RTCPeerConnection": false, "RTCPeerConnectionIceEvent": false, "RTCRtpContributingSource": false, "RTCRtpReceiver": false, "RTCRtpSender": false, "RTCSctpTransport": false, "RTCSessionDescription": false, "RTCStatsReport": false, "RTCTrackEvent": false, "screen": false, "Screen": false, "screenLeft": false, "ScreenOrientation": false, "screenTop": false, "screenX": false, "screenY": false, "ScriptProcessorNode": false, "scroll": false, "scrollbars": false, "scrollBy": false, "scrollTo": false, "scrollX": false, "scrollY": false, "SecurityPolicyViolationEvent": false, "Selection": false, "self": false, "ServiceWorker": false, "ServiceWorkerContainer": false, "ServiceWorkerRegistration": false, "sessionStorage": false, "ShadowRoot": false, "SharedWorker": false, "SourceBuffer": false, "SourceBufferList": false, "speechSynthesis": false, "SpeechSynthesisEvent": false, "SpeechSynthesisUtterance": false, "StaticRange": false, "status": false, "statusbar": false, "StereoPannerNode": false, "stop": false, "Storage": false, "StorageEvent": false, "StorageManager": false, "styleMedia": false, "StyleSheet": false, "StyleSheetList": false, "SubtleCrypto": false, "SVGAElement": false, "SVGAngle": false, "SVGAnimatedAngle": false, "SVGAnimatedBoolean": false, "SVGAnimatedEnumeration": false, "SVGAnimatedInteger": false, "SVGAnimatedLength": false, "SVGAnimatedLengthList": false, "SVGAnimatedNumber": false, "SVGAnimatedNumberList": false, "SVGAnimatedPreserveAspectRatio": false, "SVGAnimatedRect": false, "SVGAnimatedString": false, "SVGAnimatedTransformList": false, "SVGAnimateElement": false, "SVGAnimateMotionElement": false, "SVGAnimateTransformElement": false, "SVGAnimationElement": false, "SVGCircleElement": false, "SVGClipPathElement": false, "SVGComponentTransferFunctionElement": false, "SVGDefsElement": false, "SVGDescElement": false, "SVGDiscardElement": false, "SVGElement": false, "SVGEllipseElement": false, "SVGFEBlendElement": false, "SVGFEColorMatrixElement": false, "SVGFEComponentTransferElement": false, "SVGFECompositeElement": false, "SVGFEConvolveMatrixElement": false, "SVGFEDiffuseLightingElement": false, "SVGFEDisplacementMapElement": false, "SVGFEDistantLightElement": false, "SVGFEDropShadowElement": false, "SVGFEFloodElement": false, "SVGFEFuncAElement": false, "SVGFEFuncBElement": false, "SVGFEFuncGElement": false, "SVGFEFuncRElement": false, "SVGFEGaussianBlurElement": false, "SVGFEImageElement": false, "SVGFEMergeElement": false, "SVGFEMergeNodeElement": false, "SVGFEMorphologyElement": false, "SVGFEOffsetElement": false, "SVGFEPointLightElement": false, "SVGFESpecularLightingElement": false, "SVGFESpotLightElement": false, "SVGFETileElement": false, "SVGFETurbulenceElement": false, "SVGFilterElement": false, "SVGForeignObjectElement": false, "SVGGElement": false, "SVGGeometryElement": false, "SVGGradientElement": false, "SVGGraphicsElement": false, "SVGImageElement": false, "SVGLength": false, "SVGLengthList": false, "SVGLinearGradientElement": false, "SVGLineElement": false, "SVGMarkerElement": false, "SVGMaskElement": false, "SVGMatrix": false, "SVGMetadataElement": false, "SVGMPathElement": false, "SVGNumber": false, "SVGNumberList": false, "SVGPathElement": false, "SVGPatternElement": false, "SVGPoint": false, "SVGPointList": false, "SVGPolygonElement": false, "SVGPolylineElement": false, "SVGPreserveAspectRatio": false, "SVGRadialGradientElement": false, "SVGRect": false, "SVGRectElement": false, "SVGScriptElement": false, "SVGSetElement": false, "SVGStopElement": false, "SVGStringList": false, "SVGStyleElement": false, "SVGSVGElement": false, "SVGSwitchElement": false, "SVGSymbolElement": false, "SVGTextContentElement": false, "SVGTextElement": false, "SVGTextPathElement": false, "SVGTextPositioningElement": false, "SVGTitleElement": false, "SVGTransform": false, "SVGTransformList": false, "SVGTSpanElement": false, "SVGUnitTypes": false, "SVGUseElement": false, "SVGViewElement": false, "TaskAttributionTiming": false, "Text": false, "TextEvent": false, "TextMetrics": false, "TextTrack": false, "TextTrackCue": false, "TextTrackCueList": false, "TextTrackList": false, "TimeRanges": false, "toolbar": false, "top": false, "Touch": false, "TouchEvent": false, "TouchList": false, "TrackEvent": false, "TransitionEvent": false, "TreeWalker": false, "UIEvent": false, "ValidityState": false, "visualViewport": false, "VisualViewport": false, "VTTCue": false, "WaveShaperNode": false, "WebAssembly": false, "WebGL2RenderingContext": false, "WebGLActiveInfo": false, "WebGLBuffer": false, "WebGLContextEvent": false, "WebGLFramebuffer": false, "WebGLProgram": false, "WebGLQuery": false, "WebGLRenderbuffer": false, "WebGLRenderingContext": false, "WebGLSampler": false, "WebGLShader": false, "WebGLShaderPrecisionFormat": false, "WebGLSync": false, "WebGLTexture": false, "WebGLTransformFeedback": false, "WebGLUniformLocation": false, "WebGLVertexArrayObject": false, "WebSocket": false, "WheelEvent": false, "window": false, "Window": false, "Worker": false, "WritableStream": false, "XMLDocument": false, "XMLHttpRequest": false, "XMLHttpRequestEventTarget": false, "XMLHttpRequestUpload": false, "XMLSerializer": false, "XPathEvaluator": false, "XPathExpression": false, "XPathResult": false, "XSLTProcessor": false, "Array": false, "ArrayBuffer": false, "Boolean": false, "constructor": false, "DataView": false, "Date": false, "decodeURI": false, "decodeURIComponent": false, "encodeURI": false, "encodeURIComponent": false, "Error": false, "escape": false, "eval": false, "EvalError": false, "Float32Array": false, "Float64Array": false, "Function": false, "hasOwnProperty": false, "Infinity": false, "Int16Array": false, "Int32Array": false, "Int8Array": false, "isFinite": false, "isNaN": false, "isPrototypeOf": false, "JSON": false, "Map": false, "Math": false, "NaN": false, "Number": false, "Object": false, "parseFloat": false, "parseInt": false, "Promise": false, "propertyIsEnumerable": false, "Proxy": false, "RangeError": false, "ReferenceError": false, "Reflect": false, "RegExp": false, "Set": false, "String": false, "Symbol": false, "SyntaxError": false, "toLocaleString": false, "toString": false, "TypeError": false, "Uint16Array": false, "Uint32Array": false, "Uint8Array": false, "Uint8ClampedArray": false, "undefined": false, "unescape": false, "URIError": false, "valueOf": false, "WeakMap": false, "WeakSet": false, "afterAll": false, "afterEach": false, "beforeAll": false, "beforeEach": false, "describe": false, "expect": false, "fit": false, "it": false, "jasmine": false, "jest": false, "pending": false, "pit": false, "test": false, "xdescribe": false, "xit": false, "xtest": false, "fdescribe": false }, "env": { "node": true, "browser": true, "es6": true, "jest/globals": true, "jest": true }, "rules": { "accessor-pairs": "off", "array-bracket-newline": "off", "array-bracket-spacing": "off", "array-callback-return": "off", "array-element-newline": "off", "arrow-body-style": "off", "arrow-parens": "off", "arrow-spacing": "off", "block-scoped-var": "off", "block-spacing": "off", "brace-style": "off", "callback-return": "off", "camelcase": [ "error", { "properties": "never" } ], "capitalized-comments": "off", "class-methods-use-this": "off", "comma-dangle": "off", "comma-spacing": "off", "comma-style": "off", "complexity": "off", "computed-property-spacing": "off", "consistent-return": "off", "consistent-this": "off", "constructor-super": "error", "curly": 0, "default-case": "off", "dot-location": "off", "dot-notation": "error", "eol-last": "off", "eqeqeq": "error", "for-direction": "error", "func-call-spacing": "off", "func-name-matching": "off", "func-names": "off", "func-style": "off", "function-paren-newline": "off", "generator-star-spacing": "off", "getter-return": "error", "global-require": "off", "guard-for-in": "off", "handle-callback-err": "off", "id-blacklist": "off", "id-length": "off", "id-match": "off", "implicit-arrow-linebreak": "off", "indent": "off", "indent-legacy": "off", "init-declarations": "off", "jsx-quotes": "off", "key-spacing": "off", "keyword-spacing": "off", "line-comment-position": "off", "linebreak-style": "off", "lines-around-comment": 0, "lines-around-directive": "off", "lines-between-class-members": "off", "max-classes-per-file": "off", "max-depth": "off", "max-len": 0, "max-lines": "off", "max-lines-per-function": "off", "max-nested-callbacks": "off", "max-params": "off", "max-statements": "off", "max-statements-per-line": "off", "multiline-comment-style": "off", "multiline-ternary": "off", "new-cap": "off", "new-parens": "off", "newline-after-var": "off", "newline-before-return": "off", "newline-per-chained-call": "off", "no-alert": "off", "no-array-constructor": "off", "no-async-promise-executor": "off", "no-await-in-loop": "off", "no-bitwise": "off", "no-buffer-constructor": "off", "no-caller": "off", "no-case-declarations": "error", "no-catch-shadow": "off", "no-class-assign": "error", "no-compare-neg-zero": "error", "no-cond-assign": "error", "no-confusing-arrow": 0, "no-console": "error", "no-const-assign": "error", "no-constant-condition": "error", "no-continue": "off", "no-control-regex": "error", "no-debugger": "error", "no-delete-var": "error", "no-div-regex": "off", "no-dupe-args": "error", "no-dupe-class-members": "error", "no-dupe-keys": "error", "no-duplicate-case": "error", "no-duplicate-imports": "error", "no-else-return": "off", "no-empty": "error", "no-empty-character-class": "error", "no-empty-function": "off", "no-empty-pattern": "error", "no-eq-null": "off", "no-eval": "off", "no-ex-assign": "error", "no-extend-native": "off", "no-extra-bind": "off", "no-extra-boolean-cast": "error", "no-extra-label": "off", "no-extra-parens": "off", "no-extra-semi": "off", "no-fallthrough": "error", "no-floating-decimal": "off", "no-func-assign": "error", "no-global-assign": "error", "no-implicit-coercion": "off", "no-implicit-globals": "off", "no-implied-eval": "off", "no-inline-comments": "off", "no-inner-declarations": "error", "no-invalid-regexp": "error", "no-invalid-this": "off", "no-irregular-whitespace": "error", "no-iterator": "off", "no-label-var": "off", "no-labels": "off", "no-lone-blocks": "off", "no-lonely-if": "off", "no-loop-func": "off", "no-magic-numbers": "off", "no-misleading-character-class": "off", "no-mixed-operators": 0, "no-mixed-requires": "off", "no-mixed-spaces-and-tabs": "off", "no-multi-assign": "off", "no-multi-spaces": "off", "no-multi-str": "off", "no-multiple-empty-lines": "off", "no-native-reassign": "off", "no-negated-condition": "off", "no-negated-in-lhs": "off", "no-nested-ternary": "error", "no-new": "off", "no-new-func": "off", "no-new-object": "off", "no-new-require": "off", "no-new-symbol": "error", "no-new-wrappers": "off", "no-obj-calls": "error", "no-octal": "error", "no-octal-escape": "off", "no-param-reassign": "off", "no-path-concat": "off", "no-plusplus": "off", "no-process-env": "off", "no-process-exit": "off", "no-proto": "off", "no-prototype-builtins": "off", "no-redeclare": "error", "no-regex-spaces": "error", "no-restricted-globals": "off", "no-restricted-imports": "off", "no-restricted-modules": "off", "no-restricted-properties": "off", "no-restricted-syntax": "off", "no-return-assign": "off", "no-return-await": "off", "no-script-url": "off", "no-self-assign": "error", "no-self-compare": "off", "no-sequences": "off", "no-shadow": "off", "no-shadow-restricted-names": "off", "no-spaced-func": "off", "no-sparse-arrays": "error", "no-sync": "off", "no-tabs": 0, "no-template-curly-in-string": "off", "no-ternary": "off", "no-this-before-super": "error", "no-throw-literal": "off", "no-trailing-spaces": "off", "no-undef": "error", "no-undef-init": "off", "no-undefined": "off", "no-underscore-dangle": "off", "no-unexpected-multiline": 0, "no-unmodified-loop-condition": "off", "no-unneeded-ternary": "off", "no-unreachable": "error", "no-unsafe-finally": "error", "no-unsafe-negation": "error", "no-unused-expressions": "off", "no-unused-labels": "error", "no-unused-vars": "error", "no-use-before-define": "off", "no-useless-call": "off", "no-useless-computed-key": "error", "no-useless-concat": "off", "no-useless-constructor": "off", "no-useless-escape": "error", "no-useless-rename": "off", "no-useless-return": "off", "no-var": "error", "no-void": "off", "no-warning-comments": "off", "no-whitespace-before-property": "off", "no-with": "off", "nonblock-statement-body-position": "off", "object-curly-newline": "off", "object-curly-spacing": "off", "object-property-newline": "off", "object-shorthand": "off", "one-var": "off", "one-var-declaration-per-line": "off", "operator-assignment": "off", "operator-linebreak": "off", "padded-blocks": "off", "padding-line-between-statements": "off", "prefer-arrow-callback": "off", "prefer-const": "error", "prefer-destructuring": "off", "prefer-numeric-literals": "off", "prefer-object-spread": "off", "prefer-promise-reject-errors": "off", "prefer-reflect": "off", "prefer-rest-params": "off", "prefer-spread": "off", "prefer-template": "error", "quote-props": "off", "quotes": 0, "radix": "off", "require-atomic-updates": "off", "require-await": "off", "require-jsdoc": "off", "require-unicode-regexp": "off", "require-yield": "error", "rest-spread-spacing": "off", "semi": "off", "semi-spacing": "off", "semi-style": "off", "sort-imports": "off", "sort-keys": "off", "sort-vars": "off", "space-before-blocks": "off", "space-before-function-paren": "off", "space-in-parens": "off", "space-infix-ops": "off", "space-unary-ops": "off", "spaced-comment": "off", "strict": "off", "switch-colon-spacing": "off", "symbol-description": "off", "template-curly-spacing": "off", "template-tag-spacing": "off", "unicode-bom": "off", "use-isnan": "error", "valid-jsdoc": "off", "valid-typeof": "error", "vars-on-top": "off", "wrap-iife": "off", "wrap-regex": "off", "yield-star-spacing": "off", "yoda": "off", "generator-star": "off", "no-arrow-condition": "off", "no-comma-dangle": "off", "no-reserved-keys": "off", "no-space-before-semi": "off", "no-wrap-func": "off", "space-after-function-name": "off", "space-after-keywords": "off", "space-before-function-parentheses": "off", "space-before-keywords": "off", "space-in-brackets": "off", "space-return-throw-case": "off", "space-unary-word-ops": "off", "prettier/prettier": [ "error", { "printWidth": 80, "tabWidth": 4, "semi": false, "trailingComma": "all", "singleQuote": true } ], "jest/no-alias-methods": "warn", "jest/no-disabled-tests": "warn", "jest/no-focused-tests": "error", "jest/no-identical-title": "error", "jest/no-jest-import": "error", "jest/no-jasmine-globals": "warn", "jest/no-test-prefixes": "error", "jest/valid-describe": "error", "jest/valid-expect": "error", "jest/valid-expect-in-promise": "error", "jest/prefer-to-be-null": "error", "jest/prefer-to-be-undefined": "error", "jest/prefer-to-have-length": "error" }, "parserOptions": { "ecmaFeatures": { "globalReturn": true }, "ecmaVersion": 9, "sourceType": "module" }, "extends": [ "eslint:recommended", "prettier", "plugin:jest/recommended", "@tophat", "@tophat/eslint-config/jest" ], "plugins": [ "prettier", "jest" ] } ``` ```sh Done in 9.27s. ```

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

async function run() {
    // ...
             log('Querying github release API to determine latest version')
             { downloadUrl, versionTag } = await getLatestYvmVersion()
    // ...
}
yarn eslint scripts/install.js

What did you expect to happen? Errors should be output and shown in VS Code.

What actually happened? Please include the actual, raw output from ESLint.

yarn run v1.7.0
$ /Users/Emmanuel/Sources/yvm/node_modules/.bin/eslint scripts/install.js

/Users/Emmanuel/Sources/yvm/scripts/install.js
  89:41  error  Parsing error: Unexpected token

  87 |         } else {
  88 |             log('Querying github release API to determine latest version')
> 89 |             { downloadUrl, versionTag } = await getLatestYvmVersion()
     |                                         ^
  90 |         }
  91 |         zipFile = ZIP_DOWNLOAD_PATH
  92 |         downloadFile(downloadUrl, zipFile)

✖ 1 problem (1 error, 0 warnings)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

VS Code integration breaks: the first = is underlined with the message: [eslint] Parsing error: unexpected token = Linting is broken for entire file, no other errors are shown even though they exist.

Conversely this is accepted:

const { downloadUrl, versionTag } = await getLatestYvmVersion()

Are you willing to submit a pull request to fix this bug? Sure :)

platinumazure commented 5 years ago

I'm not super familiar with Typescript so I don't know if there are Typescript-specific concerns here. But in vanilla JS, you can't use an object destructuring in an assignment expression without parentheses. This is because there is a parsing ambiguity between whether the brace is opening an object pattern or a block. So JavaScript interpreters assume a block unless you wrap the expression in parentheses.

Similarly, when in a variable declaration, the const tells the interpreter that it's definitely a declaration and there's no way the brace could mean block, so the brace must mean an object pattern, unambiguously.

Again, I'm talking about JS, not TS, so hopefully a team member can correct me if TS handles this differently. But in JS, you just need to wrap the whole assignment expression in parentheses:

({ downloadUrl, versionTag } = await getLatestYvmVersion())
iamogbz commented 5 years ago

Oops my bad