-
Notifications
You must be signed in to change notification settings - Fork 91
chore: migrate tslint to eslint #199
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
chore: migrate tslint to eslint #199
Conversation
Use NX migrations to upgrade NX. Upgrades Angular to 11.2.9
To be more in line with the NX defaults, the application files are moved to the ./src folder. The tslint-to-eslint migration was failing. Might have been due to being a flattened project.
Remove all angular-eslint/recommended rules. These are provided by the @nrwl/nx plugin fix(eslint): remove duplicate rules Remove all eslint/recommended rules. These are provided by the @nrwl/nx plugin
Somehow the npm run format does not fix all prettier issues. Therefore ran prettier separate. Added the .prettierignore file
New name is `allowedNonPeerDependencies`
Update deprecated imports
remove duplicate rules from: - 'eslint:recommended', - 'plugin:@typescript-eslint/eslint-recommended',
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the "ready to merge" checkbox isn't checked.
What would still need to be done in order to get this merged?
From my point of view, this is looking great already and I would lean towards removing TSLint and the migrations.
One remark, there's a link to the example app in the README, that should be updated to the new location.
Wasn't sure I could check it or the reviewer (you) should 😇 |
By removing the obsolete TSLint dependency, we need to remove the migrations as well. Since these depend on TSLint specific properties/types BREAKING CHANGE: migrations for v4.0.0 and v5.1.2 are no longer available
BTW: @testing-library/dom 7.29.4 7.29.4 7.30.3 node_modules/@testing-library/dom angular-testing-library
@testing-library/user-event 12.8.3 12.8.3 13.1.2 node_modules/@testing-library/user-event angular-testing-library but these updates caused issues with For example: Updating 'only' FAIL ATL projects/testing-library/tests/wait-for.spec.ts
● allows to override options
expect(received).rejects.toThrow()
Received promise resolved instead of rejected
Resolved to value: <div>Success</div>
34 | fireEvent.click(screen.getByTestId('button'));
35 |
> 36 | await expect(waitForATL(() => screen.getByText('Success'), { timeout: 200 })).rejects.toThrow(
| ^
37 | /Unable to find an element with the text: Success/i,
38 | );
39 | });
at expect (../../node_modules/expect/build/index.js:134:15)
at tests/wait-for.spec.ts:36:9
at fulfilled (../../node_modules/tslib/tslib.js:114:62)
at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:407:30)
at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3765:43)
at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:406:56)
at Zone.Object.<anonymous>.Zone.run (../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:167:47)
at ../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:1325:38
at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invokeTask (../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:441:35)
at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvokeTask (../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3796:43)
at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invokeTask (../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:440:64)
at Zone.Object.<anonymous>.Zone.runTask (../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:212:51)
at drainMicroTaskQueue (../../node_modules/zone.js/bundles/zone-testing-bundle.umd.js:627:39) |
Should we/somebody update the documentation on the testing-library/docs page after merging? |
Yep, those failing tests with the latest version of dom testing library are on our radar (that's why it's currently pinned). Once it's merged, we'll update the docs. |
After it is merged I'll start the PR with the testing-library eslint rules 👍 |
Thanks @the-ult ! |
I've put up a pull request to add @the-ult! 🎉 |
@timdeschryver I adjusted the url on testing-library.com as well. |
🎉 This PR is included in version 10.6.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
What
Migrate from TSLint to ESLint
and upgrade dependencies
Why
To provide the 'best' examples possible, we should make sure the examples are making use of the best practices. Like discussed here
To help doing that, there are 2 great ESLint plugins:
To be able to use these plugins we first need to migrate from TSLint to ESLint.
This PR is a prerequisite of #198 (Adding the above plugins and improve the examples)
How
@nrwl/angular:convert-tslint-to-eslint
schematicapps/example-app/app/examples
toapps/example-app/app/examples
@nrwl/angular:convert-tslint-to-eslint
schematic since the schematic expects the 'NX' structure for an appTroubleshooting
Removing TSLint
Could not remove
tslint
from thepackage.json
due to the following errors in a migration file:Checklist
src
is added as root of example-app ->apps/example-app/app/examples/src
instead ofapps/example-app/app/examples