atom-aligner icon indicating copy to clipboard operation
atom-aligner copied to clipboard

Aligning React Props

Open simonlast opened this issue 9 years ago • 6 comments

This used to work, but it recently broke for some reason:

Before:

<TableRow
    store = {store}
    columns = {columns} />

After:

<TableRow
    store   = {store}
    columns = {columns} />

simonlast avatar Oct 07 '15 19:10 simonlast

Thanks for reporting this @simonlast.

I'm not sure if this used to work since there hasn't been many changes to language-html recently. Let me send in a PR to language-html so aligner can align this correctly.

adrianlee44 avatar Oct 09 '15 07:10 adrianlee44

Is this code in a jsx file?

adrianlee44 avatar Oct 09 '15 07:10 adrianlee44

Any movement on this? I'm happy to look into it. @adrianlee44 Yes, in JSX files.

ambethia avatar Feb 18 '16 17:02 ambethia

@ambethia which language package are you using for jsx?

adrianlee44 avatar Feb 22 '16 01:02 adrianlee44

@adrianlee44 https://atom.io/packages/react

Is there another package that would work with atom-aligner?

ambethia avatar Feb 22 '16 17:02 ambethia

I'm not sure if there is another package that would work with atom-aligner but the issue with react package is that it doesn't parse the = character.

Based on this line, https://github.com/orktes/atom-react/blob/master/grammars/JavaScript%20(JSX).cson#L47, you can see that it includes 4 patterns, the attribute name, double quote, single quote and code.

None of these patterns include the = character and parse it into an assignment token.

adrianlee44 avatar Mar 17 '16 06:03 adrianlee44