Просмотр исходного кода

Merge pull request #878 from weseek/imprv/organize-eslint-react-rules

Imprv/organize eslint react rules
Yuki Takei 7 лет назад
Родитель
Сommit
502fa9acbc

+ 0 - 1
.eslintrc.js

@@ -111,7 +111,6 @@ module.exports = {
       'warn',
       { extensions: ['.jsx']},
     ],
-    'react/no-unused-prop-types': 'off',
     'react/jsx-one-expression-per-line': 'off',
     'react/no-access-state-in-setstate': 'off',
     'react/prefer-stateless-function': 'off',

+ 1 - 3
src/client/js/app.js

@@ -314,7 +314,7 @@ if (pageId) {
   componentMappings['page-attachment'] = <PageAttachment pageId={pageId} markdown={markdown} crowi={crowi} />;
 }
 if (pagePath) {
-  componentMappings.page = <Page crowi={crowi} crowiRenderer={crowiRenderer} markdown={markdown} pagePath={pagePath} showHeadEditButton onSaveWithShortcut={saveWithShortcut} />;
+  componentMappings.page = <Page crowi={crowi} crowiRenderer={crowiRenderer} markdown={markdown} pagePath={pagePath} onSaveWithShortcut={saveWithShortcut} />;
   componentMappings['revision-path'] = <RevisionPath pagePath={pagePath} crowi={crowi} />;
   // componentMappings['page-tag'] = <PageTagForm pageTags={currentPageTags} submitTags={getNewPageTags} />; [pagetag]
   componentMappings['revision-url'] = <RevisionUrl pageId={pageId} pagePath={pagePath} />;
@@ -381,7 +381,6 @@ if (savePageControlsElem) {
             }
           }}
         pageId={pageId}
-        pagePath={pagePath}
         slackChannels={slackChannels}
         grant={grant}
         grantGroupId={grantGroupId}
@@ -512,7 +511,6 @@ if (pageStatusAlertElem) {
   ReactDOM.render(
     <I18nextProvider i18n={i18n}>
       <PageStatusAlert
-        crowi={crowi}
         ref={(elem) => {
             if (pageStatusAlert == null) {
               pageStatusAlert = elem.getWrappedInstance();

+ 0 - 1
src/client/js/components/Page.jsx

@@ -69,5 +69,4 @@ Page.propTypes = {
   onSaveWithShortcut: PropTypes.func.isRequired,
   markdown: PropTypes.string.isRequired,
   pagePath: PropTypes.string.isRequired,
-  showHeadEditButton: PropTypes.bool,
 };

+ 0 - 3
src/client/js/components/PageComment/CommentForm.jsx

@@ -337,9 +337,6 @@ export default class CommentForm extends React.Component {
                           && (
                           <div className="form-inline align-self-center mr-md-2">
                             <SlackNotification
-                              crowi={this.props.crowi}
-                              pageId={this.props.pageId}
-                              pagePath={this.props.pagePath}
                               isSlackEnabled={this.state.isSlackEnabled}
                               slackChannels={this.state.slackChannels}
                               onEnabledFlagChange={this.onSlackEnabledFlagChange}

+ 2 - 0
src/client/js/components/PageEditor/AbstractEditor.js

@@ -1,3 +1,5 @@
+/* eslint-disable react/no-unused-prop-types */
+
 import React from 'react';
 import PropTypes from 'prop-types';
 

+ 0 - 1
src/client/js/components/PageStatusAlert.jsx

@@ -134,7 +134,6 @@ class PageStatusAlert extends React.Component {
 
 PageStatusAlert.propTypes = {
   t: PropTypes.func.isRequired, // i18next
-  crowi: PropTypes.object.isRequired,
   hasDraftOnHackmd: PropTypes.bool.isRequired,
   revisionId: PropTypes.string,
   revisionIdHackmdSynced: PropTypes.string,

+ 0 - 4
src/client/js/components/SavePageControls.jsx

@@ -64,9 +64,6 @@ class SavePageControls extends React.PureComponent {
           <div className="mr-2">
             <SlackNotification
               ref={(c) => { this.slackNotification = c }}
-              crowi={this.props.crowi}
-              pageId={this.props.pageId}
-              pagePath={this.props.pagePath}
               isSlackEnabled={false}
               slackChannels={this.props.slackChannels}
             />
@@ -118,7 +115,6 @@ SavePageControls.propTypes = {
   onSubmit: PropTypes.func.isRequired,
   pageId: PropTypes.string,
   // for SlackNotification
-  pagePath: PropTypes.string,
   slackChannels: PropTypes.string,
   // for GrantSelector
   grant: PropTypes.number,

+ 0 - 3
src/client/js/components/SlackNotification.jsx

@@ -79,9 +79,6 @@ export default class SlackNotification extends React.Component {
 }
 
 SlackNotification.propTypes = {
-  crowi: PropTypes.object.isRequired,
-  pageId: PropTypes.string,
-  pagePath: PropTypes.string,
   isSlackEnabled: PropTypes.bool,
   slackChannels: PropTypes.string,
   onChannelChange: PropTypes.func,