-
Notifications
You must be signed in to change notification settings - Fork 38
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
[TypeScript] Lint TypeScipt code #736
Conversation
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.
Very cool. It goes without saying that I didn't review all the ts changes, as I assume they were automated.
I had to add type return types everywhere. The semi-colon stuff was automated. I split this out into #737 and #738 which each contain some non-automatic/mechanical changes to appease the linter. |
This PR includes changes that were a part of #736 and that require some special attention. This PR moves the generated truffle typings to the `build/` directory, so we can use the `types/` directory for manually created type definitions. Added typings for the `truffle-assertions` npm package for use in the truffle tests. ### Test Plan CI!
This PR adds orderbook JSON types This change was included as part of #736 but I think it deserves some special attention. ### Test Plan Unit tests validate serialization and deserialization. ### Commit History * add orderbook JSON types * separate JSON types
// eslint-disable-next-line no-undef | ||
const BUILD_DIR = path.join(__dirname, "build", "contracts") | ||
// eslint-disable-next-line no-undef | ||
const NETWORKS_FILE_PATH = path.join(__dirname, "networks.json") |
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.
Weird... why where these even here. Looks like they were perfectly defined..
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.
Because the ESLint env
was incorrectly setup for this file.
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 would say that the semis could have been removed separately so I could actually detect what else was changed.
The issue is that CI would fail as the formatting would be incorrect. I suggest filtering by |
Currently the typescript code is not being linted in the CI. This PR adds some basic recommended typescript linting rules and fixes to code so that the linting succeeds.
In order to fix an import lint on importing
truffle-assertions
, I added some typings for the module.Test Plan
CI - linting should succeed.