tslint-eslint-rules icon indicating copy to clipboard operation
tslint-eslint-rules copied to clipboard

ter-indent does not work for TypeScript .tsx files

Open mattnedrich opened this issue 7 years ago • 5 comments

The ter-indent indentation rules do not seem to work for my the jsx code in my .tsx files. Has anyone else run into this issue? Is it not supposed to work for jsx code? If so, should I use something like tslint-react to get the functionality I'm looking for?

mattnedrich avatar Apr 03 '17 19:04 mattnedrich

Can you give a simple example where this is failing? The code is trying to emulate the eslint rule and I think they cover support for jsx code. At the moment, the rule is a bit behind and it is in need of being updated.

jmlopez-rod avatar Apr 03 '17 21:04 jmlopez-rod

It seems to be failing for something simple like this:

class MyApp extends React.Component<any, any> {
  const normalIndentVar = 5;
    const extraIntentVar = 6;
  public render() {
    return (
      <div>
        <NormalIndentComponent />
          <ExtraIndentComponent />
      </div>
    )
  }
}

export default MyApp;

Assuming ter-indent is set for 2 space indentation, it will flag the const extraIndentVar as being indented too much, but not the <ExtraIndentComponent />.

mattnedrich avatar Apr 04 '17 13:04 mattnedrich

Have the same issue :(

L0stSoul avatar Aug 31 '18 08:08 L0stSoul

Same issue

ycjcl868 avatar Jan 11 '19 08:01 ycjcl868

Same problem... Any updates?

tommyjs007 avatar Nov 06 '19 07:11 tommyjs007