Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint consistent quotes #1770

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
"rules": {
"strict": 0,
"curly": 0,
"quotes": 0,
"quotes": [1, "single"],
"no-underscore-dangle": 0,
"camelcase": [0],
"new-cap": 0,
"react/jsx-boolean-value": 2,
"jsx-quotes": 0,
"jsx-quotes": [1, "prefer-single"],
"react/jsx-no-undef": 2,
"react/jsx-sort-props": 0,
"react/jsx-sort-prop-types": 0,
Expand All @@ -43,7 +43,7 @@
"react/react-in-jsx-scope": 2,
"react/self-closing-comp": 2,
"react/wrap-multilines": 0,
"no-trailing-spaces":0,
"no-trailing-spaces": 0,
"no-irregular-whitespace": 0,
"no-mixed-spaces-and-tabs": 0,
"no-unused-expressions": 0,
Expand All @@ -56,15 +56,14 @@
"no-undef": 0,
"eqeqeq": 0,
"no-multi-spaces": 0,
"no-extend-native":0,
"no-script-url":0,
"no-extra-bind":0,
"semi-spacing":0,
"no-extra-semi":0,
"no-extra-strict":0,
"no-new-object":0,
"no-debugger":0

"no-extend-native": 0,
"no-script-url": 0,
"no-extra-bind": 0,
"semi-spacing": 0,
"no-extra-semi": 0,
"no-extra-strict": 0,
"no-new-object": 0,
"no-debugger": 0
},
"globals": {
"inject": false,
Expand All @@ -78,7 +77,7 @@
"expect": false,
"window": false,
"document": false,
"Parse":false
"Parse": false
},
"plugins": [
"react"
Expand Down
84 changes: 42 additions & 42 deletions jsapp/js/app.es6
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ class App extends React.Component {
render() {
var assetid = this.props.params.assetid || null;
return (
<DocumentTitle title="KoBoToolbox">
<div className="mdl-wrapper">
<DocumentTitle title='KoBoToolbox'>
<div className='mdl-wrapper'>
{ !this.isFormBuilder() && !this.state.pageState.headerHidden &&
<div className="k-header__bar"></div>
<div className='k-header__bar'></div>
}
<bem.PageWrapper m={{
'fixed-drawer': this.state.pageState.showFixedDrawer,
'header-hidden': this.state.pageState.headerHidden,
'drawer-hidden': this.state.pageState.drawerHidden,
'in-formbuilder': this.isFormBuilder()
}} className="mdl-layout mdl-layout--fixed-header">
}} className='mdl-layout mdl-layout--fixed-header'>
{ this.state.pageState.modal &&
<Modal params={this.state.pageState.modal} />
}
Expand Down Expand Up @@ -210,7 +210,7 @@ class FormXform extends React.Component {
return (
<ui.Panel>
<bem.FormView>
<div className="pygment" dangerouslySetInnerHTML={this.state.xformHtml} />
<div className='pygment' dangerouslySetInnerHTML={this.state.xformHtml} />
</bem.FormView>
</ui.Panel>
);
Expand Down Expand Up @@ -238,7 +238,7 @@ class FormNotFound extends React.Component {
class SectionNotFound extends React.Component {
render () {
return (
<ui.Panel className="k404">
<ui.Panel className='k404'>
<i />
<em>section not found</em>
</ui.Panel>
Expand All @@ -247,66 +247,66 @@ class SectionNotFound extends React.Component {
};

export var routes = (
<Route name="home" path="/" component={App}>
<Route path="account-settings" component={AccountSettings} />
<Route path="change-password" component={ChangePassword} />

<Route path="library" >
<Route path="new" component={AddToLibrary} />
<Route path="/library/:assetid">
{/*<Route name="library-form-download" path="download" handler={FormDownload} />,*/}
<Route path="json" component={FormJson} />,
<Route path="xform" component={FormXform} />,
<Route path="edit" component={LibraryPage} />
<Route name='home' path='/' component={App}>
<Route path='account-settings' component={AccountSettings} />
<Route path='change-password' component={ChangePassword} />

<Route path='library' >
<Route path='new' component={AddToLibrary} />
<Route path='/library/:assetid'>
{/*<Route name='library-form-download' path='download' handler={FormDownload} />,*/}
<Route path='json' component={FormJson} />,
<Route path='xform' component={FormXform} />,
<Route path='edit' component={LibraryPage} />
</Route>
<IndexRoute component={LibrarySearchableList} />
</Route>

<IndexRedirect to="forms" />
<Route path="forms" >
<IndexRedirect to='forms' />
<Route path='forms' >
<IndexRoute component={FormsSearchableList} />

<Route path="/forms/:assetid">
{/*<Route name="form-download" path="download" component={FormDownload} />*/}
<Route path="json" component={FormJson} />
<Route path="xform" component={FormXform} />
<Route path="edit" component={FormPage} />
<Route path='/forms/:assetid'>
{/*<Route name='form-download' path='download' component={FormDownload} />*/}
<Route path='json' component={FormJson} />
<Route path='xform' component={FormXform} />
<Route path='edit' component={FormPage} />

<Route path="summary">
<Route path='summary'>
<IndexRoute component={FormSummary} />
</Route>

<Route path="landing">
<Route path='landing'>
<IndexRoute component={FormLanding} />
</Route>

<Route path="data">
<Route path="report" component={Reports} />
<Route path="report-legacy" component={FormSubScreens} />
<Route path="table" component={FormSubScreens} />
<Route path="downloads" component={FormSubScreens} />
<Route path="gallery" component={FormSubScreens} />
<Route path="map" component={FormSubScreens} />
<Route path="map/:viewby" component={FormSubScreens} />
<IndexRedirect to="report" />
<Route path='data'>
<Route path='report' component={Reports} />
<Route path='report-legacy' component={FormSubScreens} />
<Route path='table' component={FormSubScreens} />
<Route path='downloads' component={FormSubScreens} />
<Route path='gallery' component={FormSubScreens} />
<Route path='map' component={FormSubScreens} />
<Route path='map/:viewby' component={FormSubScreens} />
<IndexRedirect to='report' />
</Route>

<Route path="settings">
<Route path='settings'>
<IndexRoute component={FormSubScreens} />
<Route path="kobocat" component={FormSubScreens} />
<Route path="sharing" component={FormSubScreens} />
<Route path='kobocat' component={FormSubScreens} />
<Route path='sharing' component={FormSubScreens} />
</Route>

{/* used to force refresh form screens */}
<Route path="reset" component={FormSubScreens} />
<Route path='reset' component={FormSubScreens} />

<IndexRedirect to="landing" />
<IndexRedirect to='landing' />
</Route>

<Route path="*" component={FormNotFound} />
<Route path='*' component={FormNotFound} />
</Route>

<Route path="*" component={SectionNotFound} />
<Route path='*' component={SectionNotFound} />
</Route>
);

Expand Down
4 changes: 2 additions & 2 deletions jsapp/js/components/formViewTabs.es6
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class FormViewTabs extends Reflux.Component {
activeClassName='active'>
{t('Form')}
</Link>
<bem.FormView__tab className="is-edge" m='summary'>
<bem.FormView__tab className='is-edge' m='summary'>
{t('Summary')}
</bem.FormView__tab>
{ a.deployment__identifier != undefined && a.has_deployment && a.deployment__submission_count > 0 && this.userCan('view_submissions', a) &&
Expand All @@ -89,7 +89,7 @@ class FormViewTabs extends Reflux.Component {
<Link
to={`/forms`}
className='form-view__link form-view__link--close'>
<i className="k-icon-close" />
<i className='k-icon-close' />
</Link>

</bem.FormView__toptabs>
Expand Down
2 changes: 1 addition & 1 deletion jsapp/js/utils.es6
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export function koboMatrixParser(params) {
content.survey[i].type = 'begin_kobomatrix';
content.survey[i].appearance = 'field-list';
surveyLength++;
content.survey.splice(i + 1, 0, {type: "end_kobomatrix", "$kuid": `/${content.survey[i].$kuid}`});
content.survey.splice(i + 1, 0, {type: 'end_kobomatrix', '$kuid': `/${content.survey[i].$kuid}`});
}
}

Expand Down
6 changes: 3 additions & 3 deletions jsapp/xlform/src/model.validationLogicParserFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ module.exports = (function(){
'<': 'resp_less',
'>=': 'resp_greaterequals',
'<=': 'resp_lessequals',
"!=''": 'ans_notnull',
"=''": 'ans_null'
'!=\'\'': 'ans_notnull',
'=\'\'': 'ans_null'
};

var res = {
Expand All @@ -32,7 +32,7 @@ module.exports = (function(){

if (matches[3]) {
// strip surrounding single quotes, if any
var response_value = matches[3].replace(/^'([^']*)'$/, "$1");
var response_value = matches[3].replace(/^'([^']*)'$/, '$1');
// extract xxxx-xx-xx from date('xxxx-xx-xx')
response_value = response_value.replace(/date\('(\d{4}-\d{2}-\d{2})'\)/, '$1');
res.response_value = response_value;
Expand Down