diff --git a/.editorconfig b/.editorconfig index c4d1ace90..12c25393b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -258,7 +258,7 @@ dotnet_diagnostic.CA5401.severity = suggestion dotnet_diagnostic.SYSLIB0014.severity = none -[*.{js,html,js,hbs,less,css}] +[*.{js,jsx,ts,tsx,html,hbs,less,css}] charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index 99609a2da..484650bb0 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -1,16 +1,16 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires +// eslint-disable @typescript-eslint/no-var-requires const fs = require('fs'); -// eslint-disable-next-line @typescript-eslint/no-var-requires +const path = require('path'); const typescriptEslintRecommended = require('@typescript-eslint/eslint-plugin').configs.recommended; +const frontendFolder = __dirname; + const dirs = fs - .readdirSync('frontend/src', { withFileTypes: true }) + .readdirSync(path.join(frontendFolder, 'src'), { withFileTypes: true }) .filter((dirent) => dirent.isDirectory()) .map((dirent) => dirent.name) .join('|'); -const frontendFolder = __dirname; - module.exports = { parser: '@babel/eslint-parser', diff --git a/frontend/src/Components/TagList.js b/frontend/src/Components/TagList.js index 485651bdc..f4d4e2af4 100644 --- a/frontend/src/Components/TagList.js +++ b/frontend/src/Components/TagList.js @@ -1,4 +1,3 @@ -import _ from 'lodash'; import PropTypes from 'prop-types'; import React from 'react'; import { kinds } from 'Helpers/Props'; @@ -6,16 +5,15 @@ import Label from './Label'; import styles from './TagList.css'; function TagList({ tags, tagList }) { + const sortedTags = tags + .map((tagId) => tagList.find((tag) => tag.id === tagId)) + .filter((t) => t !== undefined) + .sort((a, b) => a.label.localeCompare(b.label)); + return (
{ - tags.map((t) => { - const tag = _.find(tagList, { id: t }); - - if (!tag) { - return null; - } - + sortedTags.map((tag) => { return (