Skip to content

Commit e8841b2

Browse files
authored
chore(eslint-config): update eslint to 8 (#6942)
* chore(eslint-config): update eslint to 8 * chore(ci): add gha to automatically update eslint to latest * fix: electron > eslint * fix: typo in path resolve * chore(eslint): hoist all eslint deps to monorepo root so that vscode integration can resolve them
1 parent 43a4832 commit e8841b2

File tree

18 files changed

+2613
-3004
lines changed

18 files changed

+2613
-3004
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Update ESLint
2+
3+
# Runs nightly and manually
4+
on:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '0 0 * * *'
8+
9+
permissions:
10+
contents: none # We use the github app token to push the changes
11+
12+
jobs:
13+
update_eslint:
14+
name: Update ESLint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Create Github App Token
18+
uses: mongodb-js/devtools-shared/actions/setup-bot-token@main
19+
id: app-token
20+
with:
21+
app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }}
22+
private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }}
23+
24+
- uses: actions/checkout@v4
25+
with:
26+
# don't checkout a detatched HEAD
27+
ref: ${{ github.head_ref || github.ref_name }}
28+
token: ${{ steps.app-token.outputs.token }}
29+
30+
- uses: actions/setup-node@v4
31+
with:
32+
node-version: 22.15.1
33+
cache: 'npm'
34+
35+
- name: Install [email protected]
36+
run: |
37+
npm install -g [email protected]
38+
39+
- name: Bump eslint
40+
run: |
41+
npm i --save eslint@8 -w @mongodb-js/eslint-config-compass
42+
43+
- name: Create Pull Request
44+
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5
45+
with:
46+
token: ${{ steps.app-token.outputs.token }}
47+
commit-message: 'chore(deps): update eslint'
48+
branch: ci/update-eslint
49+
title: 'chore(deps): update eslint'
50+
labels: no-title-validation
51+
author: '${{ steps.app-token.outputs.app-slug}}[bot] <${{ steps.app-token.outputs.app-email }}>'
52+
body: |
53+
- Update ESLint to latest 8
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/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
"@mongodb-js/eslint-plugin-compass": "^1.2.8",
2121
"@typescript-eslint/eslint-plugin": "^5.59.0",
2222
"@typescript-eslint/parser": "^5.59.0",
23-
"eslint": "^7.25.0",
23+
"eslint": "^8.57.1",
2424
"eslint-config-prettier": "^8.3.0",
2525
"eslint-plugin-filename-rules": "^1.2.0",
26-
"eslint-plugin-jsx-a11y": "^6.4.1",
26+
"eslint-plugin-jsx-a11y": "^6.10.2",
2727
"eslint-plugin-mocha": "^8.0.0",
28-
"eslint-plugin-react": "^7.24.0",
29-
"eslint-plugin-react-hooks": "^4.2.0"
28+
"eslint-plugin-react": "^7.37.5",
29+
"eslint-plugin-react-hooks": "^4.6.2"
3030
},
3131
"scripts": {
3232
"prettier": "prettier-compass",

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.8",
4141
"@mongodb-js/prettier-config-compass": "^1.2.8",
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)