Browse Source

chore(eslint): Bump to latest eslint-sentry config (#12303)

Evan Purkhiser 6 years ago
parent
commit
6538f7ef53

+ 1 - 1
package.json

@@ -111,7 +111,7 @@
     "enzyme-adapter-react-16": "1.3.0",
     "enzyme-to-json": "3.3.1",
     "eslint": "5.11.1",
-    "eslint-config-sentry-app": "1.6.1",
+    "eslint-config-sentry-app": "1.7.0",
     "jest": "24.1.0",
     "jest-junit": "^3.4.1",
     "mockdate": "2.0.2",

+ 6 - 6
src/sentry/static/sentry/app/components/errorBoundary.jsx

@@ -37,12 +37,6 @@ class ErrorBoundary extends React.Component {
     );
   }
 
-  componentWillUnmount() {
-    if (this.unlistenBrowserHistory) {
-      this.unlistenBrowserHistory();
-    }
-  }
-
   componentDidCatch(error, errorInfo) {
     this.setState({error});
     Sentry.withScope(scope => {
@@ -51,6 +45,12 @@ class ErrorBoundary extends React.Component {
     });
   }
 
+  componentWillUnmount() {
+    if (this.unlistenBrowserHistory) {
+      this.unlistenBrowserHistory();
+    }
+  }
+
   render() {
     if (this.state.error) {
       const {customComponent, mini, message, className} = this.props;

+ 3 - 2
src/sentry/static/sentry/app/components/events/contexts/user.jsx

@@ -5,6 +5,7 @@ import _ from 'lodash';
 
 import Avatar from 'app/components/avatar';
 import ErrorBoundary from 'app/components/errorBoundary';
+import ExternalLink from 'app/components/externalLink';
 import KeyValueList from 'app/components/events/interfaces/keyValueList';
 
 const EMAIL_REGEX = /[^@]+@[^\.]+\..+/;
@@ -27,9 +28,9 @@ class UserContextType extends React.Component {
         <pre>
           {user.email}
           {EMAIL_REGEX.test(user.email) && (
-            <a href={`mailto:${user.email}`} target="_blank" className="external-icon">
+            <ExternalLink href={`mailto:${user.email}`} className="external-icon">
               <em className="icon-envelope" />
-            </a>
+            </ExternalLink>
           )}
         </pre>,
       ]);

+ 1 - 1
src/sentry/static/sentry/app/components/events/interfaces/exceptionMechanism.jsx

@@ -27,7 +27,7 @@ class ExceptionMechanism extends React.Component {
         }),
         signal: PropTypes.shape({
           number: PropTypes.number.isRequired,
-          code: PropTypes.nubmer,
+          code: PropTypes.number,
           name: PropTypes.string,
           code_name: PropTypes.string,
         }),

+ 2 - 2
src/sentry/static/sentry/app/components/events/interfaces/frame.jsx

@@ -9,6 +9,7 @@ import {defined, objectIsEmpty, isUrl} from 'app/utils';
 import {t} from 'app/locale';
 import ClippedBox from 'app/components/clippedBox';
 import ContextLine from 'app/components/events/interfaces/contextLine';
+import ExternalLink from 'app/components/externalLink';
 import FrameRegisters from 'app/components/events/interfaces/frameRegisters';
 import FrameVariables from 'app/components/events/interfaces/frameVariables';
 import StrictClick from 'app/components/strictClick';
@@ -154,11 +155,10 @@ const Frame = createReactClass({
 
       if (isUrl(data.absPath)) {
         title.push(
-          <a
+          <ExternalLink
             href={data.absPath}
             className="icon-open"
             key="share"
-            target="_blank"
             onClick={this.preventCollapse}
           />
         );

+ 1 - 1
src/sentry/static/sentry/app/components/forms/formField.jsx

@@ -31,7 +31,7 @@ export default class FormField extends React.PureComponent {
 
     // the following should only be used without form context
     onChange: PropTypes.func,
-    error: PropTypes.string,
+    error: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
     value: PropTypes.any,
   };
 

+ 4 - 0
src/sentry/static/sentry/app/components/search/sources/apiSource.jsx

@@ -8,6 +8,7 @@ import {Client} from 'app/api';
 import {createFuzzySearch} from 'app/utils/createFuzzySearch';
 import {singleLineRenderer as markedSingleLine} from 'app/utils/marked';
 import {t} from 'app/locale';
+import SentryTypes from 'app/sentryTypes';
 import withLatestContext from 'app/utils/withLatestContext';
 
 // event ids must have string length of 32
@@ -163,6 +164,9 @@ class ApiSource extends React.Component {
     // fuse.js options
     searchOptions: PropTypes.object,
 
+    // Organization used for search context
+    organization: SentryTypes.Organization,
+
     /**
      * Render function that passes:
      * `isLoading` - loading state

+ 7 - 7
src/sentry/static/sentry/app/views/groupDetails/shared/eventToolbar.jsx

@@ -1,17 +1,17 @@
 import {Link} from 'react-router';
-import moment from 'moment-timezone';
 import PropTypes from 'prop-types';
 import React from 'react';
-
 import createReactClass from 'create-react-class';
+import moment from 'moment-timezone';
 
+import {t} from 'app/locale';
 import ConfigStore from 'app/stores/configStore';
-import SentryTypes from 'app/sentryTypes';
-import getDynamicText from 'app/utils/getDynamicText';
 import DateTime from 'app/components/dateTime';
+import ExternalLink from 'app/components/externalLink';
 import FileSize from 'app/components/fileSize';
+import SentryTypes from 'app/sentryTypes';
 import Tooltip from 'app/components/tooltip';
-import {t} from 'app/locale';
+import getDynamicText from 'app/utils/getDynamicText';
 
 const formatDateDelta = (reference, observed) => {
   const duration = moment.duration(Math.abs(+observed - +reference));
@@ -184,9 +184,9 @@ const GroupEventToolbar = createReactClass({
               {isOverLatencyThreshold && <span className="icon-alert" />}
             </span>
           </Tooltip>
-          <a href={jsonUrl} target="_blank" className="json-link">
+          <ExternalLink href={jsonUrl} className="json-link">
             {'JSON'} (<FileSize bytes={evt.size} />)
-          </a>
+          </ExternalLink>
         </span>
       </div>
     );

+ 9 - 12
src/sentry/static/sentry/app/views/groupDetails/shared/groupTagValues.jsx

@@ -1,19 +1,20 @@
-import React from 'react';
-import createReactClass from 'create-react-class';
 import {Link} from 'react-router';
 import {sortBy, property, isEqual} from 'lodash';
 import PropTypes from 'prop-types';
+import React from 'react';
+import createReactClass from 'create-react-class';
 
-import SentryTypes from 'app/sentryTypes';
+import {isUrl, percent} from 'app/utils';
+import {t} from 'app/locale';
 import ApiMixin from 'app/mixins/apiMixin';
 import Avatar from 'app/components/avatar';
+import DeviceName from 'app/components/deviceName';
+import ExternalLink from 'app/components/externalLink';
 import LoadingError from 'app/components/loadingError';
 import LoadingIndicator from 'app/components/loadingIndicator';
 import Pagination from 'app/components/pagination';
+import SentryTypes from 'app/sentryTypes';
 import TimeSince from 'app/components/timeSince';
-import DeviceName from 'app/components/deviceName';
-import {isUrl, percent} from 'app/utils';
-import {t} from 'app/locale';
 import withOrganization from 'app/utils/withOrganization';
 
 const GroupTagValues = createReactClass({
@@ -139,13 +140,9 @@ const GroupTagValues = createReactClass({
               )}
             </Link>
             {tagValue.email && (
-              <a
-                href={`mailto:${tagValue.email}`}
-                target="_blank"
-                className="external-icon"
-              >
+              <ExternalLink href={`mailto:${tagValue.email}`} className="external-icon">
                 <em className="icon-envelope" />
-              </a>
+              </ExternalLink>
             )}
             {isUrl(tagValue.value) && (
               <a href={tagValue.value} className="external-icon">

+ 1 - 0
src/sentry/static/sentry/app/views/organizationDashboard/widgetChart.jsx

@@ -28,6 +28,7 @@ class WidgetChart extends React.Component {
     widget: SentryTypes.Widget,
     organization: SentryTypes.Organization,
     selection: SentryTypes.GlobalSelection,
+    reloading: PropTypes.bool,
   };
 
   shouldComponentUpdate(nextProps) {

Some files were not shown because too many files changed in this diff