Skip to content

Commit

Permalink
Set up basic linting action (#58)
Browse files Browse the repository at this point in the history
* trying to configure basic eslint

* remove unused workflow, try basic linting workflow

* set working directory

* simplify node versioning

* trying a thing

* indent

* define branches

* unset wd

* trying again

* remove empty step

* try printing

* simplify

* reorder

* introduce syntax error

* fix syntax error
  • Loading branch information
Nate-Wessel authored Jun 23, 2023
1 parent e2046e1 commit 8c4304d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 105 deletions.
93 changes: 0 additions & 93 deletions .github/workflows/backend_test.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: JS linting
on:
pull_request:
branches: [ deploy ]

jobs:
linting:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
- run: npm install
- run: npm run lint
8 changes: 2 additions & 6 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,11 @@ module.exports = {
plugins: ["react",'css-modules'],
rules: {
"react/prop-types": 'off',
"react/display-name": 'off',
"react/no-unescaped-entities": 'warn',
"css-modules/no-unused-class": 'off'

"dot-notation": 'warn'
},
settings: {
react: {
version: "detect",
//"pragma": "React",
version: "detect"
}
}
}
12 changes: 7 additions & 5 deletions frontend/src/App/Map/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default class Map extends Component {
this.disableInteractions();
this.removeAllLinkSources();
this.props.getLinks(this);
};
}

/* this function is called only by action.js after full link data is fetch */
displayLinks(linkDataArr, sequence) {
Expand All @@ -135,7 +135,8 @@ export default class Map extends Component {
() => this.enableInteractions() // re-enables buttons
)
this.props.onLinkUpdate(linkDataArr)
};
}

// check if there is already a link drawn in the reverse direction
checkIfLinkDirDrawn(checkCoor, bidirection, other) {
let holdCoorArr = [];
Expand Down Expand Up @@ -175,6 +176,7 @@ export default class Map extends Component {
}
return false;
}

// draw the links on the map
drawLinks(linkDataArr, sequence) {
let linkSources = [];
Expand Down Expand Up @@ -317,7 +319,7 @@ export default class Map extends Component {
linkMouseEnter: tempLinkMouseEnter,
linkMouseLeave: tempLinkMouseLeave
});
};
}
//remove all the drawn links on the map
removeAllLinkSources() {
this.props.removeAllLinks();
Expand Down Expand Up @@ -496,7 +498,7 @@ export default class Map extends Component {
if (nodeCandidateClose) {
nodeCandidateClose();
}
};
}

//removes the last node placed on the map
removeNodes() {
Expand Down Expand Up @@ -655,5 +657,5 @@ export default class Map extends Component {
<NotificationContainer/>
</div>
);
};
}
}
1 change: 0 additions & 1 deletion frontend/src/App/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Map from "./Map"
import { SpatialData } from '../spatialData.js'

import RangeFactory from "./Datetime/Range"
import parseTimePeriods from "./Datetime/TimeRangeParser"
import { getLinksBetweenNodes, getDateBoundaries } from "../actions.js"
import FileSettingsFactory from "./Settings/FileSettings"
import { NotificationContainer, NotificationManager } from 'react-notifications'
Expand Down

0 comments on commit 8c4304d

Please sign in to comment.