Skip to content
Permalink
Browse files
Docs: add an example Object.assign() for rule no-import-assign (#14916
)

* Docs: add an example `Object.assign()` for rule no-import-assign

* Update docs/rules/no-import-assign.md

Co-authored-by: Nitin Kumar <snitin315@gmail.com>

* Update docs/rules/no-import-assign.md

Co-authored-by: Nitin Kumar <snitin315@gmail.com>

Co-authored-by: Nitin Kumar <snitin315@gmail.com>
  • Loading branch information
aladdin-add and snitin315 committed Aug 12, 2021
1 parent af96584 commit 1f5d0889264c60dddb6fb07a3b1e43f840e84d57
Showing 1 changed file with 3 additions and 1 deletion.
@@ -16,8 +16,10 @@ import * as mod_ns from "./mod.mjs"
mod = 1 // ERROR: 'mod' is readonly.
named = 2 // ERROR: 'named' is readonly.
mod_ns.named = 3 // ERROR: the members of 'mod_ns' is readonly.
mod_ns.named = 3 // ERROR: The members of 'mod_ns' are readonly.
mod_ns = {} // ERROR: 'mod_ns' is readonly.
// Can't extend 'mod_ns'
Object.assign(mod_ns, { foo: "foo" }) // ERROR: The members of 'mod_ns' are readonly.
```

Examples of **correct** code for this rule:

0 comments on commit 1f5d088

Please sign in to comment.