diff --git a/.eslintrc.json b/.eslintrc.json index 5bf26f704a..ed461686df 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -183,7 +183,7 @@ "operator-linebreak": [2, "after"], "padded-blocks": [2, "never"], "prefer-destructuring": 0, - "prefer-reflect": [2, { "exceptions": ["delete"] }], + "prefer-reflect": [2, { "exceptions": ["defineProperty", "getOwnPropertyDescriptor", "getPrototypeOf", "setPrototypeOf", "isExtensible", "getOwnPropertyNames", "preventExtensions", "delete"] }], "quote-props": [2, "as-needed"], "quotes": [2, "single"], "require-jsdoc": 0, diff --git a/lib/utils/object.js b/lib/utils/object.js index 67bc1253bc..1e56495a04 100644 --- a/lib/utils/object.js +++ b/lib/utils/object.js @@ -25,7 +25,7 @@ export function mapScalarToObject(option: { fields: Fiel const object = {}; option.fields.forEach((field, index) => { - Reflect.defineProperty(object, field.key, { + Object.defineProperty(object, field.key, { get: () => value[index], set: v => (value[index] = v), });