-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
resolves: [M2-4835](https://mindlogger.atlassian.net/browse/M2-4835) # Objective This PR creates a GitHub Action to run linting tasks on pull requests submitted to the repository. As part of the ticket, I took the opportunity to update the ESlint rules on the project to be more in line with those on [mindlogger-admin](https://github.com/ChildMindInstitute/mindlogger-admin). These updates have raised a number of linting issues, but **won't block** the merging of pull requests. While I've addressed some of the smaller items (and any error ones), I expect that these will be addressed in the normal course of feature development so that we can eventually require linting checks to pass in order to merge PRs. ## Prettier Code Formatting Prettier has been configured in the project as the code formatter of choice, but it is currently conflicting with a number of code formatting ESLint rules. The prettier ESLint plugin disables these rules if it is placed as an inherited configuration at the end of the `extends` array, so I have made this change. The prettier ESLint plugin also enables Prettier as an ESLint rule, so that code formatting issues become errors. This should be okay, since Prettier fixes them for you.
- Loading branch information
1 parent
df58326
commit 0abce1e
Showing
488 changed files
with
10,442 additions
and
9,472 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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
node_modules/ | ||
dist/ | ||
.prettierrc.js | ||
.eslintrc.js | ||
env.d.ts | ||
public | ||
.gitignore | ||
# Ignore everything | ||
/* | ||
|
||
# Except for the src directory | ||
!src | ||
|
||
# And any top-level JS or TS files | ||
!/*.js | ||
!/*.jsx | ||
!/*.ts | ||
!/*.tsx |
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
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,54 @@ | ||
name: CI | ||
on: [pull_request] | ||
|
||
env: | ||
NODE_VERSION: 20.11.0 | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/node_modules | ||
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- run: yarn install --frozen-lockfile | ||
|
||
- uses: wearerequired/lint-action@v2 | ||
with: | ||
eslint: true | ||
eslint_extensions: mjs,js,jsx,mts,ts,tsx | ||
prettier: true | ||
prettier_extensions: mjs,js,jsx,mts,ts,tsx | ||
continue_on_error: false | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Install deps | ||
run: yarn install --frozen-lockfile | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/node_modules | ||
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Running tests | ||
env: | ||
REACT_APP_API_DOMAIN: http://localhost:8080 | ||
run: yarn test |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,13 @@ | ||
/node_modules | ||
/public | ||
/src/i18n/ | ||
# Ignore everything | ||
/* | ||
|
||
# Except for the src directory | ||
!src | ||
|
||
# And any top-level JS or TS files | ||
!/*.js | ||
!/*.mjs | ||
!/*.jsx | ||
!/*.ts | ||
!/*.mts | ||
!/*.tsx |
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
module.exports = { | ||
arrowParens: 'avoid', | ||
bracketSameLine: true, | ||
arrowParens: 'always', | ||
bracketSameLine: false, | ||
bracketSpacing: true, | ||
singleQuote: false, | ||
singleQuote: true, | ||
jsxSingleQuote: false, | ||
trailingComma: 'all', | ||
printWidth: 120, | ||
semi: true, | ||
printWidth: 100, | ||
tabWidth: 2, | ||
useTabs: false, | ||
semi: false | ||
} | ||
endOfLine: 'lf', | ||
}; |
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
Oops, something went wrong.