-
Notifications
You must be signed in to change notification settings - Fork 9
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
README step to add Angular schematic results in incorrect dependencies in package.json #76
Comments
Always use the schematic. It will do more than add dependencies, and it ensures the steps are maintained upstream. Also, these aren't peer dependencies. Even if they were, not everyone uses npm 7. As for the version match criteria, that's the responsibility of the consumer, but we can certainly open an issue/contribute upstream to improve it by matching major versions by default. Yes, there are quite a few packages. This is why Angular declined to include it by default. It looks like it follows @typescript-eslint's pattern, and it has to account for templates. We could file an issue to propose an additional encapsulating package, but there are likely good reasons for this, like removing template support when it's not needed. Interested in starting discussions upstream? I certainly can if we're interested in exploring that direction. |
By not peer dependencies, I mean literally. If you're asking why they aren't, my guess is that it's setup to support various scenarios where this combination is not used. Again, we can always ask for context. |
I tried removing all of the deps that the schematic had added. I was able to remove all except At this point the best guidance I could suggest for the README would be something vague like "Not all dependencies added by the schematic are strictly required. If the dependencies cause conflicts or you wish to keep your |
I can and intended to take a look at improving the README. However, removing the dependencies doesn't make sense to me at the moment. I looked at all the As for guidance, I would suggest using the major version (caret) operator which should allow an upgrade to what |
Now that we're all on npm 8, I've changed my opinion and agree that these dependencies aren't necessary. It is now common at NI to not declare them. I'm addressing this in #119, but I think the best long term solution would be to provide a schematic that removes them automatically. We could also include support for configuring multi-project workspace automatically. I'm not sure why Angular ESLint doesn't support that. |
Also, as part of the Angular 15 upgrade research we'll likely need to evaluate if these dependencies need to be specified when the style guide supports 14 and 15. npm commonly fails to resolve the multi-version conditions, so a user may need to explicitly declare the correct version. |
After evaluating the latest Angular ESLint documentation, I determined that our users would benefit from the concise nature of our existing documentation. Angular ESLint provides too much explanation for each step, whereas we focus on getting the user up and running. I updated the following. - Removed references to TSLint and versions of Angular prior to 12 - Replaced references to new and existing workspaces with single and multi-project - Address the dependencies added by the schematic - Added the command to ensure future projects are generated with configuration in multi-project workspaces - Updated the order of the steps to better reflect that multi-project workspaces are common - Removed superfluous comments in the ESLint configuration - Updated links Work Items: - #76
I started integrating the styleguide into the SystemLink project. When I ran
ng add @angular-eslint/schematics
as instructed by our README, it modified thepackage.json
andpackage-lock.json
to include these additional dependencies:With NPM 7, I think this behavior is incorrect:
package.json
"@typescript-eslint/eslint-plugin": "4.28.2"
but@ni/eslint-config-typescript
needs version"@typescript-eslint/eslint-plugin": "^4.31.0"
. This results innpm install
creating nestednode_modules
directories to handle the version conflicts and potentially some tools using an unexpected version of those dependencies.Some possible remedies:
ng add @angular-eslint/schematics
. I don't think this is a good idea because (I think) the later step tong g @angular-eslint/schematics:convert-tslint-to-eslint
depends on this step.package[-lock].json
changes after adding the schematic if you're using NPM 7+@angular-eslint
about the behavior. I couldn't find any existing issuesI'm interested in everyone's thoughts on this, but particularly @TrevorKarjanis.
The text was updated successfully, but these errors were encountered: