Skip to content

Commit

Permalink
Merge pull request #744 from oskarhane/editor-lint-toggle
Browse files Browse the repository at this point in the history
Add non-visible config `editorLint` to toggle editor linting
  • Loading branch information
pe4cey authored Apr 27, 2018
2 parents 8e8ff20 + baf676d commit 5462db5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/browser/modules/Editor/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ import {
import { getHistory } from 'shared/modules/history/historyDuck'
import {
getCmdChar,
shouldEditorAutocomplete
shouldEditorAutocomplete,
shouldEditorLint
} from 'shared/modules/settings/settingsDuck'
import { Bar, ActionButtonSection, EditorWrapper } from './styled'
import { EditorButton, EditModeEditorButton } from 'browser-components/buttons'
Expand Down Expand Up @@ -321,7 +322,7 @@ export class Editor extends Component {
autofocus: true,
smartIndent: false,
lineNumberFormatter: this.lineNumberFormatter.bind(this),
lint: true,
lint: this.props.enableEditorLint,
extraKeys: {
'Ctrl-Space': 'autocomplete',
Enter: this.handleEnter.bind(this),
Expand Down Expand Up @@ -439,6 +440,7 @@ const mapDispatchToProps = (dispatch, ownProps) => {
const mapStateToProps = state => {
return {
enableEditorAutocomplete: shouldEditorAutocomplete(state),
enableEditorLint: shouldEditorLint(state),
history: getHistory(state),
cmdchar: getCmdChar(state),
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Object {
"browserSyncDebugServer": null,
"cmdchar": ":",
"editorAutocomplete": true,
"editorLint": false,
"initCmd": ":play start",
"initialNodeDisplay": 300,
"maxFrames": 30,
Expand Down
2 changes: 2 additions & 0 deletions src/shared/modules/settings/settingsDuck.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const getInitialNodeDisplay = state =>
export const getScrollToTop = state => state[NAME].scrollToTop
export const shouldReportUdc = state => state[NAME].shouldReportUdc !== false
export const shouldAutoComplete = state => state[NAME].autoComplete !== false
export const shouldEditorLint = state => state[NAME].editorLint === true

const browserSyncConfig = (host = 'https://auth.neo4j.com') => ({
authWindowUrl: `${host}/indexNewBrowser.html`,
Expand Down Expand Up @@ -77,6 +78,7 @@ const initialState = {
scrollToTop: true,
maxFrames: 30,
editorAutocomplete: true,
editorLint: false,
useCypherThread: true
}

Expand Down

0 comments on commit 5462db5

Please sign in to comment.