🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@putout/plugin-apply-shorthand-properties

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/plugin-apply-shorthand-properties

🐊Putout plugin adds ability to apply shorthand properties

Source
npmnpm
Version
7.1.0
Version published
Maintainers
1
Created
Source

@putout/plugin-apply-shorthand-properties NPM version

🐊Putout plugin adds ability to apply shorthand properties.

Install

npm i @putout/plugin-apply-shorthand-properties -D

Config

{
    "rules": {
        "apply-shorthand-properties": ["on", {
            "ignore": [],
            "rename": false
        }]
    },
    "plugins": [
        "apply-shorthand-properties"
    ]
}

With default options

āŒ Example of incorrect code

import {'b' as b} from 'b';

const {a: a} = b;

āœ… Example of correct code

import {b} from 'b';

const {a} = b;

When rename enabled

āŒ Example of incorrect code

const AUTH_SESSION = 'xx';

export const setSession = (session) => ({
    type: AUTH_SESSION,
    payload: session,
});

āœ… Example of correct code

const type = 'xx';

export const setSession = (payload) => ({
    type,
    payload,
});

Comparison

LinterRuleFix
🐊 Putoutapply-shorthand-propertiesāœ…
ā£ ESLintno-useless-renameāŒ

License

MIT

Keywords

putout

FAQs

Package last updated on 23 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts