-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Linting and Formatting to the codebase and add CI integration (#86)
* Add eslint and prettier packages and their configs * Lint and format codebase * Add github actions to ensure successful builds and linting * Update package.json * Fix a bug when changing groups * Lint and format codebase * Update package-lock.json Co-authored-by: Josh Holmer <[email protected]>
- Loading branch information
1 parent
8435fe6
commit 315d3f2
Showing
20 changed files
with
12,992 additions
and
2,670 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', // Specifies the ESLint parser | ||
parserOptions: { | ||
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features | ||
sourceType: 'module', // Allows for the use of imports | ||
}, | ||
extends: [ | ||
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react | ||
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin | ||
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. | ||
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier | ||
], | ||
rules: { | ||
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs | ||
// e.g. "@typescript-eslint/explicit-function-return-type": "off", | ||
'@typescript-eslint/no-this-alias': 0, | ||
'react/jsx-key': 0, | ||
'@typescript-eslint/no-explicit-any': 0, | ||
'@typescript-eslint/no-unused-vars': 0, | ||
'@typescript-eslint/explicit-module-boundary-types': 0, | ||
'@typescript-eslint/ban-types': 0, | ||
'prettier/prettier': [ | ||
'error', | ||
{ | ||
endOfLine: 'auto', | ||
}, | ||
], | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Workflow to run on pull request and push to master | ||
|
||
name: CI | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
node-version: | ||
- 10 | ||
- 12 | ||
- 14 | ||
architecture: | ||
- x64 | ||
|
||
name: Node ${{ matrix.node_version }} - ${{ matrix.os }} | ||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
|
||
- name: Install Packages | ||
run: npm install | ||
|
||
- name: Check linting | ||
run: npm run check-lint | ||
|
||
- name: It can build successfully | ||
run: npm run build | ||
|
||
- name: It can package into electron app | ||
run: | | ||
npm run package-darwin | ||
npm run package-linux | ||
npm run package-win32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
semi: true, | ||
trailingComma: "all", | ||
singleQuote: true, | ||
printWidth: 120, | ||
tabWidth: 2 | ||
}; |
Oops, something went wrong.