Skip to content

Prettier v1.11.1 is mixing spaces and tabs for alignment #4199

@kiruh

Description

@kiruh

Prettier 1.11.1
Playground link

# Options
--use-tabs
--tab-width 4

Input:

const store = useLoggerAndDevTools
	? createStore(
			reducer,
			logRedux
				? compose(applyMiddleware(createLogger(), thunk))
				: compose(applyMiddleware(thunk))
>		)
	: createStore(reducer, applyMiddleware(thunk));

Output:

const store = useLoggerAndDevTools
	? createStore(
			reducer,
			logRedux
				? compose(applyMiddleware(createLogger(), thunk))
				: compose(applyMiddleware(thunk))
>	  )
	: createStore(reducer, applyMiddleware(thunk));

Expected behaviour (as it were in v1.10.2):

const store = useLoggerAndDevTools
	? createStore(
			reducer,
			logRedux
				? compose(applyMiddleware(createLogger(), thunk))
				: compose(applyMiddleware(thunk))
>		)
	: createStore(reducer, applyMiddleware(thunk));

v1.11.1 is mixing tabs and spaces as shown in output. ESLint is throwing an exception no-mixed-spaces-and-tabs.

Is it a bug? If not maybe there should be an option for mixing spaces and tabs for alignment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:javascriptIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.type:questionQuestions and support requests. Please use Stack Overflow for them, not the issue tracker.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions