Skip to content

Commit 32daaa8

Browse files
chore: allow type only imports for 'mongodb' package in connection-form (#5207)
* chore: allow only type imports for mongodb package in connection-form * chore: added @mongodb-js/connection-storage to lint error * Update packages/connection-form/.eslintrc.js Co-authored-by: Sergey Petushkov <[email protected]> * chore: fix minor typo and combine patterns * chore: remove unnecessary comment --------- Co-authored-by: Sergey Petushkov <[email protected]>
1 parent f5da912 commit 32daaa8

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

packages/connection-form/.eslintrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,33 @@ module.exports = {
55
tsconfigRootDir: __dirname,
66
project: ['./tsconfig-lint.json'],
77
},
8+
overrides: [
9+
{
10+
files: ['./src/**/*.ts', './src/**/*.tsx'],
11+
rules: {
12+
// See -
13+
// https://typescript-eslint.io/rules/no-restricted-imports/#how-to-use
14+
'no-restricted-imports': 'off',
15+
'@typescript-eslint/no-restricted-imports': [
16+
'error',
17+
{
18+
patterns: [
19+
{
20+
group: ['@mongodb-js/connection-storage', 'mongodb'],
21+
message:
22+
'@mongodb-js/connection-form package is shared between Compass and VSCode and should use Compass-specific packages only for type definitions',
23+
allowTypeImports: true,
24+
},
25+
],
26+
},
27+
],
28+
},
29+
},
30+
{
31+
files: ['./src/**/*.spec.ts'],
32+
rules: {
33+
'@typescript-eslint/no-restricted-imports': ['off'],
34+
},
35+
},
36+
],
837
};

0 commit comments

Comments
 (0)