Hi! Thanks for your interest in helping to make this project more awesome by contributing.
Contribution can be anything like (but not limited to) improving documentation, reporting bugs, feature requests, contributing code.
- Pick up an issue (or create one) on which you want to work. You can take help of labels to filter them down.
- Tell beforehand that you are working on the issue. This helps in making sure that multiple contributors are not working on the same issue.
- Fork the repository and clone it locally.
- Install the dependencies by running
npm install
. - Make changes to the code and commit to master. Write descriptive commits.
- Load the extension and check/confirm your changes.
- Run
npm run lint
to make sure there are no syntax or linter errors. - Run unit tests by typing
npm run lint
. - Push the changes to your fork and submit a Pull Request.
The following are some general steps that you can take to make your development flow more intuitive and smooth.
- Run
npm run webpack-watch:<browser>
to let webpack build and watch for changes.<browser>
can bechrome
,firefox
oropera
. - Load the extension in the browser and test your code without worrying to build every time you make some change.
- Instead of running the above command for all the browsers simultaneously, target and test on any one browser first and later move to others. Thanks to WebExtensions API, other browsers will pick up the changes with little to no modification in code.
- For the two main sections of the extension: popup and options,
scss
files are compiled to twocss
files. - Run
compile-sass-<target>:watch
to watch for changes.<target>
can bepopup
oroptions
. - The above commands will only compile
scss
tocss
. To include them in the build, also runnpm run webpack-watch:<browser>
in a different terminal session. - Load the extension in the browser and test your styles without worrying to build every time you make some change.
- The repository has a .editorconfig file at the root. It defines some general rules for the editor.
- The plugin for editorconfig will pickup the defaults automatically. In case your editor does not have the plugin, Download it from here.
- The project uses eslint. Running
npm run lint
will show linter errors in the code, if any. - If you are using vscode, installing eslint extension will show linter errors and warnings in real time.
-
The project uses prettier as the code-formatter. You can format the code in two ways.
- Running
npm run prettier:check
will check if files insrc
andtests
directories follow the prettier formatting. - Running
npm run prettier:format
will format files insrc
andtests
directories. - Note: It may happen that the above commands gives an error and terminate. Most often than not it is due to incorrect code that prettier cannot format. In this case, you can use the warning message to debug the issue.
- You can install the prettier plugin for your faviourite editor (eg: prettier for vscode). It should automatically read the config file and work. You can also go ahead and enable formatting on save.
- Note: Make sure that you configure your editor to use prettier for formatting (atleast for this project).
- Running
- It is recommended that you install the eslint plugin as well as prettier plugin in your editor and let them do the heavy lifting, while you focus on writting good code.