-
Notifications
You must be signed in to change notification settings - Fork 167
/
plugin.js
37 lines (34 loc) · 1.05 KB
/
plugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
'use strict';
const baseConfig = require('./index');
function restrictedProviderImport(servicePkg) {
return {
name: servicePkg,
message: `Use '${servicePkg}/provider' instead.`,
allowTypeImports: true,
};
}
module.exports = {
...baseConfig,
rules: {
...baseConfig.rules,
'no-restricted-imports': 'off',
'@typescript-eslint/no-restricted-imports': [
'error',
restrictedProviderImport('@mongodb-js/compass-logging'),
restrictedProviderImport('@mongodb-js/compass-app-stores'),
restrictedProviderImport('@mongodb-js/my-queries-storage'),
restrictedProviderImport('@mongodb-js/atlas-service'),
restrictedProviderImport('compass-preferences-model'),
{
paths: require('module').builtinModules,
message: 'Using Node.js built-in modules in plugins is not allowed.',
allowTypeImports: false,
},
{
paths: ['electron', '@electron/remote'],
message: 'Using electron modules in plugins is not allowed.',
allowTypeImports: false,
},
],
},
};