Skip to content

Commit 6e38e9e

Browse files
committed
chore(eslint-config): update eslint to 8; update eslint dependencies to latest
1 parent 0a9ee84 commit 6e38e9e

File tree

7 files changed

+2607
-1780
lines changed

7 files changed

+2607
-1780
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
#!/usr/bin/env node
22
'use strict';
3-
require('eslint/bin/eslint.js');
3+
const path = require('path');
4+
const eslintPkgJson = require('eslint/package.json');
5+
const eslintBinPath = path.resolve(
6+
path.dirname(require.resolve('eslint/package.json')),
7+
eslintPkgJson.bin.eslint
8+
);
9+
require(eslintBinPath);

configs/eslint-config-compass/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const commonTestOverrides = {
5050
{
5151
patterns: [
5252
{
53-
group: '@testing-library/*',
53+
group: ['@testing-library/*'],
5454
message: 'Use @mongodb-js/testing-library-compass instead',
5555
allowTypeImports: false,
5656
},

configs/eslint-config-compass/package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@
1515
],
1616
"dependencies": {
1717
"@babel/core": "^7.21.4",
18-
"@babel/eslint-parser": "^7.14.3",
19-
"@mongodb-js/eslint-config-devtools": "^0.9.9",
18+
"@babel/eslint-parser": "^7.27.0",
19+
"@mongodb-js/eslint-config-devtools": "^0.9.10",
2020
"@mongodb-js/eslint-plugin-compass": "^1.2.6",
21-
"@typescript-eslint/eslint-plugin": "^5.59.0",
22-
"@typescript-eslint/parser": "^5.59.0",
23-
"eslint": "^7.25.0",
24-
"eslint-config-prettier": "^8.3.0",
21+
"@typescript-eslint/eslint-plugin": "^8.28.0",
22+
"@typescript-eslint/parser": "^8.28.0",
23+
"eslint": "^8.57.1",
2524
"eslint-plugin-filename-rules": "^1.2.0",
2625
"eslint-plugin-jsx-a11y": "^6.4.1",
27-
"eslint-plugin-mocha": "^8.0.0",
26+
"eslint-plugin-mocha": "^10.5.0",
2827
"eslint-plugin-react": "^7.24.0",
2928
"eslint-plugin-react-hooks": "^4.2.0"
3029
},

configs/eslint-config-compass/plugin.js

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,30 @@ module.exports = {
1717
'no-restricted-imports': 'off',
1818
'@typescript-eslint/no-restricted-imports': [
1919
'error',
20-
restrictedProviderImport('@mongodb-js/compass-logging'),
21-
restrictedProviderImport('@mongodb-js/compass-telemetry'),
22-
restrictedProviderImport('@mongodb-js/compass-app-stores'),
23-
restrictedProviderImport('@mongodb-js/my-queries-storage'),
24-
restrictedProviderImport('@mongodb-js/atlas-service'),
25-
restrictedProviderImport('compass-preferences-model'),
2620
{
27-
paths: require('module').builtinModules,
28-
message: 'Using Node.js built-in modules in plugins is not allowed.',
29-
allowTypeImports: false,
30-
},
31-
{
32-
paths: ['electron', '@electron/remote'],
33-
message: 'Using electron modules in plugins is not allowed.',
34-
allowTypeImports: false,
21+
paths: [
22+
restrictedProviderImport('@mongodb-js/compass-logging'),
23+
restrictedProviderImport('@mongodb-js/compass-telemetry'),
24+
restrictedProviderImport('@mongodb-js/compass-app-stores'),
25+
restrictedProviderImport('@mongodb-js/my-queries-storage'),
26+
restrictedProviderImport('@mongodb-js/atlas-service'),
27+
restrictedProviderImport('compass-preferences-model'),
28+
...require('module').builtinModules.map((name) => {
29+
return {
30+
name,
31+
message:
32+
'Using Node.js built-in modules in plugins is not allowed.',
33+
allowTypeImports: true,
34+
};
35+
}),
36+
...['electron', '@electron/remote'].map((name) => {
37+
return {
38+
name,
39+
message: 'Using electron modules in plugins is not allowed.',
40+
allowTypeImports: false,
41+
};
42+
}),
43+
],
3544
},
3645
],
3746
},

configs/eslint-plugin-compass/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@mongodb-js/mocha-config-compass": "^1.6.6",
4141
"@mongodb-js/prettier-config-compass": "^1.2.6",
4242
"depcheck": "^1.4.1",
43-
"eslint": "^7.25.0",
43+
"eslint": "^8.57.1",
4444
"mocha": "^10.2.0",
4545
"nyc": "^15.1.0"
4646
}

0 commit comments

Comments
 (0)