jsx-eslint / eslint-plugin-react

React-specific linting rules for ESLint
MIT License
8.86k stars 2.75k forks source link

jsx-indent rule #1852

Closed stheine closed 5 years ago

stheine commented 6 years ago

Tell us about your environment

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

Please show your full configuration:

Configuration ```js { "globals": { "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, "clearInterval": false, "clearTimeout": false, "clientInformation": false, "ClipboardEvent": false, "close": false, "closed": false, "CloseEvent": false, "Comment": false, "CompositionEvent": false, "confirm": false, "console": 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, "Intl": false, "isSecureContext": false, "KeyboardEvent": false, "KeyframeEffect": false, "KeyframeEffectReadOnly": false, "length": false, "localStorage": true, "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, "setInterval": false, "setTimeout": 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, "TextDecoder": false, "TextEncoder": 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, "URL": false, "URLSearchParams": 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, "exports": true, "global": false, "module": false, "require": 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, "after": false, "afterEach": false, "before": false, "beforeEach": false, "context": false, "describe": false, "it": false, "mocha": false, "run": false, "setup": false, "specify": false, "suite": false, "suiteSetup": false, "suiteTeardown": false, "teardown": false, "test": false, "xcontext": false, "xdescribe": false, "xit": false, "xspecify": false, "__dirname": false, "__filename": false, "Buffer": false, "clearImmediate": false, "process": false, "setImmediate": false, "angular": true, "React": true }, "env": { "browser": true, "commonjs": true, "shared-node-browser": true, "es6": true, "mocha": true, "node": true }, "rules": { "comma-dangle": [ "error", "only-multiline" ], "for-direction": 2, "getter-return": [ 2, { "allowImplicit": true } ], "no-await-in-loop": 0, "no-compare-neg-zero": 2, "no-cond-assign": [ 2, "always" ], "no-console": 2, "no-constant-condition": 2, "no-control-regex": 2, "no-debugger": 2, "no-dupe-args": 2, "no-dupe-keys": 2, "no-duplicate-case": 2, "no-empty": 2, "no-empty-character-class": 2, "no-ex-assign": 2, "no-extra-boolean-cast": 2, "no-extra-parens": [ 0, "all", { "conditionalAssign": false, "enforceForArrowConditionals": false, "ignoreJSX": "all", "nestedBinaryExpressions": false, "returnAssign": false } ], "no-extra-semi": 2, "no-func-assign": 2, "no-inner-declarations": [ 2, "both" ], "no-invalid-regexp": 2, "no-irregular-whitespace": 2, "no-obj-calls": 2, "no-regex-spaces": 2, "no-sparse-arrays": 2, "no-unexpected-multiline": 2, "no-template-curly-in-string": 2, "no-unreachable": 2, "no-unsafe-finally": 2, "no-unsafe-negation": 2, "use-isnan": 2, "valid-jsdoc": 0, "valid-typeof": 2, "accessor-pairs": [ 2, { "getWithoutSet": false, "setWithoutGet": true } ], "array-callback-return": [ 2, { "allowImplicit": true } ], "block-scoped-var": 2, "class-methods-use-this": 0, "complexity": 0, "consistent-return": 0, "curly": [ 2, "all" ], "default-case": 2, "dot-location": [ 2, "property" ], "dot-notation": [ 2, { "allowKeywords": true } ], "eqeqeq": 2, "guard-for-in": 2, "no-alert": 2, "no-caller": 2, "no-case-declarations": 2, "no-div-regex": 2, "no-else-return": 2, "no-empty-function": [ 2, { "allow": [ "methods" ] } ], "no-eq-null": 2, "no-eval": 2, "no-extend-native": 2, "no-extra-bind": 2, "no-extra-label": 2, "no-fallthrough": 2, "no-floating-decimal": 2, "no-global-assign": 2, "no-implicit-coercion": 2, "no-implicit-globals": 2, "no-implied-eval": 2, "no-invalid-this": 0, "no-iterator": 2, "no-labels": 2, "no-lone-blocks": 2, "no-loop-func": 2, "no-magic-numbers": 0, "no-multi-spaces": 0, "no-multi-str": 2, "no-new": 2, "no-new-func": 2, "no-new-wrappers": 2, "no-octal": 2, "no-octal-escape": 2, "no-param-reassign": 0, "no-proto": 2, "no-redeclare": 2, "no-return-assign": [ 2, "always" ], "no-script-url": 2, "no-self-assign": 2, "no-self-compare": 2, "no-sequences": 2, "no-throw-literal": 2, "no-unmodified-loop-condition": 2, "no-unused-expressions": 2, "no-unused-labels": 2, "no-useless-call": 2, "no-useless-concat": 2, "no-useless-escape": 2, "no-useless-return": 2, "no-void": 2, "no-warning-comments": 0, "no-with": 2, "radix": 2, "vars-on-top": 2, "wrap-iife": [ 2, "inside" ], "yoda": [ 2, "never" ], "strict": [ 2, "global" ], "init-declarations": 0, "no-catch-shadow": 2, "no-delete-var": 2, "no-label-var": 2, "no-restricted-globals": [ 2, "event", "history", "status" ], "no-shadow": 2, "no-shadow-restricted-names": 2, "no-undef": 2, "no-undef-init": 2, "no-undefined": 0, "no-unused-vars": [ 2, { "vars": "all", "args": "after-used" } ], "no-use-before-define": 2, "callback-return": [ 2, [ "callback", "done", "next" ] ], "global-require": 2, "handle-callback-err": [ 2, "err" ], "no-buffer-constructor": 2, "no-mixed-requires": [ 2, true ], "no-new-require": 2, "no-path-concat": 2, "no-process-env": 0, "no-process-exit": 0, "no-restricted-modules": 0, "no-sync": [ 2, { "allowAtRootLevel": false } ], "array-bracket-newline": 0, "array-bracket-spacing": [ 2, "never" ], "array-element-newline": 0, "block-spacing": [ 2, "always" ], "brace-style": [ 2, "1tbs", { "allowSingleLine": false } ], "camelcase": 0, "comma-spacing": [ 2, { "before": false, "after": true } ], "comma-style": [ 2, "last" ], "computed-property-spacing": [ 2, "never" ], "consistent-this": [ 2, "that" ], "eol-last": 2, "func-names": 0, "func-call-spacing": [ 2, "never" ], "func-name-matching": 0, "func-style": [ 2, "expression" ], "function-paren-newline": [ 2, "consistent" ], "id-blacklist": 0, "id-length": [ 2, { "min": 2, "properties": "always", "exceptions": [ "_", "i", "j", "x", "y", "z" ] } ], "id-match": 0, "implicit-arrow-linebreak": 0, "indent": [ 2, 2, { "CallExpression": { "arguments": "off" }, "ignoreComments": true, "SwitchCase": 1, "VariableDeclarator": { "var": 2, "let": 2, "const": 3 }, "MemberExpression": "off" } ], "jsx-quotes": [ 2, "prefer-single" ], "key-spacing": [ 0, { "beforeColon": false, "afterColon": true, "mode": "strict" } ], "keyword-spacing": [ "error", { "overrides": { "catch": { "after": false }, "if": { "after": false }, "for": { "after": false }, "switch": { "after": false }, "while": { "after": false } } } ], "line-comment-position": [ 0, { "position": "above" } ], "linebreak-style": [ 0, "unix" ], "lines-around-comment": [ 0, { "beforeBlockComment": false, "afterBlockComment": false, "beforeLineComment": true, "afterLineComment": false, "allowBlockStart": true, "allowBlockEnd": true, "allowObjectStart": true, "allowObjectEnd": true, "allowArrayStart": true, "allowArrayEnd": true } ], "lines-between-class-members": [ 2, "always" ], "max-depth": 0, "max-len": [ 1, 120 ], "max-nested-callbacks": 0, "max-params": 0, "max-statements": 0, "max-statements-per-line": [ 2, { "max": 2 } ], "multiline-comment-style": [ 0, "separate-lines" ], "multiline-ternary": [ 2, "always-multiline" ], "new-cap": [ 2, { "newIsCap": true, "capIsNew": true, "newIsCapExceptions": [], "capIsNewExceptions": [], "properties": true } ], "new-parens": 2, "newline-per-chained-call": [ 2, { "ignoreChainWithDepth": 2 } ], "no-array-constructor": 2, "no-bitwise": 2, "no-continue": 0, "no-inline-comments": 0, "no-lonely-if": 2, "no-mixed-spaces-and-tabs": [ 2 ], "no-multiple-empty-lines": [ 0, { "max": 1 } ], "no-negated-condition": 0, "no-nested-ternary": 2, "no-new-object": 2, "no-plusplus": [ 0, { "allowForLoopAfterthoughts": true } ], "no-restricted-syntax": 0, "no-ternary": 0, "no-trailing-spaces": [ 2, { "ignoreComments": false, "skipBlankLines": false } ], "no-underscore-dangle": 2, "no-unneeded-ternary": 2, "no-whitespace-before-property": 2, "object-curly-newline": [ 0, { "ObjectExpression": { "consistent": true }, "ObjectPattern": { "consistent": true } } ], "object-curly-spacing": [ 2, "never" ], "object-property-newline": [ 2, { "allowAllPropertiesOnSameLine": true } ], "one-var": 0, "one-var-declaration-per-line": [ 2, "always" ], "operator-assignment": [ 2, "always" ], "operator-linebreak": [ 0, "after" ], "padded-blocks": [ 2, "never" ], "padding-line-between-statements": [ 2, { "blankLine": "always", "prev": "*", "next": "return" }, { "blankLine": "always", "prev": [ "const", "let", "var" ], "next": "*" }, { "blankLine": "any", "prev": [ "const", "let", "var" ], "next": [ "const", "let", "var" ] }, { "blankLine": "always", "prev": "directive", "next": "*" }, { "blankLine": "any", "prev": "directive", "next": "directive" } ], "quote-props": [ 2, "as-needed" ], "quotes": [ 2, "single", { "avoidEscape": false, "allowTemplateLiterals": true } ], "require-jsdoc": 0, "semi": [ 2, "always" ], "semi-spacing": [ 2, { "before": false, "after": true } ], "semi-style": [ 2, "last" ], "sort-keys": [ 0 ], "sort-vars": [ 2, { "ignoreCase": true } ], "space-before-blocks": [ 2, "always" ], "space-before-function-paren": [ 2, "never" ], "space-in-parens": [ 2, "never" ], "space-infix-ops": [ 2, { "int32Hint": false } ], "space-unary-ops": [ 2, { "words": true, "nonwords": false } ], "spaced-comment": [ 2, "always" ], "switch-colon-spacing": [ 2, { "after": true, "before": false } ], "wrap-regex": 0, "arrow-body-style": [ 2, "as-needed" ], "arrow-parens": [ 2, "as-needed" ], "arrow-spacing": [ 2, { "before": true, "after": true } ], "constructor-super": 2, "generator-star-spacing": [ 2, { "before": true, "after": true } ], "no-class-assign": 2, "no-confusing-arrow": 2, "no-const-assign": 2, "no-dupe-class-members": 2, "no-duplicate-imports": 2, "no-new-symbol": 2, "no-restricted-imports": 0, "no-this-before-super": 2, "no-useless-computed-key": 2, "no-useless-constructor": 2, "no-var": 2, "object-shorthand": [ 0, "always" ], "prefer-arrow-callback": [ 2, { "allowNamedFunctions": false, "allowUnboundThis": true } ], "prefer-const": [ 2, { "destructuring": "any", "ignoreReadBeforeAssign": true } ], "prefer-numeric-literals": 2, "prefer-reflect": [ 2, { "exceptions": [] } ], "prefer-rest-params": 2, "prefer-spread": 2, "prefer-template": 0, "require-yield": 2, "sort-imports": [ 0, { "ignoreCase": true, "ignoreMemberSort": false, "memberSyntaxSortOrder": [ "single", "multiple", "all", "none" ] } ], "symbol-description": 2, "template-curly-spacing": [ 2, "never" ], "yield-star-spacing": [ 2, { "before": true, "after": true } ], "extended/consistent-err-names": [ 2, "prefix" ], "mocha/no-exclusive-tests": 2, "mocha/no-skipped-tests": 2, "mocha/no-pending-tests": 2, "mocha/handle-done-callback": 2, "mocha/no-synchronous-tests": 2, "mocha/no-global-tests": 2, "mocha/no-return-and-callback": 2, "mocha/valid-test-description": 0, "mocha/valid-suite-description": 0, "mocha/no-sibling-hooks": 2, "mocha/no-mocha-arrows": 0, "mocha/no-hooks": 0, "mocha/no-hooks-for-single-case": 0, "mocha/no-top-level-hooks": 2, "mocha/no-identical-title": 2, "mocha/max-top-level-suites": [ 0, { "limit": 1 } ], "react/display-name": 0, "react/forbid-component-props": 0, "react/forbid-prop-types": 0, "react/no-children-prop": 0, "react/no-danger": 0, "react/no-danger-with-children": 2, "react/no-deprecated": 0, "react/no-did-mount-set-state": 0, "react/no-did-update-set-state": 0, "react/no-direct-mutation-state": 2, "react/no-find-dom-node": 2, "react/no-is-mounted": 0, "react/no-multi-comp": 0, "react/no-render-return-value": 2, "react/no-set-state": 0, "react/no-string-refs": 2, "react/no-unescaped-entities": 2, "react/no-unknown-property": 2, "react/no-unused-prop-types": 2, "react/prefer-es6-class": [ 0, "always" ], "react/prefer-stateless-function": [ 0, { "ignorePureComponents": false } ], "react/prop-types": 0, "react/react-in-jsx-scope": 2, "react/require-optimization": 0, "react/require-render-return": 2, "react/self-closing-comp": [ 2, { "component": true, "html": true } ], "react/sort-comp": 2, "react/sort-prop-types": [ 2, { "callbacksLast": true, "ignoreCase": true, "requiredFirst": true } ], "react/style-prop-object": 2, "react/jsx-boolean-value": [ 2, "always" ], "react/jsx-closing-bracket-location": [ 2, "tag-aligned" ], "react/jsx-curly-spacing": [ 0, "always", { "spacing": { "objectLiterals": "never" } } ], "react/jsx-equals-spacing": [ 2, "never" ], "react/jsx-filename-extension": 2, "react/jsx-first-prop-new-line": [ 0, "multiline" ], "react/jsx-handler-names": [ 2, { "eventHandlerPrefix": "handle", "eventHandlerPropPrefix": "on" } ], "react/jsx-indent": [ 2, 2 ], "react/jsx-indent-props": [ 2, 2 ], "react/jsx-key": 2, "react/jsx-max-props-per-line": 0, "react/jsx-no-bind": [ 2, { "ignoreRefs": true, "allowArrowFunctions": true, "allowBind": false } ], "react/jsx-no-comment-textnodes": 2, "react/jsx-no-duplicate-props": 2, "react/jsx-no-literals": 0, "react/jsx-no-target-blank": 2, "react/jsx-no-undef": 2, "react/jsx-pascal-case": [ 2, { "allowAllCaps": false } ], "react/jsx-sort-props": 0, "react/jsx-tag-spacing": 2, "react/jsx-uses-react": 2, "react/jsx-uses-vars": 2, "react/jsx-wrap-multilines": 2, "no-spaced-func": 2, "space-after-keywords": 0 }, "parserOptions": { "ecmaFeatures": { "globalReturn": false, "experimentalObjectRestSpread": true, "impliedStrict": false, "jsx": true }, "ecmaVersion": 2018, "sourceType": "module" }, "plugins": [ "extended", "mocha", "react", "json" ], "extends": "@swinfra/eslint-config-hpe-ee/client" } ```

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

