-
Notifications
You must be signed in to change notification settings - Fork 0
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
Install flow tool #52
base: f24
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 11504166815Details
💛 - Coveralls |
Removed /lib/ directory as transpiled file as adding them to the main branch can lead to merge conflicts and should be created during CI not stored in the repo. Added |
IntegrationAdding dependencies to GitHubWe followed the set-up documentation that Flow provides for installation, adding the dev dependency packages that were installed with the Using the documentation as guidance, we added packages
Flow also needed to be added to the Finally, we modified a few files that we worked with in Project 2 to use Flow type annotations which serve as an example of how we would use this tool during development:
To do so, we added GitHub WorkflowWe modified the existing workflow file that runs currently runs ESLint. After this file copies the Changes to Project Configuration / Addressing Build Failuresnpm run test and ./nodebb setupAfter adding the type annotations to files and running The setup had a similar issue with the type annotations. We fixed this by adding Locally, a majority of the tests are passing; however, in GitHub, certain tests are failing likely due to faulty tests or time-out issues since we did not modify any of the files that the tests are failing for. Here is a screenshot of the tests passing locally with Flow: npm run lintDue to the flow annotations, the ESLint linter failed as well. Flow had existing documentation that we tried using to address these failures. We added new dev dependencies
However, these changes gave us new linter errors that were not solely related to files that we added the flow annotation to such as Although we followed the setup recommended in the Flow documentation, we infer that there is another ESLint configuration associated with nodebb that conflicts with the Flow ESLint configuration and is incompatible with |
Installed the flow static analysis tool by running
npm install --save-dev @babel/core @babel/cli @babel/preset-flow babel-plugin-syntax-hermes-parser
in the terminal and adding a script and devDependencies to the ./package.json file.By installing flow, .babelrc and .flowconfig files were added to the root directory of the repo. Additionally, the
./node_modules/.bin/babel src/ -d lib/
was run to take all JavaScript files in the src/ directory and transpile them with Babel, and output those files into the lib/ directory.Once installed, the command
npm run flow init
and thennpm run flow
which produced the following output in the terminal.