Skip to content

Commit fcafb61

Browse files
authored
fix: add missing 'use strict' directives (#780)
<!-- What / Why --> <!-- Describe the request in detail. What it does and why it's being changed. --> Adds missing `'use strict'` directives; this directive is dotted around a handful of files in the repo so this PR adds it to the rest of the CJS files. The local eslint file has been updated to enforce this going forward, as suggested in the linked issue. ## References Closes #774 <!-- Examples: Related to #0 Depends on #0 Blocked by #0 Fixes #0 Closes #0 -->
1 parent c760403 commit fcafb61

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+236
-0
lines changed

.eslintrc.local.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = {
1212
},
1313
],
1414
'import/no-nodejs-modules': ['error'],
15+
strict: ['error', 'global'],
1516
},
1617
},
1718
],

benchmarks/bench-compare.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const Benchmark = require('benchmark')
24
const SemVer = require('../classes/semver')
35
const suite = new Benchmark.Suite()

benchmarks/bench-diff.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const Benchmark = require('benchmark')
24
const diff = require('../functions/diff')
35
const suite = new Benchmark.Suite()

benchmarks/bench-parse-options.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const Benchmark = require('benchmark')
24
const parseOptions = require('../internal/parse-options')
35
const suite = new Benchmark.Suite()

benchmarks/bench-parse.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const Benchmark = require('benchmark')
24
const parse = require('../functions/parse')
35
const { MAX_SAFE_INTEGER } = require('../internal/constants')

benchmarks/bench-satisfies.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const Benchmark = require('benchmark')
24
const satisfies = require('../functions/satisfies')
35
const suite = new Benchmark.Suite()

benchmarks/bench-subset.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const Benchmark = require('benchmark')
24
const subset = require('../ranges/subset')
35
const suite = new Benchmark.Suite()

bin/semver.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// Exits successfully and prints matching version(s) if
44
// any supplied version is valid and passes all tests.
55

6+
'use strict'
7+
68
const argv = process.argv.slice(2)
79

810
let versions = []

classes/comparator.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const ANY = Symbol('SemVer ANY')
24
// hoisted class for cyclic dependency
35
class Comparator {

classes/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
module.exports = {
24
SemVer: require('./semver.js'),
35
Range: require('./range.js'),

0 commit comments

Comments
 (0)