import React from 'react';

class XXX extends React.Component {
  render() {
    return (
      <div>
        <div />
        <div />
      </div>
    );
  }
}

export default XXX;
 $ eslint x.jsx

What did you expect to happen?

not fail. the code/ indents look ok.

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

  8:9  error  Expected indentation of 10 space characters but found 8  react/jsx-indent
ljharb commented 6 years ago

This is on eslint 5; does it occur on eslint 4?

stheine commented 6 years ago

this started happening when I switched from eslint 4 to 5.

ArvinH commented 6 years ago

I have the same issue on eslint 4

Node Version: v10.5.0
npm Version: 6.1.0

standard@11.0.1
eslint@4.18.2
eslint-plugin-react@7.7.0
babel-eslint@8.2.5

I believe this is caused by the conflict between rule indent and rule react/jsx-indent https://github.com/yannickcr/eslint-plugin-react/issues/1679

ljharb commented 6 years ago

The indent rule has to be disabled for jsx nodes to be compatible with react/jsx-indent, fwiw.

nishantgeorge commented 5 years ago

The above code still fails the lint with indent turned off:

{
    "env": {
        "browser": true,
        "es6": true,
        "node": true
    },
    "extends": "eslint:recommended",
    "parser": "babel-eslint",
    "plugins": [
        "react"
    ],
    "parserOptions": {
        "ecmaVersion": 6,
        "sourceType": "module",
        "ecmaFeatures": {
          "jsx": true
        }
    },
    "rules": {
        "indent": ["off"],
        "react/jsx-indent": ["warn", 2]
    }
}

