accordproject / cicero-word-add-in

A plugin to allow users to interact with Accord Project templates directly in MS Word.
Apache License 2.0
19 stars 9 forks source link

Integrating Github Actions for linting checks #56

Closed Aniruddha-Shriwant closed 3 years ago

Aniruddha-Shriwant commented 3 years ago

Discussion 🗣

Integrating Github Actions :

Currently, after the latest commits, you may notice that the master branch have some linting errors as follows :

PS D:\Github\cicero-word-add-in> npm run lint

> cicero-word-add-in@0.0.1 lint
> eslint src/**/*.{js,jsx}     

D:\Github\cicero-word-add-in\src\components\TemplateLibrary\index.js    
  218:15  error  Expected space(s) after "if"        keyword-spacing    
  218:36  error  Missing space before opening brace  space-before-blocks
  230:16  error  Expected space(s) before "else"     keyword-spacing    
  230:16  error  Expected space(s) after "else"      keyword-spacing    

✖ 4 problems (4 errors, 0 warnings)
  4 errors and 0 warnings potentially fixable with the `--fix` option.  

For this, we may use Github Actions for this repo same as we have it for another Accord Project's repositories, where we will check the Lint checks and maybe also have an auto-fix option for the errors caused in PR

I have explored some solutions for this and found these two references to be useful :

  1. Normal Es-lint check - https://github.com/marketplace/actions/run-eslint
  2. Auto-fixing eslint issues - https://github.com/marketplace/actions/lint-action

Currently, we are just using ESlint if in the future we may try to Integrate Prettier with Eslint then Github Actions would help us in the same

There is an open issue #46 related to pre-commit hooks that may solve this problem but if this idea of integrating Github Actions sounds good then I would like to contribute to this if needed

Related issues for Github actions in other repositories : cicero-template-library/issues/379, technical-steering-committee/issues/4