1

I have a React app that has a dependency on another React component from a library that I created.

When I run the build script on the Parent, and the dependency is installed via npm install, the dependency is not linted in the Parent App.

But when I run npm link so I can develop the component locally, and have my Parent App run it's build script, it fails due to the fact it is linting the transpiled code of the dependency.

Any ideas why this is happening?

UPDATE

It seems to have something to do with the name of the directory where the final bundle ends up. I named it bin. Reading through the npm docs it seems that npm link creates a symlink for the directory of the module, as well as for the bin directory, if there is one. I simply changed the name to dist and it resolved the issue. Not the best answer, but hopefully it can help someone in my same situation.

skellertor
  • 916
  • 1
  • 9
  • 26
  • "dependency that I created" ... "doesn't adhere to the same linting rules as the parent". Not really an answer to your question of why linting is behaving this way, but perhaps you could/should just use the same linting rules on both the app and the dependency. – Luke Willis Oct 06 '17 at 22:11
  • @LukeMWillis I didn't explain the problem well enough in my original question. I changed it to reflect the actual problem. It was linting the transpiled code, not the original source. So even if my original es6/jsx source code adhered to the parent apps linting rules, it wouldn't matter because the transpiled code did not. Thanks for your comment though! – skellertor Oct 10 '17 at 04:33

0 Answers0