codestyle: Force virgules en fin de tableau/objet

This commit is contained in:
Mattéo Delabre 2019-12-05 11:04:09 -05:00
parent 3911f8f54f
commit efafd9ff5f
Signed by: matteo
GPG Key ID: AE3FBD02DC583ABB
6 changed files with 23 additions and 13 deletions

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

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

View File

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

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,

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 lentrée courante en lajoutant 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)}

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