Skip to content

Commit d4089da

Browse files
authored
chore(lint): use devtools shared lint, fix errors VSCODE-723 (#1206)
1 parent b4f7003 commit d4089da

File tree

88 files changed

+2355
-1661
lines changed

Some content is hidden

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

88 files changed

+2355
-1661
lines changed

.depcheckrc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
ignores:
2-
- "@mongodb-js/prettier-config-devtools"
32
- "@types/jest"
43
- "buffer"
5-
- "eslint-config-mongodb-js"
64
- "mocha-junit-reporter"
75
- "mocha-multi"
86
- "mongodb-client-encryption"

.eslintrc.js

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,22 @@ const ruleOverridesForJs = Object.keys(
99
);
1010

1111
const sharedRules = {
12-
indent: 0,
13-
'brace-style': 0,
14-
'chai-friendly/no-unused-expressions': 0,
12+
// TODO(VSCODE-724): Update our file naming and enable this rule.
13+
// We have a lot of files that do not match the filename rules.
14+
'filename-rules/match': 0,
1515
'mocha/no-exclusive-tests': 2,
16-
'no-cond-assign': [2, 'except-parens'],
1716
'no-console': [1, { allow: ['warn', 'error', 'info'] }],
18-
'no-empty-function': 0,
19-
'no-shadow': 0,
20-
'no-use-before-define': 0,
21-
'object-curly-spacing': [2, 'always'],
22-
'react/sort-comp': 0, // Does not seem work as expected with TypeScript.
23-
'restrict-template-expressions': 0,
24-
'space-before-function-paren': 0,
25-
'valid-jsdoc': 0,
2617
};
2718

2819
module.exports = {
2920
plugins: ['mocha', '@typescript-eslint'],
30-
parser: '@typescript-eslint/parser', // Specifies the ESLint parser.
31-
parserOptions: {
32-
ecmaVersion: 2018,
33-
sourceType: 'module',
34-
},
35-
extends: [
36-
'eslint-config-mongodb-js/react',
37-
'plugin:@typescript-eslint/eslint-recommended',
38-
'plugin:@typescript-eslint/recommended',
39-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
40-
],
21+
extends: ['@mongodb-js/eslint-config-devtools'],
4122
overrides: [
4223
{
4324
files: ['*.ts', '*.tsx'],
4425
rules: {
4526
...sharedRules,
46-
semi: 0,
47-
'@typescript-eslint/no-empty-function': 0,
48-
'@typescript-eslint/no-use-before-define': 0,
4927
'@typescript-eslint/no-explicit-any': 0,
50-
'@typescript-eslint/no-unused-vars': 2,
51-
'@typescript-eslint/explicit-module-boundary-types': 0,
52-
'@typescript-eslint/ban-types': 0,
53-
'@typescript-eslint/semi': [2, 'always'],
54-
'@typescript-eslint/restrict-template-expressions': 0,
5528
'@typescript-eslint/no-floating-promises': 2,
5629
// VV These rules we'd like to turn off one day so they error.
5730
'@typescript-eslint/no-unsafe-assignment': 0,
@@ -85,7 +58,6 @@ module.exports = {
8558
rules: {
8659
...ruleOverridesForJs,
8760
...sharedRules,
88-
semi: [2, 'always'],
8961
},
9062
},
9163
],

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"main": "./dist/extension.js",
4242
"scripts": {
4343
"clean": "rimraf -g ./out/* ./dist/*",
44-
"lint": "eslint . && prettier --check .",
44+
"lint": "eslint . --fix && prettier --check .",
4545
"update-grammar": "node ./scripts/update-grammar.ts",
4646
"precompile": "pnpm run clean",
4747
"compile": "npm-run-all compile:*",
@@ -50,7 +50,7 @@
5050
"compile:extension": "tsc -p ./",
5151
"compile:extension-bundles": "webpack --mode development",
5252
"watch": "pnpm run compile && npm-run-all -p watch:*",
53-
"watch:extension": "pnpm run compile:extension -- -watch",
53+
"watch:extension": "tsc -p ./ --watch",
5454
"watch:extension-bundles": "webpack --mode development --watch",
5555
"pretest": "pnpm run compile",
5656
"test": "pnpm run test-webview && pnpm run test-extension",
@@ -65,7 +65,7 @@
6565
"local-install": "pnpm run package && code --install-extension ./mongodb-vscode-*.vsix",
6666
"check-vsix-size": "node ./scripts/check-vsix-size.ts",
6767
"release-draft": "node ./scripts/release-draft.js",
68-
"reformat": "prettier --write .",
68+
"reformat": "eslint . --fix && prettier --write .",
6969
"snyk-test": "node scripts/snyk-test.js",
7070
"generate-icon-font": "node ./scripts/generate-icon-font.ts",
7171
"generate-vulnerability-report": "mongodb-sbom-tools generate-vulnerability-report --snyk-reports=.sbom/snyk-test-result.json --dependencies=.sbom/dependencies.json --fail-on=high",
@@ -1446,6 +1446,7 @@
14461446
"@babel/preset-typescript": "^7.25.7",
14471447
"@babel/types": "^7.25.8",
14481448
"@modelcontextprotocol/sdk": "^1.24.0",
1449+
"@mongodb-js/eslint-config-devtools": "^0.9.12",
14491450
"@mongodb-js/oidc-mock-provider": "^0.11.5",
14501451
"@mongodb-js/oidc-plugin": "^2.0.5",
14511452
"@mongodb-js/prettier-config-devtools": "^1.0.2",
@@ -1481,7 +1482,6 @@
14811482
"depcheck": "^1.4.7",
14821483
"duplicate-package-checker-webpack-plugin": "^3.0.0",
14831484
"eslint": "^8.57.1",
1484-
"eslint-config-mongodb-js": "^5.0.3",
14851485
"eslint-plugin-mocha": "^10.5.0",
14861486
"fork-ts-checker-webpack-plugin": "^9.0.2",
14871487
"glob": "^7.2.3",

0 commit comments

Comments
 (0)