Commit ebe42bc4 authored by Florent Chehab's avatar Florent Chehab
Browse files

Finish reorganizing frontend and imports are finally linted ! youpiiiii

parent 81f10fe3
......@@ -6,7 +6,9 @@ module.exports = {
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
"plugin:react/recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"parser": "babel-eslint",
"parserOptions": {
......@@ -19,6 +21,7 @@ module.exports = {
"plugins": [
"react",
"jest",
"import",
],
"rules": {
"indent": [
......
{
"name": "outgoing_rex",
"name": "rex-dri",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
......@@ -2782,6 +2782,12 @@
"integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=",
"dev": true
},
"contains-path": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz",
"integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=",
"dev": true
},
"content-disposition": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
......@@ -3681,6 +3687,255 @@
}
}
},
"eslint-import-resolver-node": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz",
"integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==",
"dev": true,
"requires": {
"debug": "^2.6.9",
"resolve": "^1.5.0"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
}
}
},
"eslint-module-utils": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.3.0.tgz",
"integrity": "sha512-lmDJgeOOjk8hObTysjqH7wyMi+nsHwwvfBykwfhjR1LNdd7C2uFJBvx4OpWYpXOw4df1yE1cDEVd1yLHitk34w==",
"dev": true,
"requires": {
"debug": "^2.6.8",
"pkg-dir": "^2.0.0"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"find-up": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
"integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
"dev": true,
"requires": {
"locate-path": "^2.0.0"
}
},
"locate-path": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
"integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
"dev": true,
"requires": {
"p-locate": "^2.0.0",
"path-exists": "^3.0.0"
}
},
"p-limit": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
"integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
"dev": true,
"requires": {
"p-try": "^1.0.0"
}
},
"p-locate": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
"integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
"dev": true,
"requires": {
"p-limit": "^1.1.0"
}
},
"p-try": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
"integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
"dev": true
},
"pkg-dir": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz",
"integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=",
"dev": true,
"requires": {
"find-up": "^2.1.0"
}
}
}
},
"eslint-plugin-import": {
"version": "2.16.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.16.0.tgz",
"integrity": "sha512-z6oqWlf1x5GkHIFgrSvtmudnqM6Q60KM4KvpWi5ubonMjycLjndvd5+8VAZIsTlHC03djdgJuyKG6XO577px6A==",
"dev": true,
"requires": {
"contains-path": "^0.1.0",
"debug": "^2.6.9",
"doctrine": "1.5.0",
"eslint-import-resolver-node": "^0.3.2",
"eslint-module-utils": "^2.3.0",
"has": "^1.0.3",
"lodash": "^4.17.11",
"minimatch": "^3.0.4",
"read-pkg-up": "^2.0.0",
"resolve": "^1.9.0"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"requires": {
"ms": "2.0.0"
}
},
"doctrine": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz",
"integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
"dev": true,
"requires": {
"esutils": "^2.0.2",
"isarray": "^1.0.0"
}
},
"eslint-import-resolver-node": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz",
"integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==",
"dev": true,
"requires": {
"debug": "^2.6.9",
"resolve": "^1.5.0"
}
},
"find-up": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
"integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
"dev": true,
"requires": {
"locate-path": "^2.0.0"
}
},
"load-json-file": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
"integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=",
"dev": true,
"requires": {
"graceful-fs": "^4.1.2",
"parse-json": "^2.2.0",
"pify": "^2.0.0",
"strip-bom": "^3.0.0"
}
},
"locate-path": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
"integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
"dev": true,
"requires": {
"p-locate": "^2.0.0",
"path-exists": "^3.0.0"
}
},
"p-limit": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
"integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
"dev": true,
"requires": {
"p-try": "^1.0.0"
}
},
"p-locate": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
"integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
"dev": true,
"requires": {
"p-limit": "^1.1.0"
}
},
"p-try": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
"integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
"dev": true
},
"parse-json": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
"integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
"dev": true,
"requires": {
"error-ex": "^1.2.0"
}
},
"path-type": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz",
"integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=",
"dev": true,
"requires": {
"pify": "^2.0.0"
}
},
"pify": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
"dev": true
},
"read-pkg": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz",
"integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=",
"dev": true,
"requires": {
"load-json-file": "^2.0.0",
"normalize-package-data": "^2.3.2",
"path-type": "^2.0.0"
}
},
"read-pkg-up": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz",
"integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=",
"dev": true,
"requires": {
"find-up": "^2.0.0",
"read-pkg": "^2.0.0"
}
},
"strip-bom": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
"integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
"dev": true
}
}
},
"eslint-plugin-jest": {
"version": "22.3.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-22.3.0.tgz",
......
{
"name": "outgoing_rex",
"name": "rex-dri",
"version": "1.0.0",
"description": "[![build](/../badges/master/build.svg)](https://gitlab.utc.fr/chehabfl/outgoing_rex/pipelines) [![coverage](/../badges/master/coverage.svg)](https://chehabfl.gitlab.utc.fr/outgoing_rex/) [![License](https://img.shields.io/badge/License-BSD%202--Clause-green.svg)](https://opensource.org/licenses/BSD-2-Clause)",
"main": "manage.py",
......@@ -59,6 +59,8 @@
"babel-loader": "^8.0.5",
"css-loader": "^2.1.0",
"eslint": "^5.14.1",
"eslint-import-resolver-node": "^0.3.2",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jest": "^22.3.0",
"eslint-plugin-react": "^7.12.4",
"file-loader": "^3.0.1",
......
......@@ -16,24 +16,24 @@ import Chip from "@material-ui/core/Chip";
import Avatar from "@material-ui/core/Avatar";
import ChevronLeftIcon from "@material-ui/icons/ChevronLeft";
import SchoolIcon from "@material-ui/icons/School";
import { mainListItems, secondaryListItems, thirdListItems } from "./appRelated/listItems";
import FullScreenDialog from "./appRelated/FullScreenDialog";
import { mainListItems, secondaryListItems, thirdListItems } from "./listItems";
import FullScreenDialog from "./FullScreenDialog";
import { connect } from "react-redux";
import CustomComponentForAPI from "./CustomComponentForAPI";
import CustomComponentForAPI from "../common/CustomComponentForAPI";
import {
Route,
Redirect
} from "react-router-dom";
import getActions from "../api/getActions";
import getActions from "../../redux/api/getActions";
import PageMap from "./pages/PageMap";
import PageHome from "./pages/PageHome";
import PageUniversity from "./pages/PageUniversity";
import PageSearch from "./pages/PageSearch";
import PageSettings from "./pages/PageSettings";
import PageMap from "../pages/PageMap";
import PageHome from "../pages/PageHome";
import PageUniversity from "../pages/PageUniversity";
import PageSearch from "../pages/PageSearch";
import PageSettings from "../pages/PageSettings";
const DRAWER_WIDTH = 240;
......
/**
* This file contains the general site tempalte
* This file contains the general site template
*/
import React from "react";
......
import React, { Component } from "react";
import Loading from "./other/Loading";
import Loading from "./Loading";
import PropTypes from "prop-types";
import { successActionsWithReads, getLatestRead } from "../../api/utils";
import { successActionsWithReads, getLatestRead } from "../../redux/api/utils";
class CustomComponentForAPI extends Component {
customErrorHandlers = {}
......
......@@ -21,7 +21,7 @@ import Paper from "@material-ui/core/Paper";
import { lighten, darken } from "@material-ui/core/styles/colorManipulator";
import Divider from "@material-ui/core/Divider";
import LinkText from "../other/TextLink";
import TextLink from "../common/TextLink";
// Custom styling for the rendered markdown
const styles = theme => {
......@@ -171,7 +171,7 @@ const renderers = {
list: withStyles(styles, { withTheme: true })(ListRenderer),
listItem: withStyles(styles, { withTheme: true })(ListItemRenderer),
paragraph: (props) => <Typography paragraph >{props.children}</Typography>,
link: props => <LinkText {...props} />,
link: props => <TextLink {...props} />,
code: withStyles(styles, { withTheme: true })(CodeRenderer),
inlineCode: withStyles(styles, { withTheme: true })(InlineCodeRenderer),
blockquote: withStyles(styles, { withTheme: true })(BlockquoteRenderer),
......
......@@ -11,9 +11,9 @@ import "typeface-roboto";
import areSameThemes from "../../utils/areSameThemes";
import getActions from "../../api/getActions";
import getActions from "../../redux/api/getActions";
import { saveAppTheme } from "../../actions/theme";
import { saveAppTheme } from "../../redux/actions/theme";
/**
......
......@@ -24,11 +24,11 @@ import React from "react";
import PropTypes from "prop-types";
import DownshiftMultiple from "./DownshiftMultiple";
import CustomComponentForAPI from "../CustomComponentForAPI";
import CustomComponentForAPI from "../common/CustomComponentForAPI";
import { connect } from "react-redux";
import __map from "lodash/map";
import __indexOf from "lodash/indexOf";
import { saveSelectedUniversities, saveFilterConfig } from "../../actions/filter";
import { saveSelectedUniversities, saveFilterConfig } from "../../redux/actions/filter";
import ExpansionPanel from "@material-ui/core/ExpansionPanel";
import ExpansionPanelSummary from "@material-ui/core/ExpansionPanelSummary";
import ExpansionPanelDetails from "@material-ui/core/ExpansionPanelDetails";
......@@ -36,7 +36,7 @@ import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
import Typography from "@material-ui/core/Typography";
import withStyles from "@material-ui/core/styles/withStyles";
import getActions from "../../api/getActions";
import getActions from "../../redux/api/getActions";
/**
......
......@@ -3,7 +3,7 @@ import PropTypes from "prop-types";
import areSameObjects from "../../utils/areSameObjects";
import renderFieldsMixIn from "./renderFieldsMixIn";
import CustomError from "../../utils/CustomError";
import CustomError from "../common/CustomError";
/**
* React component that should contain `Field` instances.
......
......@@ -9,10 +9,10 @@ import format from "date-fns/format";
import KeyboardArrowLeftIcon from "@material-ui/icons/KeyboardArrowLeft";
import KeyboardArrowRightIcon from "@material-ui/icons/KeyboardArrowRight";
import dateToDateStr from "../../../../utils/dateToDateStr";
import dateToDateStr from "../../../utils/dateToDateStr";
import Field from "./Field";
import CustomError from "../../../../utils/CustomError";
import CustomError from "../../common/CustomError";
/**
* Class to customize the header of the date selection box
......
import React from "react";
import { PureComponent } from "react";
import React, { PureComponent } from "react";
import PropTypes from "prop-types";
import Form from "../Form";
import FieldWrapper from "./FieldWrapper";
// eslint-disable-next-line no-unused-vars
import CustomError from "../../../../utils/CustomError";
import CustomError from "../../common/CustomError";
/**
* Class that handle fields logic
......
......@@ -7,7 +7,7 @@ import compose from "recompose/compose";
import FormControl from "@material-ui/core/FormControl";
import FormLabel from "@material-ui/core/FormLabel";
import FormHelperText from "@material-ui/core/FormHelperText";
import CustomError from "../../../../utils/CustomError";
import CustomError from "../../common/CustomError";
/**
......
......@@ -6,11 +6,11 @@ import Grid from "@material-ui/core/Grid";
import TextField from "@material-ui/core/TextField";
import Typography from "@material-ui/core/Typography";
import Markdown from "../../../shared/Markdown";
import LinkText from "../../../other/TextLink";
import Markdown from "../../common/Markdown";
import Field from "./Field";
import CustomError from "../../../../utils/CustomError";
import TextLink from "../../common/TextLink";
import CustomError from "../../common/CustomError";
class MarkdownField extends Field {
......@@ -53,7 +53,7 @@ class MarkdownField extends Field {
<Grid item xs={12} md={12} lg={6}>
<Typography variant='caption'>
<em>Saisie du texte
(ce champ supporte en grande partie la syntaxe <LinkText href="https://www.markdownguide.org/basic-syntax">Markdown</LinkText>)
(ce champ supporte en grande partie la syntaxe <TextLink href="https://www.markdownguide.org/basic-syntax">Markdown</TextLink>)
</em>
</Typography>
{
......
......@@ -8,7 +8,7 @@ import Select from "@material-ui/core/Select";
import Checkbox from "@material-ui/core/Checkbox";
import Field from "./Field";
import CustomError from "../../../../utils/CustomError";
import CustomError from "../../common/CustomError";
class MultiSelectField extends Field {
......
......@@ -5,7 +5,7 @@ import TextField from "@material-ui/core/TextField";
import Typography from "@material-ui/core/Typography";
import Field from "./Field";
import CustomError from "../../../../utils/CustomError";
import CustomError from "../../common/CustomError";
class NumberField extends Field {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment