This function was changed to static as part of a linting pass. We should be checking that we are not changing overrides to static, however, because in this case it caused this update() override to never run. The change to static has been reversed. In order to avoid the linter error "do not mutate function properties" we create a clone of the data object property.
This function also returned undefined for all of its conditionals, because (new)data.system doesn't exist. The data object's children are flattened into string-keys like this:
I switched to this new way of accessing them.
Finally, the linter is complaining about re-using duplicate string literals. This makes no sense in this context, and indeed it should not be triggering because string literals used as object keys are an exception in the SonarSouce/no-duplicate-string rule https://github.com/SonarSource/eslint-plugin-sonarjs/issues/107
Fixes #460
This function was changed to static as part of a linting pass. We should be checking that we are not changing overrides to static, however, because in this case it caused this
update()
override to never run. The change to static has been reversed. In order to avoid the linter error "do not mutate function properties" we create a clone of the data object property.This function also returned undefined for all of its conditionals, because (new)
data.system
doesn't exist. The data object's children are flattened into string-keys like this:I switched to this new way of accessing them.
Finally, the linter is complaining about re-using duplicate string literals. This makes no sense in this context, and indeed it should not be triggering because string literals used as object keys are an exception in the SonarSouce/no-duplicate-string rule https://github.com/SonarSource/eslint-plugin-sonarjs/issues/107