Development Environment
The Frontend Core consists of common JavaScript code for the web-frontend and the mobile projects. Both uses them as an npm package.
IDE
The suggested IDE is either IntelliJ IDEA or WebStorm which is a subset of IntelliJ but able to deal with React projects. Both of them have great code completion, static code analysis and code formatting features.
Setting up the IDE
No setup is required since the package can not be executed on its own. It needs to be installed in one of the main components.
Development
In order to test the code changes it needs to be installed in either the web-frontend or the mobile component. To make them use the local version of the package do the followings(in web-frontend. If you want to test in the mobile package you need to use yarn instead of npm):
- Uninstall the remote version of the package:
npm uninstall @bassboost/frontend-core npm install ../frontend-core
Once you are done revert these changes.
Code analysis
For static code analysis the project uses ESLint. Both
Jetbrains IDE automatically detects the configuration and helps to make the code
better in real time. There is an npm script to detect all the errors: npm run
lint. If you want to fix all the auto correctable errors the --fix option need
to be passed to the underlying eslint command like this: npm run lint --
--fix