JavaScript Code Style alignment

Hi all,

Is it possible to configure PhpStorm to align consecutive assignments and align key-value pairs in JavaScript and TypeScript like we can in php?

example:

var async    = require('async');
var cluster  = require('cluster');
var fs       = require('fs');
var mongoose = require('mongoose');
var nopt     = require('nopt');
var path     = require('path');
var config   = require('yaml-config');
var log4node = require('log4node');
var sprintf  = require('sprintf');
var https    = require('https');
var express  = require('express');
var moment   = require('moment');
var redis    = require('redis');
var url      = require('url');


instead of

var async = require('async');
var cluster = require('cluster');
var fs = require('fs');
var mongoose = require('mongoose');
var nopt = require('nopt');
var path = require('path');
var config = require('yaml-config');
var log4node = require('log4node');
var sprintf = require('sprintf');
var https = require('https');
var express = require('express');
var moment = require('moment');
var redis = require('redis');
var url = require('url');



This is particularly frustrating when reformatting an entire file as the alignment gets modified.

2 comments
Comment actions Permalink

Yep, that is the issue.  I added my vote to it.  Thanks.

0

Please sign in to leave a comment.