'Align indentation to the equal sign

I want to align the indentation to the equal sign when formatting my code. Is there any plugin or setup out there?

Before:

const React = require('react');
const MainContainer = require('../../components/container/main');
const HasAnyRole = require('../../components/auth/has-any-role');

After:

const React         = require('react');
const MainContainer = require('../../components/container/main');
const HasAnyRole    = require('../../components/auth/has-any-role');


Solution 1:[1]

This feature is implemented in different IDE in different ways.

If you use SublimeText you can try this plugin: AlignTab

Jetbrains IDE documentation:

Settings | Code Style | Javascript | Variable declarations | Align | When multiline

Then

Code | Reformat code

Solution 2:[2]

depends on your IDE, IntelliJ has a setting for that

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 zxdx
Solution 2 Lefthandmedia