Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π Fix linter when using
dict({...spread})
(#32586)
My linting/formatting environment was not working for a particular file until I realized the linter failed when encountering it: ``` [09:23:26] TypeError in plugin "gulp-eslint" Message: Cannot read property 'raw' of undefined Occurred while linting file-abc.js:123 ``` This is caused by lint plugin `local/dict-string-keys` [ailing when using a spread operator inside `dict()`: https://astexplorer.net/#/gist/3a59548ab9a34ade0f6337b74a5c86db/e070cc191a26fa6e0358a2f5a20218fbb154176f ```js dict({...spreadOperatorBreaksLinter}); ``` We likely want to forbid this, which this change accomplishes. ```js // Found: idKeysAreNotOkay.The Object Literal Expression passed into `dict` must only contain string keyed properties. (at 2:7) dict({idKeysAreNotOkay: true}); // ------^ // Found: spreadOperatorIsNotOkay. The Object Literal Expression passed into `dict` must only contain string keyed properties. (at 5:7) dict({...spreadOperatorIsNotOkay}); // ------^ ```
- Loading branch information