From d9d1bb2b07750f3b2f2a9f8fa3d7aa1a5ec5038e Mon Sep 17 00:00:00 2001 From: Jackson Ray Hamilton Date: Sun, 24 Mar 2019 10:05:28 -0700 Subject: Rename tests to use the “.jsx” file extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test/manual/indent/js-jsx-quote.js: Renamed to “jsx-quote.jsx”. * test/manual/indent/js-jsx-unclosed-1.js: Renamed to “jsx-unclosed-1.jsx”. * test/manual/indent/js-jsx-unclosed-2.js: Renamed to “jsx-unclosed-2.jsx”. * test/manual/indent/js-jsx.js: Renamed to “jsx.jsx”. * test/manual/indent/jsx-quote.jsx: Renamed from “js-jsx-quote.js”. * test/manual/indent/jsx-unclosed-1.jsx: Renamed from “js-jsx-unclosed-1.js”. * test/manual/indent/jsx-unclosed-2.jsx: Renamed from “js-jsx-unclosed-2.js”. * test/manual/indent/jsx.jsx: Renamed from “js-jsx.js”. --- test/manual/indent/js-jsx.js | 265 ------------------------------------------- 1 file changed, 265 deletions(-) delete mode 100644 test/manual/indent/js-jsx.js (limited to 'test/manual/indent/js-jsx.js') diff --git a/test/manual/indent/js-jsx.js b/test/manual/indent/js-jsx.js deleted file mode 100644 index 2ec00c63bbd..00000000000 --- a/test/manual/indent/js-jsx.js +++ /dev/null @@ -1,265 +0,0 @@ -// -*- mode: js-jsx; -*- - -var foo =
; - -return ( -
-
-
-
-
-
-
-
-); - -React.render( -
-
-
, - { - a: 1 - }, -
-
-
-); - -return ( - // Sneaky! -
-); - -return ( -
- // Sneaky! -); - -React.render( - , - { - a: 1 - } -); - -return ( -
- {array.map(function () { - return { - a: 1 - }; - })} -
-); - -return ( -
-
-); - -// Indent void expressions (no need for contextual parens / commas) -// (https://github.com/mooz/js2-mode/issues/140#issuecomment-166250016). -
-

Title

- {array.map(() => { - return ; - })} - {message} -
-// Another example of above issue -// (https://github.com/mooz/js2-mode/issues/490). - -
- {variable1} - -
-
- -// Comments and arrows can break indentation (Bug#24896 / -// https://github.com/mooz/js2-mode/issues/389). -const Component = props => ( - c} - b={123}> - -); -const Component = props => ( - - -); -const Component = props => ( // Parse this comment, please. - c} - b={123}> - -); -const Component = props => ( // Parse this comment, please. - - -); -// Another example of above issue (Bug#30225). -class { - render() { - return ( - - ); - } -} - -// JSX attributes of an arrow function’s expression body’s JSX -// expression should be indented with respect to the JSX opening -// element (Bug#26001 / -// https://github.com/mooz/js2-mode/issues/389#issuecomment-271869380). -class { - render() { - const messages = this.state.messages.map( - message => - ); return messages; - } - render() { - const messages = this.state.messages.map(message => - - ); return messages; - } -} - -// Users expect tag closers to align with the tag’s start; this is the -// style used in the React docs, so it should be the default. -// - https://github.com/mooz/js2-mode/issues/389#issuecomment-390766873 -// - https://github.com/mooz/js2-mode/issues/482 -// - Bug#32158 -const foo = (props) => ( -
- i} - /> - -
-); - -// Embedded JSX in parens breaks indentation -// (https://github.com/mooz/js2-mode/issues/411). -let a = ( -
- {condition && } - {condition && } -
-
-) -let b = ( -
- {condition && ()} -
-
-) -let c = ( -
- {condition && ()} - {condition && "something"} -
-) -let d = ( -
- {()} - {condition && "something"} -
-) -// Another example of the above issue (Bug#27000). -function testA() { - return ( -
-
{ (
) }
-
- ); -} -function testB() { - return ( -
-
{
}
-
- ); -} -// Another example of the above issue -// (https://github.com/mooz/js2-mode/issues/451). -class Classy extends React.Component { - render () { - return ( -
-
    - { this.state.list.map((item) => { - return (
    ) - })} -
-
- ) - } -} - -// Self-closing tags should be indented properly -// (https://github.com/mooz/js2-mode/issues/459). -export default ({ stars }) => ( -
-
- Congratulations! -
-
- 0)} size='large' /> -
- 1)} size='small' /> - 2)} size='small' /> -
-
-
- You have created 1 reminder -
-
-) - -// JS expressions should not break indentation -// (https://github.com/mooz/js2-mode/issues/462). -// -// In the referenced issue, the user actually wanted indentation which -// was simply different than Emacs’ SGML attribute indentation. -// Nevertheless, his issue highlighted our inability to properly -// indent code with JSX inside JSXExpressionContainers inside JSX. -return ( - - - ( -
nothing
- )} /> - -
-
-) - -// Local Variables: -// indent-tabs-mode: nil -// js-indent-level: 2 -// End: -- cgit v1.2.3