Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Eslint on Danger not matching project config #34980

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/react-native-bots/dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,6 @@ if (isMergeRefStable) {
});
}

// Ensures that eslint is run from root folder and that it can find .eslintrc
process.chdir('../../');
eslint.default();
Comment on lines +112 to 114
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it also work if you instead set options.cwd?

Documentation: https://eslint.org/docs/latest/developer-guide/nodejs-api

Suggested change
// Ensures that eslint is run from root folder and that it can find .eslintrc
process.chdir('../../');
eslint.default();
eslint.default({
// Ensures that eslint is run from root folder and that it can find .eslintrc
cwd: '../../',
});

Copy link
Collaborator Author

@gabrieldonadel gabrieldonadel Oct 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, that was my first approach too @yungsters but unfortunately @sgtcoolguy/danger-plugin-eslint only allows us to change the baseConfig.

https://github.com/sgtcoolguy/danger-plugin-eslint/blob/master/src/index.ts#L24

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no… thanks for sharing. And yes, as @cipolleschi shared, thanks for fixing! I suspect this was one of the issues that blocked me from making progress on #34401. 🥰