@putout/plugin-apply-shorthand-properties
🐊Putout plugin adds ability to apply shorthand properties
Last updated 4 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-apply-shorthand-properties 
SYNC missed versions from official npm registry.

@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

Linter Rule Fix
???? Putout apply-shorthand-properties
ESLint no-useless-rename

License

MIT

Current Tags

  • 7.4.0                                ...           latest (4 months ago)

26 Versions

  • 7.4.0                                ...           4 months ago
  • 7.3.0                                ...           4 months ago
  • 7.2.0                                ...           5 months ago
  • 7.1.0                                ...           5 months ago
  • 7.0.0                                ...           5 months ago
  • 6.1.0                                ...           a year ago
  • 6.0.1                                ...           a year ago
  • 6.0.0                                ...           a year ago
  • 5.1.1                                ...           3 years ago
  • 5.1.0                                ...           3 years ago
  • 5.0.0                                ...           3 years ago
  • 4.0.0                                ...           3 years ago
  • 3.0.2                                ...           5 years ago
  • 3.0.1                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 2.0.1                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.6.0                                ...           6 years ago
  • 1.5.0                                ...           7 years ago
  • 1.4.0                                ...           7 years ago
  • 1.3.0                                ...           7 years ago
  • 1.2.0                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.2                                ...           7 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (0)
None
Dev Dependencies (8)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |