Skip to content

Commit

Permalink
fix: add missing strict mode directives (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Jul 8, 2023
1 parent 5bbe764 commit f3aa8ac
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

module.exports = {
env: {
es2019: true,
Expand Down Expand Up @@ -34,6 +36,8 @@ module.exports = {
],
parserOptions: {
ecmaVersion: 2019,
// Explicitly tell ESLint to parse JavaScript as CommonJS, as airbnb-base sets this to "modules" for ECMAScript
sourceType: "script",
},
plugins: [
"import",
Expand All @@ -53,5 +57,6 @@ module.exports = {
"promise/prefer-await-to-callbacks": "warn",
"promise/prefer-await-to-then": "warn",
"security/detect-object-injection": "off",
strict: ["error", "global"],
},
};
2 changes: 2 additions & 0 deletions scripts/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

module.exports = {
rules: {
"import/no-extraneous-dependencies": [
Expand Down
3 changes: 3 additions & 0 deletions scripts/license-checker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* eslint-disable security/detect-object-injection */
/* eslint-disable security-node/detect-crlf */

"use strict";

const checker = require("license-checker");
const copyLeftLicenses = require("spdx-copyleft");
const { promisify } = require("util");
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

const fs = require("fs/promises");
const path = require("upath");
const semver = require("semver");
Expand Down
3 changes: 3 additions & 0 deletions src/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* eslint-disable jest/no-conditional-expect */
/* eslint-disable security/detect-non-literal-fs-filename */

"use strict";

const isHtml = require("is-html");
const path = require("upath");
const semver = require("semver");
Expand Down
2 changes: 2 additions & 0 deletions test_resources/utils/btPowerSet.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable security/detect-object-injection */

"use strict";

/**
* @description Bitwise power-set function, adapted from algorithm at
* https://github.com/trekhleb/javascript-algorithms/blob/master/src/algorithms/sets/power-set/btPowerSet.js
Expand Down
2 changes: 2 additions & 0 deletions test_resources/utils/genCombos.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

const btPowerSetRecursive = require("./btPowerSet");

/**
Expand Down

0 comments on commit f3aa8ac

Please sign in to comment.