Skip to content

Commit 34ffd5e

Browse files
authored
chore: disallow eqeqeq and console statements in lint rules MONGOSH-1505 (#125)
disallow eqeqeq and console statements in lint rules
1 parent 9c83d01 commit 34ffd5e

File tree

16 files changed

+31
-1
lines changed

16 files changed

+31
-1
lines changed

configs/eslint-config-devtools/common.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
'use strict';
22

3+
const jsRules = {
4+
eqeqeq: 'error',
5+
'no-console': 'error',
6+
};
7+
8+
const jsxRules = {
9+
...jsRules,
10+
};
11+
312
const tsRules = {
13+
...jsRules,
414
'@typescript-eslint/no-unused-vars': 'error',
515
'@typescript-eslint/no-unsafe-assignment': 'off',
616
'@typescript-eslint/no-unsafe-call': 'off',
@@ -19,6 +29,7 @@ const tsxRules = {
1929
};
2030

2131
const testRules = {
32+
...jsRules,
2233
'mocha/no-exclusive-tests': 'error',
2334
'mocha/no-hooks-for-single-case': 'off',
2435
'mocha/no-setup-in-describe': 'off',
@@ -74,13 +85,15 @@ const jsOverrides = {
7485
...jsParserOptions,
7586
env: { node: true, es6: true },
7687
extends: [...jsConfigurations],
88+
rules: { ...jsRules },
7789
};
7890

7991
const jsxOverrides = {
8092
files: ['**/*.jsx'],
8193
...jsParserOptions,
8294
env: { node: true, browser: true, es6: true },
8395
extends: [...jsConfigurations, ...reactConfigurations],
96+
rules: { ...jsxRules },
8497
};
8598

8699
const tsOverrides = {
@@ -114,6 +127,8 @@ const testOverrides = {
114127
};
115128

116129
module.exports = {
130+
jsRules,
131+
jsxRules,
117132
tsRules,
118133
tsxRules,
119134
testRules,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"bump-packages": "bump-monorepo-packages",
2424
"check-ci": "lerna run check",
2525
"check": "lerna run check --stream",
26+
"lint": "lerna run lint --stream",
2627
"compile-changed": "lerna run compile --stream --since origin/HEAD",
2728
"create-workspace": "node ./scripts/src/create-workspace.js",
2829
"depalign": "depalign",

packages/mongodb-downloader/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
import fetch from 'node-fetch';
23
import tar from 'tar';
34
import { promisify } from 'util';

packages/mongodb-runner/src/cli.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
import yargs from 'yargs';
23
import { MongoCluster } from './mongocluster';
34
import os from 'os';

packages/monorepo-tools/src/bump-packages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
import childProcess from 'child_process';
23
import { promises as fs } from 'fs';
34
// @ts-expect-error No definitions available

packages/monorepo-tools/src/depalign.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#! /usr/bin/env node
2+
/* eslint-disable no-console */
23

34
import path from 'path';
45
import { promises as fs } from 'fs';
@@ -56,7 +57,7 @@ async function main(args: ParsedArgs) {
5657
}
5758

5859
const depalignrcPath =
59-
typeof args.config == 'string'
60+
typeof args.config === 'string'
6061
? path.resolve(process.cwd(), args.config)
6162
: path.join(process.cwd(), '.depalignrc.json');
6263

packages/monorepo-tools/src/precommit.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#! /usr/bin/env node
2+
/* eslint-disable no-console */
23

34
import path from 'path';
45
import pkgUp from 'pkg-up';

packages/monorepo-tools/src/utils/bump-packages.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ describe('bump-packages', function () {
7474
};
7575

7676
const runBumpVersion = () => {
77+
// eslint-disable-next-line no-console
7778
console.log('runBumpVersion');
7879
const { status } = childProcess.spawnSync(
7980
'node',

packages/monorepo-tools/src/where.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#! /usr/bin/env node
2+
/* eslint-disable no-console */
23

34
/**
45
* Usage:

packages/oidc-mock-provider/bin/oidc-mock-provider.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env node
2+
/* eslint-disable no-console */
23
'use strict';
34

45
const { OIDCMockProvider } = require('..');

0 commit comments

Comments
 (0)