Skip to content

Commit 1bba590

Browse files
Riccardo Cipolleschifacebook-github-bot
authored andcommitted
Run ESLint in Danger (#34305)
Summary: This PR runs eslint in PR using Danger. ## Changelog [General] [Changed] - Run ESLint in CI Pull Request resolved: #34305 Test Plan: 1. Add a JS lint error in the package/react-native-codegen package. 2. Observe the CI task post a message with the errors 3. Fix the errors 4. Observe the CI task report completion with no errors Reviewed By: cortinico Differential Revision: D38315268 Pulled By: cipolleschi fbshipit-source-id: 9984402ee427dd62d47dd716f73c030e6d0f7b5e
1 parent a53512f commit 1bba590

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/danger_pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v3
15+
- run: yarn install
16+
working-directory: .
1517
- run: yarn install
1618
working-directory: bots
1719
- name: Danger

bots/dangerfile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
'use strict';
1111

12-
const {danger, fail, message, warn} = require('danger');
12+
const {danger, fail, /*message,*/ warn} = require('danger');
1313
const includes = require('lodash.includes');
14+
const eslint = require('@seadub/danger-plugin-eslint');
1415

1516
const isFromPhabricator =
1617
danger.github.pr.body &&
@@ -112,3 +113,5 @@ if (isMergeRefStable) {
112113
},
113114
);
114115
}
116+
117+
eslint.default();

bots/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"danger": "node ./node_modules/.bin/danger"
55
},
66
"devDependencies": {
7+
"@seadub/danger-plugin-eslint": "^3.0.2",
78
"danger": "^11.0.2",
89
"lodash.includes": "^4.3.0",
910
"minimatch": "^3.0.4"

bots/yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,11 @@
543543
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
544544
integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=
545545

546+
"@seadub/danger-plugin-eslint@^3.0.2":
547+
version "3.0.2"
548+
resolved "https://registry.yarnpkg.com/@seadub/danger-plugin-eslint/-/danger-plugin-eslint-3.0.2.tgz#9a51d9f1a103a274264c30212234001de0b417c1"
549+
integrity sha512-W+efX4mP04A8wMuLV0nV+iOj892Vrbyik+FyDZcGgpzkJFXX0UfDhOPZ0FonbSV0xM47DI5a8go88U/pBdGM2A==
550+
546551
"@types/long@^4.0.1":
547552
version "4.0.1"
548553
resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9"

0 commit comments

Comments
 (0)