codestyle: Force virgules en fin de tableau/objet
This commit is contained in:
parent
3911f8f54f
commit
efafd9ff5f
|
@ -49,6 +49,16 @@
|
||||||
"skipStrings": true,
|
"skipStrings": true,
|
||||||
"skipTemplates": true
|
"skipTemplates": true
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"comma-dangle": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"arrays": "always-multiline",
|
||||||
|
"objects": "always-multiline",
|
||||||
|
"imports": "always-multiline",
|
||||||
|
"exports": "always-multiline",
|
||||||
|
"functions": "never"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import DiseaseGraph from './DiseaseGraph.js';
|
||||||
import {useAsync, useQuery} from '../util.js';
|
import {useAsync, useQuery} from '../util.js';
|
||||||
import {
|
import {
|
||||||
diseasesBySymptoms,
|
diseasesBySymptoms,
|
||||||
exploreSymptoms
|
exploreSymptoms,
|
||||||
} from '../data/mock';
|
} from '../data/mock';
|
||||||
|
|
||||||
const App = () =>
|
const App = () =>
|
||||||
|
@ -12,7 +12,7 @@ const App = () =>
|
||||||
const {
|
const {
|
||||||
query,
|
query,
|
||||||
addTerm: addQueryTerm,
|
addTerm: addQueryTerm,
|
||||||
removeTerm: removeQueryTerm
|
removeTerm: removeQueryTerm,
|
||||||
} = useQuery();
|
} = useQuery();
|
||||||
|
|
||||||
// Récupération des résultats de la recherche
|
// Récupération des résultats de la recherche
|
||||||
|
|
|
@ -22,7 +22,7 @@ const DiseaseGraph = ({
|
||||||
{
|
{
|
||||||
const {nodes, edges} = useAsync({
|
const {nodes, edges} = useAsync({
|
||||||
nodes: {},
|
nodes: {},
|
||||||
edges: []
|
edges: [],
|
||||||
}, symptomsSubgraph, terms);
|
}, symptomsSubgraph, terms);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -119,11 +119,11 @@ const Graph = ({
|
||||||
edges,
|
edges,
|
||||||
emptyMessage,
|
emptyMessage,
|
||||||
render,
|
render,
|
||||||
onNodeClick
|
onNodeClick,
|
||||||
}) =>
|
}) =>
|
||||||
{
|
{
|
||||||
const [graph,] = useState(new Springy.Graph());
|
const [graph] = useState(new Springy.Graph());
|
||||||
const [layout,] = useState(new Springy.Layout.ForceDirected(
|
const [layout] = useState(new Springy.Layout.ForceDirected(
|
||||||
graph,
|
graph,
|
||||||
/* rigidité des arêtes = */ 400,
|
/* rigidité des arêtes = */ 400,
|
||||||
/* répulsion des nœuds = */ 450,
|
/* répulsion des nœuds = */ 450,
|
||||||
|
|
|
@ -39,7 +39,7 @@ const TermInput = ({
|
||||||
list: suggestions,
|
list: suggestions,
|
||||||
setList: setSuggestions,
|
setList: setSuggestions,
|
||||||
focus: focusedSuggestion,
|
focus: focusedSuggestion,
|
||||||
setFocus: setFocusedSuggestion
|
setFocus: setFocusedSuggestion,
|
||||||
} = util.useFocusableList();
|
} = util.useFocusableList();
|
||||||
|
|
||||||
// Référence au champ de saisie
|
// 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.
|
* 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('');
|
setValue('');
|
||||||
setSuggestions([]);
|
setSuggestions([]);
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ const TermInput = ({
|
||||||
'TermInput_suggestion',
|
'TermInput_suggestion',
|
||||||
index === focusedSuggestion
|
index === focusedSuggestion
|
||||||
? 'TermInput_suggestion-focus'
|
? 'TermInput_suggestion-focus'
|
||||||
: ''
|
: '',
|
||||||
].join(' ')}
|
].join(' ')}
|
||||||
onMouseEnter={setFocusedSuggestion.bind(null, index)}
|
onMouseEnter={setFocusedSuggestion.bind(null, index)}
|
||||||
onClick={finalizeInput.bind(null, suggestion)}
|
onClick={finalizeInput.bind(null, suggestion)}
|
||||||
|
|
|
@ -89,7 +89,7 @@ export const useFocusableList = () =>
|
||||||
nextFocus = nextFocus % itemCount;
|
nextFocus = nextFocus % itemCount;
|
||||||
|
|
||||||
setFocus(nextFocus);
|
setFocus(nextFocus);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ export const useQuery = () =>
|
||||||
{
|
{
|
||||||
setQuery([
|
setQuery([
|
||||||
...query.slice(0, index),
|
...query.slice(0, index),
|
||||||
...query.slice(index + 1)
|
...query.slice(index + 1),
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue