-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Linter #56
Closed
Closed
Add Linter #56
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
d4a55d0
Bump @material-ui/data-grid in /client
dependabot[bot] 3bb1eaa
Bump react-scripts from 4.0.2 to 4.0.3 in /client
dependabot[bot] 8c3ae7d
Bump @testing-library/user-event from 12.7.1 to 12.8.0 in /client
dependabot[bot] ca21dbb
Bump typescript from 4.1.5 to 4.2.2 in /client
dependabot[bot] dc2ddea
Merge pull request #8 from nlpsandbox/main
6d03614
Bump node from 15.9.0-alpine3.12 to 15.11.0-alpine3.12 in /client
dependabot[bot] 9f4556b
Merge pull request #7 from cascadianblue/dependabot/npm_and_yarn/clie…
1063761
Merge pull request #6 from cascadianblue/dependabot/npm_and_yarn/clie…
99500a0
Merge branch 'main' into dependabot/npm_and_yarn/client/main/react-sc…
1d0b15d
Merge pull request #4 from cascadianblue/dependabot/npm_and_yarn/clie…
26ac218
Bump @testing-library/user-event from 12.7.1 to 12.8.1 in /client
dependabot[bot] 17b6a22
Merge branch 'main' into dependabot/npm_and_yarn/client/main/testing-…
ffdd15a
Merge pull request #10 from cascadianblue/dependabot/npm_and_yarn/cli…
fb57e4c
Merge pull request #9 from cascadianblue/dependabot/docker/client/mai…
b0bf3cc
Merge pull request #5 from cascadianblue/dependabot/npm_and_yarn/clie…
5f5e9c0
Update ESLint & Add Config File
873ec3f
Re-format
e05ba57
Merge branch 'main' of https://github.com/nlpsandbox/phi-deidentifier…
f3271f8
Merge branch 'main' into add-linter
090bfe6
Clean up AnnotationView.js
9fc3772
Fix Up InfoDialog.js
961eb6f
Fix up DeidentifiedText.js
7499c68
De-Lint DeidentificationConfigForm.js
5ab932d
Fix AnnotationView Type Expectations
591bf61
Import PropTypes in InfoDialog
82d5310
Delint App.js
ab517a9
Import React into App.test.js
13cd292
Add Lint Step to CI
3a3fa14
Fix Call to ESLint in ci.yml
1f07a72
Match Linter Call to Local
d3348d0
Match Linter Call to Local
064624b
Merge branch 'add-linter' of https://github.com/cascadianblue/phi-dei…
8d40acb
Match Linter Call to Local
f726c77
Merge branch 'add-linter' of https://github.com/cascadianblue/phi-dei…
aec06dc
Merge branch 'add-linter' of https://github.com/cascadianblue/phi-dei…
e0eceb8
Merge branch 'add-linter' of https://github.com/cascadianblue/phi-dei…
25ddad8
Merge branch 'add-linter' of https://github.com/cascadianblue/phi-dei…
0a50b54
Add Useless Newline
boyleconnor 7b77677
Revert "Add Useless Newline"
boyleconnor 8d759f8
Merge branch 'add-linter' of https://github.com/cascadianblue/phi-dei…
boyleconnor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,21 @@ | ||
env: | ||
browser: true | ||
es2021: true | ||
extends: | ||
- 'plugin:react/recommended' | ||
parser: '@typescript-eslint/parser' | ||
parserOptions: | ||
ecmaFeatures: | ||
jsx: true | ||
ecmaVersion: 12 | ||
sourceType: module | ||
plugins: | ||
- react | ||
- '@typescript-eslint' | ||
rules: | ||
no-invalid-this: off | ||
require-jsdoc: off | ||
indent: | ||
- error | ||
- 2 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
@@ -1,39 +1,56 @@ | ||
import { Paper, Zoom } from '@material-ui/core'; | ||
import { DataGrid } from '@material-ui/data-grid'; | ||
import {Paper} from '@material-ui/core'; | ||
import {DataGrid} from '@material-ui/data-grid'; | ||
import React from 'react'; | ||
import { deidentificationStates } from './DeidentifiedText'; | ||
|
||
export function AnnotationView(props) { | ||
import {deidentificationStates} from './DeidentifiedText'; | ||
import PropTypes from 'prop-types'; | ||
|
||
function AnnotationView(props) { | ||
const types = [ | ||
{type: "text_date", name: "Date", key: "textDateAnnotations"}, | ||
{type: "text_physical_address", name: "Physical Address", key: "textPhysicalAddressAnnotations"}, | ||
{type: "text_person_name", name: "Person Name", key: "textPersonNameAnnotations"} | ||
] | ||
{type: 'text_date', name: 'Date', key: 'textDateAnnotations'}, | ||
{type: 'text_physical_address', name: 'Physical Address', key: | ||
'textPhysicalAddressAnnotations'}, | ||
{type: 'text_person_name', name: 'Person Name', key: | ||
'textPersonNameAnnotations'}, | ||
]; | ||
|
||
let allAnnotations; | ||
if (props.annotations === deidentificationStates.EMPTY || props.annotations === deidentificationStates.LOADING || props.annotations === deidentificationStates.ERROR) { | ||
allAnnotations = [] | ||
if (props.annotations === deidentificationStates.EMPTY || | ||
props.annotations === deidentificationStates.LOADING || | ||
props.annotations === deidentificationStates.ERROR) { | ||
allAnnotations = []; | ||
} else { | ||
allAnnotations = types.map( | ||
(type) => props.annotations[type.key].map((annotation, index) => { | ||
return {type: type.name, id: String(type.type)+'_'+String(index), ...annotation}; | ||
}) | ||
return { | ||
type: type.name, | ||
id: String(type.type)+'_'+String(index), | ||
...annotation, | ||
}; | ||
}), | ||
).flat(); | ||
} | ||
|
||
const columns = [ | ||
{field: 'id', headerName: "ID", hide: true}, | ||
{field: 'type', headerName: "Type", width: 125}, | ||
{field: 'text', headerName: "Text", width: 130}, | ||
{field: 'start', headerName: "Start", width: 90}, | ||
{field: 'length', headerName: "Length", width: 100}, | ||
{field: 'confidence', headerName: "Confidence", width: 130} | ||
] | ||
{field: 'id', headerName: 'ID', hide: true}, | ||
{field: 'type', headerName: 'Type', width: 125}, | ||
{field: 'text', headerName: 'Text', width: 130}, | ||
{field: 'start', headerName: 'Start', width: 90}, | ||
{field: 'length', headerName: 'Length', width: 100}, | ||
{field: 'confidence', headerName: 'Confidence', width: 130}, | ||
]; | ||
|
||
return ( | ||
<Paper elevation={3} style={{ height: "400px" }}> | ||
<Paper elevation={3} style={{height: '400px'}}> | ||
<DataGrid rows={allAnnotations} columns={columns}/> | ||
</Paper> | ||
); | ||
} | ||
} | ||
|
||
AnnotationView.propTypes = { | ||
annotations: PropTypes.oneOfType([ | ||
PropTypes.object, | ||
PropTypes.number, | ||
]), | ||
}; | ||
|
||
export default AnnotationView; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding the script
npm run lint
to package.json to make it easy to developer to lint the project. The CI/CD workflow should then rely on the commandnpm run lint
(requires to install dev npm dependencies withnpm install --only=dev
).