Skip to content

Commit

Permalink
Run ESLint in Danger (facebook#34305)
Browse files Browse the repository at this point in the history
Summary:
This PR runs eslint in PR using Danger.

## Changelog

[General] [Changed] - Run ESLint in CI

Pull Request resolved: facebook#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
  • Loading branch information
Riccardo Cipolleschi authored and roryabraham committed Aug 17, 2022
1 parent 2a02a45 commit 2c9e919
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/danger_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: yarn install
working-directory: .
- run: yarn install
working-directory: bots
- name: Danger
Expand Down
5 changes: 4 additions & 1 deletion bots/dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@

'use strict';

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

const isFromPhabricator =
danger.github.pr.body &&
Expand Down Expand Up @@ -112,3 +113,5 @@ if (isMergeRefStable) {
},
);
}

eslint.default();
1 change: 1 addition & 0 deletions bots/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"danger": "node ./node_modules/.bin/danger"
},
"devDependencies": {
"@seadub/danger-plugin-eslint": "^3.0.2",
"danger": "^11.0.2",
"lodash.includes": "^4.3.0",
"minimatch": "^3.0.4"
Expand Down
5 changes: 5 additions & 0 deletions bots/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,11 @@
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=

"@seadub/danger-plugin-eslint@^3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@seadub/danger-plugin-eslint/-/danger-plugin-eslint-3.0.2.tgz#9a51d9f1a103a274264c30212234001de0b417c1"
integrity sha512-W+efX4mP04A8wMuLV0nV+iOj892Vrbyik+FyDZcGgpzkJFXX0UfDhOPZ0FonbSV0xM47DI5a8go88U/pBdGM2A==

"@types/long@^4.0.1":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9"
Expand Down

0 comments on commit 2c9e919

Please sign in to comment.