Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

"Indent" rule throws false positives for object under ternary. #452

Closed
phyllisstein opened this issue Mar 23, 2018 · 3 comments
Closed

"Indent" rule throws false positives for object under ternary. #452

phyllisstein opened this issue Mar 23, 2018 · 3 comments

Comments

@phyllisstein
Copy link

What version of TypeScript are you using?

v2.8.0-rc

What version of typescript-eslint-parser are you using?

v14.0.0

What code were you trying to parse?

const firebaseApp = firebase.apps.length
  ? firebase.app()
  : firebase.initializeApp({
      apiKey: __FIREBASE_API_KEY__,
      authDomain: __FIREBASE_AUTH_DOMAIN__,
      databaseURL: __FIREBASE_DATABASE_URL__,
      projectId: __FIREBASE_PROJECT_ID__,
      storageBucket: __FIREBASE_STORAGE_BUCKET__,
      messagingSenderId: __FIREBASE_MESSAGING_SENDER_ID__,
    })

What did you expect to happen?

ESLint should not flag the object as incorrectly indented (cf. results from the standard ESLint parser).

What happened?

ESLint w/ typescript-eslint-parser flagged the object as incorrectly indented:

warning: Expected indentation of 6 spaces but found 8 (indent) at src/app/flux/lib/configure-store.ts:38:1:
  36 |     ? firebase.app()
  37 |     : firebase.initializeApp({
> 38 |         apiKey: __FIREBASE_API_KEY__,
     | ^
  39 |         authDomain: __FIREBASE_AUTH_DOMAIN__,
  40 |         databaseURL: __FIREBASE_DATABASE_URL__,
  41 |         projectId: __FIREBASE_PROJECT_ID__,
@phyllisstein
Copy link
Author

👋 Any chance one of the maintainers could take a look at this one?

@armano2
Copy link
Contributor

armano2 commented Nov 28, 2018

issue is no longer present in v21.0.1

@phyllisstein
Copy link
Author

💖Thanks for the update! I'll go ahead and close this guy.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants