Linter warning about object as default property

The two most common solutions I’ve seen are returning it from a “dummy” computed property or, cleaner and better IMO, wrapping it in Object.freeze() e.g.

providerValues: Object.freeze({ someprovider:'Some Provider',otherprovider:'Other Provider' })

This signals that it won’t be mutated at runtime, which follows the both the letter of the law and the spirit, as it were. Here’s another thread for more reading.

1 Like