codestyle: Force virgules en fin de tableau/objet
This commit is contained in:
		
							parent
							
								
									3911f8f54f
								
							
						
					
					
						commit
						efafd9ff5f
					
				| 
						 | 
				
			
			@ -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"
 | 
			
		||||
            }
 | 
			
		||||
        ]
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,7 +22,7 @@ const DiseaseGraph = ({
 | 
			
		|||
{
 | 
			
		||||
    const {nodes, edges} = useAsync({
 | 
			
		||||
        nodes: {},
 | 
			
		||||
        edges: []
 | 
			
		||||
        edges: [],
 | 
			
		||||
    }, symptomsSubgraph, terms);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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…
	
		Reference in New Issue