79647286

Date: 2025-06-01 07:16:34
Score: 1
Natty:
Report link

Here is the tool and approaches that can help:

ESLint + plugin or manual rules While ESLint is mainly for linting, some plugins can help with alignment, like:

eslint-plugin-align-assignments This plugin aligns = and : in variable declarations and object literals.

Install:

npm install --save-dev eslint eslint-plugin-align-assignments

Add to your .eslintrc.js:

module.exports = {
  plugins: ['align-assignments'],
  rules: {
    'align-assignments/align-assignments': ['error', { requiresOnly: false }],
  },
};

Then run:

npx eslint --fix yourfile.js
Reasons:
  • Blacklisted phrase (1): This plugin
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Mazin Ali