Skip to content

Commit 6115cc2

Browse files
author
Kristján Oddsson
authored
guide plugin authors away from mutating the root object
1 parent edca3cf commit 6115cc2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

_guides/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,14 @@ When creating a Chai plugin, it's possible to expose globals that can be used ac
3333

3434
#### Good Practice
3535

36-
Expose any global returned in the `chai.use()` in the module record as well, so it can be imported directly:
36+
Prefer exporting any global in the module record so it can be imported directly instead of adding it as a property in the chai object:
3737

3838
```javascript
3939
// An example of a good plugin:
4040

4141
export const myGlobal = {...};
4242

4343
export default function myPlugin(chai, utils) {
44-
chai.myGlobal = myGlobal;
4544
}
4645
```
4746

0 commit comments

Comments
 (0)