Browse Source

codestyle: Force virgules en fin de tableau/objet

master
Mattéo Delabre 1 year ago
parent
commit
efafd9ff5f
Signed by: matteo <spam@delab.re> GPG Key ID: AE3FBD02DC583ABB
6 changed files with 23 additions and 13 deletions
  1. +10
    -0
      app/.eslintrc.json
  2. +2
    -2
      app/src/components/App.js
  3. +1
    -1
      app/src/components/DiseaseGraph.js
  4. +3
    -3
      app/src/components/Graph.js
  5. +5
    -5
      app/src/components/TermInput.js
  6. +2
    -2
      app/src/util.js

+ 10
- 0
app/.eslintrc.json View File

@@ -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"
}
]
}
}

+ 2
- 2
app/src/components/App.js View File

@@ -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


+ 1
- 1
app/src/components/DiseaseGraph.js View File

@@ -22,7 +22,7 @@ const DiseaseGraph = ({
{
const {nodes, edges} = useAsync({
nodes: {},
edges: []
edges: [],
}, symptomsSubgraph, terms);

/**


+ 3
- 3
app/src/components/Graph.js View File

@@ -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,


+ 5
- 5
app/src/components/TermInput.js View File

@@ -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)}


+ 2
- 2
app/src/util.js View File

@@ -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),
]);
},
};


Loading…
Cancel
Save