Skip to content

Commit f145c89

Browse files
chore: upgrade to webpack5 VSCODE-338 (#437)
* chore: upgrade to webpack 5 * feat: use the lates vscode language server dependencies * fix: provide buffer fallback for leafy green components * test: fix connecting tests after bumping data service * build: clean up dependencies * feat: add content security policy to webview * refactor: clean up eslint * refactor: add more eslint rules to js * refactor: run prettier reformat * fix: update eslint rules * refactor: combine webpack plugins * refactor: swap rules * feat: use crypto for nonce * refactor: import crypto
1 parent e2fb176 commit f145c89

23 files changed

+4439
-8302
lines changed

.depcheckrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
ignores:
22
- "@babel/core"
3+
- "@leafygreen-ui/palette"
34
- "@mongodb-js/prettier-config-compass"
45
- "@types/jest"
6+
- "buffer"
57
- "eslint-config-mongodb-js"
68
- "keytar"
79
- "mocha-junit-reporter"
810
- "mocha-multi"
11+
- "mongodb-client-encryption"
912
- "pre-commit"
13+
- "process"
1014
- "vscode-languageserver-textdocument"
1115
- "vscode"
1216
- "webpack-cli"

.eslintrc.js

Lines changed: 44 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,60 +8,68 @@ const ruleOverridesForJs = Object.keys(
88
{}
99
);
1010

11+
const sharedRules = {
12+
indent: 0,
13+
'brace-style': 0,
14+
'chai-friendly/no-unused-expressions': 0,
15+
'mocha/no-exclusive-tests': 2,
16+
'no-cond-assign': [2, 'except-parens'],
17+
'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,
26+
};
27+
1128
module.exports = {
1229
plugins: ['mocha', '@typescript-eslint'],
1330
parser: '@typescript-eslint/parser', // Specifies the ESLint parser.
1431
parserOptions: {
1532
ecmaVersion: 2018,
1633
sourceType: 'module',
17-
project: ['./tsconfig.json'],
1834
},
1935
extends: [
2036
'eslint-config-mongodb-js/react',
2137
'plugin:@typescript-eslint/eslint-recommended',
2238
'plugin:@typescript-eslint/recommended',
2339
'plugin:@typescript-eslint/recommended-requiring-type-checking',
2440
],
25-
rules: {
26-
'chai-friendly/no-unused-expressions': 0,
27-
'object-curly-spacing': [2, 'always'],
28-
'no-empty-function': 0,
29-
'valid-jsdoc': 0,
30-
'react/sort-comp': 0, // Does not seem work as expected with typescript.
31-
'@typescript-eslint/no-empty-function': 0,
32-
'@typescript-eslint/no-use-before-define': 0,
33-
'@typescript-eslint/no-explicit-any': 0,
34-
'@typescript-eslint/no-var-requires': 0,
35-
'@typescript-eslint/no-unused-vars': 2,
36-
'@typescript-eslint/explicit-module-boundary-types': 0,
37-
'@typescript-eslint/ban-types': 0,
38-
'mocha/no-skipped-tests': 1,
39-
'mocha/no-exclusive-tests': 2,
40-
semi: 0,
41-
'@typescript-eslint/semi': [2, 'always'],
42-
'no-console': [1, { allow: ['warn', 'error', 'info'] }],
43-
'no-shadow': 0,
44-
'no-use-before-define': 0,
45-
'no-cond-assign': [2, 'except-parens'],
46-
'space-before-function-paren': 0,
47-
'@typescript-eslint/no-floating-promises': 0,
48-
49-
'restrict-template-expressions': 0,
50-
'@typescript-eslint/restrict-template-expressions': 0,
51-
52-
'@typescript-eslint/no-floating-promises': 2,
53-
54-
// VV These rules we'd like to turn off one day so they error.
55-
'@typescript-eslint/no-unsafe-assignment': 0,
56-
'@typescript-eslint/no-unsafe-member-access': 0,
57-
'@typescript-eslint/no-unsafe-call': 0,
58-
'@typescript-eslint/no-unsafe-return': 0,
59-
},
6041
overrides: [
42+
{
43+
files: ['*.ts', '*.tsx'],
44+
rules: {
45+
...sharedRules,
46+
semi: 0,
47+
'@typescript-eslint/no-empty-function': 0,
48+
'@typescript-eslint/no-use-before-define': 0,
49+
'@typescript-eslint/no-explicit-any': 0,
50+
'@typescript-eslint/no-var-requires': 0,
51+
'@typescript-eslint/no-unused-vars': 2,
52+
'@typescript-eslint/explicit-module-boundary-types': 0,
53+
'@typescript-eslint/ban-types': 0,
54+
'@typescript-eslint/semi': [2, 'always'],
55+
'@typescript-eslint/restrict-template-expressions': 0,
56+
'@typescript-eslint/no-floating-promises': 2,
57+
// VV These rules we'd like to turn off one day so they error.
58+
'@typescript-eslint/no-unsafe-assignment': 0,
59+
'@typescript-eslint/no-unsafe-member-access': 0,
60+
'@typescript-eslint/no-unsafe-call': 0,
61+
'@typescript-eslint/no-unsafe-return': 0,
62+
'@typescript-eslint/no-unsafe-argument': 0,
63+
},
64+
parserOptions: {
65+
project: ['./tsconfig.json'], // Specify it only for TypeScript files.
66+
},
67+
},
6168
{
6269
files: ['**/*.js'],
6370
rules: {
6471
...ruleOverridesForJs,
72+
...sharedRules,
6573
semi: [2, 'always'],
6674
},
6775
},

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ snippets
1212
syntaxes
1313
CHANGELOG.md
1414
README.md
15+
constants.json

0 commit comments

Comments
 (0)