diff --git a/app/.eslintrc.json b/app/.eslintrc.json index f547758..dcd0296 100644 --- a/app/.eslintrc.json +++ b/app/.eslintrc.json @@ -49,6 +49,16 @@ "skipStrings": true, "skipTemplates": true } + ], + "comma-dangle": [ + "error", + { + "arrays": "always-multiline", + "objects": "always-multiline", + "imports": "always-multiline", + "exports": "always-multiline", + "functions": "never" + } ] } } diff --git a/app/src/components/App.js b/app/src/components/App.js index 3e19803..2ca31cf 100644 --- a/app/src/components/App.js +++ b/app/src/components/App.js @@ -4,7 +4,7 @@ import DiseaseGraph from './DiseaseGraph.js'; import {useAsync, useQuery} from '../util.js'; import { diseasesBySymptoms, - exploreSymptoms + exploreSymptoms, } from '../data/mock'; const App = () => @@ -12,7 +12,7 @@ const App = () => const { query, addTerm: addQueryTerm, - removeTerm: removeQueryTerm + removeTerm: removeQueryTerm, } = useQuery(); // Récupération des résultats de la recherche diff --git a/app/src/components/DiseaseGraph.js b/app/src/components/DiseaseGraph.js index 2978bb4..47c3dbd 100644 --- a/app/src/components/DiseaseGraph.js +++ b/app/src/components/DiseaseGraph.js @@ -22,7 +22,7 @@ const DiseaseGraph = ({ { const {nodes, edges} = useAsync({ nodes: {}, - edges: [] + edges: [], }, symptomsSubgraph, terms); /** diff --git a/app/src/components/Graph.js b/app/src/components/Graph.js index d8f6730..d8294b2 100644 --- a/app/src/components/Graph.js +++ b/app/src/components/Graph.js @@ -119,11 +119,11 @@ const Graph = ({ edges, emptyMessage, render, - onNodeClick + onNodeClick, }) => { - const [graph,] = useState(new Springy.Graph()); - const [layout,] = useState(new Springy.Layout.ForceDirected( + const [graph] = useState(new Springy.Graph()); + const [layout] = useState(new Springy.Layout.ForceDirected( graph, /* rigidité des arêtes = */ 400, /* répulsion des nœuds = */ 450, diff --git a/app/src/components/TermInput.js b/app/src/components/TermInput.js index 10a5f7a..42d36c8 100644 --- a/app/src/components/TermInput.js +++ b/app/src/components/TermInput.js @@ -39,7 +39,7 @@ const TermInput = ({ list: suggestions, setList: setSuggestions, focus: focusedSuggestion, - setFocus: setFocusedSuggestion + setFocus: setFocusedSuggestion, } = util.useFocusableList(); // Référence au champ de saisie @@ -48,11 +48,11 @@ const TermInput = ({ /** * Valide l’entrée courante en l’ajoutant comme terme de la requête. * - * @param id Identifiant du terme à ajouter dans la requête. + * @param term Terme à ajouter dans la requête. */ - const finalizeInput = id => + const finalizeInput = term => { - addQueryTerm(id); + addQueryTerm(term); setValue(''); setSuggestions([]); @@ -151,7 +151,7 @@ const TermInput = ({ 'TermInput_suggestion', index === focusedSuggestion ? 'TermInput_suggestion-focus' - : '' + : '', ].join(' ')} onMouseEnter={setFocusedSuggestion.bind(null, index)} onClick={finalizeInput.bind(null, suggestion)} diff --git a/app/src/util.js b/app/src/util.js index 1fb875e..357e3e7 100644 --- a/app/src/util.js +++ b/app/src/util.js @@ -89,7 +89,7 @@ export const useFocusableList = () => nextFocus = nextFocus % itemCount; setFocus(nextFocus); - } + }, }; }; @@ -131,7 +131,7 @@ export const useQuery = () => { setQuery([ ...query.slice(0, index), - ...query.slice(index + 1) + ...query.slice(index + 1), ]); }, };