diff --git a/.eslintrc.yaml b/.eslintrc.yaml new file mode 100644 index 0000000..b16b013 --- /dev/null +++ b/.eslintrc.yaml @@ -0,0 +1,69 @@ +--- +parser: babel-eslint +env: + browser: true +extends: [airbnb, plugin:react/recommended] +plugins: [import, react] +settings: + import/resolver: + webpack: + config: webpack.config.js + +rules: + array-callback-return: 1 + arrow-parens: 1 + camelcase: off + class-methods-use-this: 1 + comma-dangle: [1, only-multiline] + consistent-return: 0 + default-case: 0 + dot-notation: 1 + eqeqeq: 1 + guard-for-in: 1 + import/imports-first: 1 + import/no-mutable-exports: 0 + jsx-a11y/anchor-is-valid: [warn, {"aspects": [invalidHref]}] + jsx-a11y/href-no-hash: 'off' + jsx-a11y/label-has-for: 0 + jsx-a11y/no-static-element-interactions: 1 + max-len: [0, 80, 2, {"ignoreComments": true}] + no-bitwise: 1 + no-class-assign: 0 + no-cond-assign: [2, except-parens] + no-continue: 1 + no-else-return: 0 + no-extend-native: 1 + no-fallthrough: 'off' + no-param-reassign: 0 + no-plusplus: 1 + no-prototype-builtins: 1 + no-restricted-syntax: 1 + no-unused-expressions: 1 + no-unused-vars: [1, {"args": none, "vars": local}] + no-use-before-define: 1 + prefer-const: 1 + quote-props: [1, consistent-as-needed] + quotes: 0 + radix: 0 + react/forbid-prop-types: 1 + space-infix-ops: 0 + no-underscore-dangle: [2, {"allowAfterThis": true}] + vars-on-top: 0 + object-curly-newline: [2, {"consistent": true}] + function-paren-newline: [2, "consistent"] + react/no-array-index-key: 1 + jsx-a11y/click-events-have-key-events: 0 + jsx-a11y/no-noninteractive-element-interactions: 1 + prefer-promise-reject-errors: 1 + react/jsx-key: 1 + indent: 1 + import/no-unresolved: 1 + import/extensions: 1 + react/destructuring-assignment: 1 + react/jsx-one-expression-per-line: 1 + react/jsx-wrap-multilines: 1 + operator-linebreak: 1 + lines-between-class-members: 1 + react/no-access-state-in-setstate: 1 + implicit-arrow-linebreak: 1 + jsx-a11y/label-has-associated-control: 1 diff --git a/.travis/travis_install.sh b/.travis/travis_install.sh index ecfce01..1090c0b 100755 --- a/.travis/travis_install.sh +++ b/.travis/travis_install.sh @@ -8,7 +8,7 @@ section "install.base.requirements" firefox --version # Install v1.7 or newer of nginx to support 'if' statement for logging -sudo apt-add-repository -y ppa:nginx/development +sudo apt-add-repository -y ppa:nginx/stable sudo apt update sudo apt install -y nginx diff --git a/baselayer b/baselayer index 48d785a..2bb7e61 160000 --- a/baselayer +++ b/baselayer @@ -1 +1 @@ -Subproject commit 48d785a5a05ae51bc5287ae9d6faa90808e75d25 +Subproject commit 2bb7e612d08b5376e66de2fcf9b0172a7958580a diff --git a/static/js/components/FoldableRow.jsx b/static/js/components/FoldableRow.jsx index f081d26..5c72f34 100644 --- a/static/js/components/FoldableRow.jsx +++ b/static/js/components/FoldableRow.jsx @@ -8,7 +8,8 @@ * The second element can be, e.g., another row in the table. * */ -import React, { Component, PropTypes } from 'react'; +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import colorScheme from './colorscheme'; const cs = colorScheme; diff --git a/static/js/components/Plot.jsx b/static/js/components/Plot.jsx index 3d2335e..2a7fe6f 100644 --- a/static/js/components/Plot.jsx +++ b/static/js/components/Plot.jsx @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { showNotification } from 'baselayer/components/Notifications'; /* eslint-disable */ @@ -71,8 +72,8 @@ class Plot extends Component { } } Plot.propTypes = { - url: React.PropTypes.string.isRequired, - dispatch: React.PropTypes.func.isRequired + url: PropTypes.string.isRequired, + dispatch: PropTypes.func.isRequired }; Plot = connect()(Plot); diff --git a/static/js/components/Progress.jsx b/static/js/components/Progress.jsx index 241e227..3643caa 100644 --- a/static/js/components/Progress.jsx +++ b/static/js/components/Progress.jsx @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; const Progress = (props) => { let response = ''; @@ -25,7 +26,7 @@ const Progress = (props) => { }; Progress.propTypes = { - type: React.PropTypes.string.isRequired + type: PropTypes.string.isRequired }; export default Progress; diff --git a/static/js/components/Projects.jsx b/static/js/components/Projects.jsx index 8398a0d..c8eb706 100644 --- a/static/js/components/Projects.jsx +++ b/static/js/components/Projects.jsx @@ -1,4 +1,5 @@ -import React, { PropTypes } from 'react'; +import React from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { reduxForm } from 'redux-form'; diff --git a/static/js/components/UserProfile.jsx b/static/js/components/UserProfile.jsx index 36d67c6..71febf2 100644 --- a/static/js/components/UserProfile.jsx +++ b/static/js/components/UserProfile.jsx @@ -1,12 +1,13 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { connect } from 'react-redux'; let UserProfile = props => (
{props.profile.username}
); UserProfile.propTypes = { - style: React.PropTypes.object.isRequired, - profile: React.PropTypes.object.isRequired + style: PropTypes.object.isRequired, + profile: PropTypes.object.isRequired }; const mapStateToProps = state => (