Commit f0da316
fix: Eslint on Danger not matching project config (facebook#34980)
Summary:
I've been noticing this for a while now, every time that someone changes a file inside rn-tester Danger comments a bunch of warnings regarding inline styles, e.g. facebook#34567 (comment), even though that is disabled inside .eslintrc https://github.com/facebook/react-native/blob/8edf4e9e3adcc85743e3c86a25ab3748b276a3da/packages/rn-tester/.eslintrc#L3
After some investigation, I realized that the problem was that the Eslint Node.js API used by [seadub/danger-plugin-eslint](https://www.npmjs.com/package/seadub/danger-plugin-eslint) was not able to locate any `.eslintrc` files due to the location of the directory where danger is invoked. By using `process.chdir` we can ensure that eslint will run from the root folder and that it will be able to find all .eslintrc files
## Changelog
[Internal] [Fixed] - fix eslint config when running Danger
Pull Request resolved: facebook#34980
Test Plan:
run `yarn danger pr https://github.com/facebook/react-native/pull/34976`
After

Before

Reviewed By: cortinico
Differential Revision: D40384300
Pulled By: yungsters
fbshipit-source-id: e68eeafc42567dc9d7297dde3709a989cc70f4e21 parent bf2cc69 commit f0da316
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
112 | 114 | | |
0 commit comments