File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,11 @@ rules:
1414 strict :
1515 - error
1616 - safe
17+ # disallow Object.assign
18+ no-restricted-properties :
19+ - error
20+ - object : ' Object'
21+ property : ' assign'
1722overrides :
1823 - files :
1924 - scripts/**/*.js
@@ -31,6 +36,11 @@ overrides:
3136 ecmaVersion : 2018
3237 env :
3338 browser : false
39+ rules :
40+ no-restricted-properties :
41+ - off
42+ - object : ' Object'
43+ property : ' assign'
3444 - files :
3545 - esm-utils.js
3646 parserOptions :
@@ -79,7 +89,6 @@ overrides:
7989 # disallow property access of `global.<timer>.*`
8090 - selector : ' *[object.object.name=global][object.property.name=/(Date|(set|clear)(Timeout|Immediate|Interval))/]:expression'
8191 message : *GH-237
82-
8392 - files :
8493 - test/**/*.mjs
8594 parserOptions :
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ describe('Mocha', function() {
5252 reporterInstance = { } ;
5353 opts = { reporter : sandbox . stub ( ) . returns ( reporterInstance ) } ;
5454 Base = sandbox . stub ( ) . returns ( { } ) ;
55- runner = Object . assign ( sandbox . createStubInstance ( EventEmitter ) , {
55+ runner = utils . assign ( sandbox . createStubInstance ( EventEmitter ) , {
5656 run : sandbox
5757 . stub ( )
5858 . callsArgAsync ( 0 )
@@ -65,7 +65,7 @@ describe('Mocha', function() {
6565 // the Runner constructor is the main export, and constants is a static prop.
6666 // we don't need the constants themselves, but the object cannot be undefined
6767 Runner . constants = { } ;
68- suite = Object . assign ( sandbox . createStubInstance ( EventEmitter ) , {
68+ suite = utils . assign ( sandbox . createStubInstance ( EventEmitter ) , {
6969 slow : sandbox . stub ( ) ,
7070 timeout : sandbox . stub ( ) ,
7171 bail : sandbox . stub ( ) ,
@@ -713,8 +713,6 @@ describe('Mocha', function() {
713713 } ) ;
714714
715715 describe ( 'when a run has finished and is called again' , function ( ) {
716- var mocha ;
717-
718716 beforeEach ( function ( done ) {
719717 mocha . run ( function ( ) {
720718 runner . run . reset ( ) ;
@@ -748,8 +746,6 @@ describe('Mocha', function() {
748746 } ) ;
749747
750748 describe ( 'when Mocha configured for multiple runs and multiple runs are attempted' , function ( ) {
751- var mocha ;
752-
753749 beforeEach ( function ( ) {
754750 mocha . cleanReferencesAfterRun ( false ) ;
755751 } ) ;
You can’t perform that action at this time.
0 commit comments