analogjs / analog

The fullstack meta-framework for Angular. Powered by Vite and Nitro
https://analogjs.org
MIT License
2.61k stars 251 forks source link

Setup prettier and eslint with nx preset @analogjs/platform #980

Closed d3473r closed 3 months ago

d3473r commented 8 months ago

Which scope/s are relevant/related to the feature request?

create-analog

Information

Hi,

I did setup analogjs with nx running the npx create-nx-workspace@latest --preset=@analogjs/platform command. Now i want to add prettier and eslint to the project, i added a few suggested plugins from eslint, then I'm getting stuck at ESLint couldn't find the plugin "@nx/eslint-plugin-nx".

When i install this dependency I'm getting a peer dependency error, it seems this package was replaced with @nx/eslint-plugin, see: https://github.com/nrwl/nx/blob/master/packages/eslint-plugin/migrations.json

It would be awesome if the @analogjs/platform preset sets up prettier and eslint automatically like the angular-monorepo (npx create-nx-workspace@latest angular-monorepo --preset=angular-monorepo), or the angular-standalone (npx create-nx-workspace@latest myngapp --preset=angular-standalone) presets does.

Describe any alternatives/workarounds you're currently using

Copy the .eslintrc.json and .eslintignore from a nx angular-monorepo and delete the project-dir/.eslintrc.json as this requires the @nx/eslint-plugin-nx plugin

I would be willing to submit a PR to fix this issue

brandonroberts commented 8 months ago

We used to have this functionality included, but Nx removed the ability to use those generators when they introduced support for nx add, so we need to revisit how this works and integrate it again