Skip to content

Commit ff0e327

Browse files
authored
Add strict mode directive (#1003)
1 parent 4389040 commit ff0e327

Some content is hidden

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

57 files changed

+122
-0
lines changed

.eslintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
"mocha": true,
88
"worker": true
99
},
10+
"parserOptions": {
11+
// airbnb-base sets this to "modules" for ESM but CJS is being used
12+
"sourceType": "script"
13+
},
1014
"rules": {
15+
"strict": ["error", "global"],
1116
"no-underscore-dangle": 0,
1217
"no-console": 0,
1318
"global-require": 0,

benchmarks/node/memory-benchmark.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env node
22

3+
'use strict';
4+
35
// Note: getting replicable results from this script requires:
46
// (1) Running with the `--expose-gc` flag,
57
// (2) adding `global.gc()` within the `index.js` file

benchmarks/node/speed-benchmark.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env node
2+
3+
'use strict';
4+
25
const path = require('path');
36
const { createWorker } = require('../..');
47

examples/node/download-pdf.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env node
2+
3+
'use strict';
4+
25
const path = require('path');
36
const fs = require('fs');
47
const { createWorker } = require('../..');

examples/node/image-processing.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env node
2+
3+
'use strict';
4+
25
const path = require('path');
36
const fs = require('fs');
47
const { createWorker } = require('../..');

examples/node/recognize.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env node
2+
3+
'use strict';
4+
25
const path = require('path');
36
const { createWorker } = require('../..');
47

examples/node/scheduler.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 path = require('path');
24
const { createWorker, createScheduler } = require('../..');
35

scripts/server.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 webpack = require('webpack');
24
const middleware = require('webpack-dev-middleware');
35
const express = require('express');

scripts/test-helper.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 constants = require('../tests/constants');
24
global.expect = require('expect.js');
35
global.fs = require('fs');

scripts/webpack.config.common.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
resolve: {
35
fallback: {

0 commit comments

Comments
 (0)