Skip to content

Commit 0ebcfc7

Browse files
authored
fix: add missing 'use strict'; directives (#5722)
* fix: add missing `'use strict';` directives `'use strict';` is 15 years old, it's time we catch up :) Commit created via ```sh for f in $( git ls-files | grep '.js$' ); do grep -q 'use strict' "$f" || \ ( head -n5 "$f" | grep -Eq '(im|ex)port ' ) || \ ( \ (( head -n1 "$f" | grep -q '#!' ) && \ ( cat "$f" | sed -e '/#!/s/$/\n'"'use strict';"'/' ) || \ ( echo "'use strict';" && cat "$f" ) ) > "${f}~" && \ mv -v "${f}~" "$f" && \ rm -f "${f}~") ; done ; npm run bootstrap && (cd packages/bson-transpilers && npm run compile) ``` * fixup: add missing use strict to create-workspace.js * fixup: account for clashes with legacy linting rules in bson-transpilers and hadron-build
1 parent 91bd2c5 commit 0ebcfc7

File tree

262 files changed

+289
-35
lines changed

Some content is hidden

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

262 files changed

+289
-35
lines changed

configs/eslint-plugin-compass/.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12
module.exports = {
23
root: true,
34
extends: ['@mongodb-js/eslint-config-compass'],

configs/eslint-plugin-compass/.mocharc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12
module.exports = {
23
...require('@mongodb-js/mocha-config-compass'),
34
spec: ['rules/**/*.test.js'],

configs/eslint-plugin-compass/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12
module.exports = {
23
rules: {
34
'no-leafygreen-outside-compass-components': require('./rules/no-leafygreen-outside-compass-components'),

configs/eslint-plugin-compass/rules/no-leafygreen-outside-compass-components.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12
const path = require('path');
23

34
/**

configs/eslint-plugin-compass/rules/no-leafygreen-outside-compass-components.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12
const { RuleTester } = require('eslint');
23
const path = require('path');
34
const rule = require('./no-leafygreen-outside-compass-components');

configs/eslint-plugin-compass/rules/unique-mongodb-log-id.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12
const path = require('path');
23
const { spawnSync } = require('child_process');
34

configs/eslint-plugin-compass/rules/unique-mongodb-log-id.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12
const { RuleTester } = require('eslint');
23
const path = require('path');
34
const rule = require('./unique-mongodb-log-id');

configs/eslint-plugin-compass/test/__fixtures__/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12
/* eslint-disable @mongodb-js/compass/unique-mongodb-log-id */
23
/* global mongoLogId */
34
mongoLogId(1);

configs/mocha-config-compass/register/compass-preferences-register.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12
let setupPreferencesPromise;
23

34
module.exports = {

configs/mocha-config-compass/register/jsdom-extra-mocks-register.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12
// Not implemented in jsdom
23
if (!window.matchMedia) {
34
window.matchMedia = globalThis.matchMedia = (media) => {

0 commit comments

Comments
 (0)