@putout/plugin-apply-dot-notation
Version:
πPutout plugin applies dot notation
52 lines (36 loc) β’ 1.54 kB
Markdown
# @putout/plugin-apply-dot-notation [![NPM version][NPMIMGURL]][NPMURL]
[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-dot-notation.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-dot-notation "npm"
π[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to apply dot notation. Checkout out in π[**Putout Editor**](https://putout.cloudcmd.io/#/gist/d0702a7f5765c0f26788be18296eefca/a33f4501ce1e6018e6bb1b52ae0f554cb4483a05).
> Property accessors provide access to an object's properties by using the dot notation or the bracket notation.
>
> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors)
## Install
```
npm i @putout/plugin-apply-dot-notation
```
## Rule
```json
{
"rules": {
"apply-dot-notation": "on"
}
}
```
## β Example of incorrect code
```js
a.hello['world'];
```
## β
Example of correct code
```js
a.hello.world;
a[1];
```
## Comparison
Linter | Rule | Fix
--------|-------|------------|
π **Putout** | [`apply-dot-notation`](https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-dot-notation#readme) | β
β£ **ESLint** | [`dot-notation`](https://eslint.org/docs/latest/rules/dot-notation) | β
π **Blog** | [`Converting-Bracket-Notation-Dot-Notation`](https://steakenthusiast.github.io/2022/05/28/Deobfuscating-Javascript-via-AST-Manipulation-Converting-Bracket-Notation-Dot-Notation-for-Property-Accessors/) | β
## License
MIT