eslint version: 4.19.1 eslint-plugin-react version: 7.7.0

alexzherdev commented 5 years ago

I added a test case for the code in the issue description and it passed. I'm assuming this would be equivalent to having the indent rule turned off 🤔 Perhaps the issue has been fixed since 7.7.0?

ljharb commented 5 years ago

@alexzherdev could we add that test case in a PR to close this issue?

RLesser commented 5 years ago

This is still happening to me on v5.10.0

If I initially enter:

import { View } from 'react-native';

export default class xxx extends React.Component {
  render() {
    return (
      <View>
        <View />
        <View />
        <View />
        <View />
        <View />
      </View>
    );
  }
}

Then using --fix turns it into:

import React from 'react';
import { View } from 'react-native';

export default class xxx extends React.Component {
  render() {
    return (
      <View>
        <View />
          <View />
            <View />
              <View />
                <View />
      </View>
    );
  }
}

It also happened more traditional < > < /> format. This:

import React from 'react';
import { Text, View } from 'react-native';

export default class xxx extends React.Component {
  render() {
    return (
      <View>
        <Text>
          Test
        </Text>
        <Text>
          Test2
        </Text>
      </View>
    );
  }
}

was "fixed" to this:

import React from 'react';
import { Text, View } from 'react-native';

export default class xxx extends React.Component {
  render() {
    return (
      <View>
        <Text>
          Test
        </Text>
          <Text>
          Test2
          </Text>
      </View>
    );
  }
}

Any explanation as to why this might still be happening? Apologies if I'm missing something.

ljharb commented 5 years ago

@RLesser we’re up to v7.11 - try updating to the latest.

RLesser commented 5 years ago

@ljharb Thought I had done that before, but I think I had a local/global issue. Looks like it is fixed now for me - thanks!