Skip to content

Commit

Permalink
lint: improve eslint config and run JS lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Cosmo Qiu authored and Cosmo Qiu committed Mar 2, 2019
1 parent 5373298 commit 2e36629
Show file tree
Hide file tree
Showing 10 changed files with 177 additions and 33 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ module.exports = {
"new-cap": 0,
"eol-last": 0,
"jsx-quotes": 0,
"consistent-return": 0
"consistent-return": 0,
"import/no-named-default": 0,
},
"parser": "babel-eslint",
"plugins": [
"standard",
"react"
Expand Down
2 changes: 1 addition & 1 deletion app/containers/aboutPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AboutPage extends Component {
const licenseList = []
/* Add Evil icons license as an exception */
licenseList.push(
<div key='Evil [email protected]' className='license-item'>
<div key ='Evil [email protected]' className='license-item'>
<div className='license-project'>Evil [email protected]</div>
<div className='license-type'>License: MIT</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/containers/gistEditorForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ const selector = formValueSelector('gistEditorForm')
const GistEditorForm = connect(
state => {
const gistFiles = selector(state, 'gistFiles')
const filenameList = gistFiles && gistFiles.map(({filename}) =>
const filenameList = gistFiles && gistFiles.map(({ filename }) =>
filename)
return {
filenameList
Expand Down
2 changes: 1 addition & 1 deletion app/containers/searchPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
selectGist,
fetchSingleGist,
updateSearchWindowStatus,
updatescrollRequestStatus} from '../../actions'
updatescrollRequestStatus } from '../../actions'

import './index.scss'

Expand Down
14 changes: 7 additions & 7 deletions app/containers/snippet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class Snippet extends Component {

updateGistsStoreWithUpdatedGist (gistDetails) {
const { gists, activeGist, gistTags, activeGistTag, updateSingleGist,
updateGistTags, selectGistTag, searchIndex} = this.props
updateGistTags, selectGistTag, searchIndex } = this.props

const gistId = gistDetails.id
const files = gistDetails.files
Expand Down Expand Up @@ -395,25 +395,25 @@ class Snippet extends Component {
title='Edit'
href='#'
onClick={ this.showGistEditorModal.bind(this) }>
<div dangerouslySetInnerHTML={{__html: editIcon}} />
<div dangerouslySetInnerHTML={{ __html: editIcon }} />
</a>
<a className='snippet-control'
title='Open in Web'
href={ activeSnippet.brief.html_url }>
<div dangerouslySetInnerHTML={{__html: openInWebIcon}} />
<div dangerouslySetInnerHTML={{ __html: openInWebIcon }} />
</a>
<a className='snippet-control'
title='Revisions'
href={ activeSnippet.brief.html_url + '/revisions' }>
<div dangerouslySetInnerHTML={{__html: eyeIcon}} />
<div dangerouslySetInnerHTML={{ __html: eyeIcon }} />
</a>
{
this.props.immersiveMode === 'OFF'
? <a className='snippet-control'
title='Delete'
href='#'
onClick={ this.showDeleteModal.bind(this) }>
<div dangerouslySetInnerHTML={{__html: trashIcon}} />
<div dangerouslySetInnerHTML={{ __html: trashIcon }} />
</a>
: null
}
Expand All @@ -432,11 +432,11 @@ class Snippet extends Component {
}
htmlForDescriptionSection.push(
<div className='description-section' key='description'
dangerouslySetInnerHTML={ {__html: Autolinker.link(description, { stripPrefix: {
dangerouslySetInnerHTML={ { __html: Autolinker.link(description, { stripPrefix: {
scheme: true,
www: true
},
newWindow: false })} }/>
newWindow: false }) } }/>
)
htmlForDescriptionSection.push(
<div className='custom-tags-section' key='customTags'>
Expand Down
4 changes: 2 additions & 2 deletions app/containers/userPanel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ class UserPanel extends Component {
description: '',
private: kIsPrivate,
gists: [
{filename: '', content: ''}
]}
{ filename: '', content: '' }
] }
return (
<GistEditorForm
initialData={ initialData }
Expand Down
2 changes: 1 addition & 1 deletion app/reducers/reducer_gist_raw_modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { UPDATE_GIST_RAW_MODAL } from '../actions'

export default function (state = {status: 'OFF', file: null, content: null, link: null}, action) {
export default function (state = { status: 'OFF', file: null, content: null, link: null }, action) {
switch (action.type) {
case UPDATE_GIST_RAW_MODAL:
return Object.assign({}, state, action.payload)
Expand Down
2 changes: 1 addition & 1 deletion app/utilities/markdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ const Md = MarkdownIt({
}
})
.use(MdTaskList)
.use(MdKatex, {'throwOnError': false, 'errorColor': ' #cc0000'})
.use(MdKatex, { 'throwOnError': false, 'errorColor': ' #cc0000' })

export default Md
175 changes: 158 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2e36629

Please sign in to comment.