React-ace: Disable annotations (useWorker not working)

Created on 2 Oct 2017  路  9Comments  路  Source: securingsincity/react-ace

Heyo 馃憢 I'm having trouble disabling the annotations. After searching through some issues, I've tried out the following:

<AceEditor
  value={code}
  mode="javascript"
  theme="github"
  showLineNumbers
  readOnly
  editorProps={{
    $useWorker: false,
  }}
  setOptions={{
    useWorker: false
  }}
/>

As I understand it, setting either setOptions.useWorker or editorProps.$useWorker to false should disable annotations and linting entirely, but it just isn't working. Any ideas?

Thanks!

Documentation bug good first issue help wanted

Most helpful comment

{
  ...,
  setOptions: {
    useWorker: false
  }
}

is disabling all annotations for me

All 9 comments

Try removing $useWorker: false from the editorProps. It looks like setting both of the options actually doesn't disable the linter. You just need useWorker: false in setOptions.

@JasonEtco does @SidneyNemzer 's tip help?

@SidneyNemzer @securingsincity I haven't had a chance to test it, I ended up going with a different component for my needs. Sorry!

For what its worth, I had gone through iterations of trying each one individually which didn't do the trick.

@securingsincity, I can confirm that @SidneyNemzer tip works:

<AceEditor
  mode="javascript"
  theme="monokai"
  onChange={this.handleChange}
  value={this.state.code}
  name="editor"
  setOptions={{ useWorker: false }}
  editorProps={{ $blockScrolling: true }}
/>

successfully disables the worker. Looking forward to the eslint babel-eslint change upstream.

Looking forward to the eslint babel-eslint change upstream

You've peaked my interest @mattblackdev. Has Ace switched to using ESLint? I haven't seen anything about that being completed on the Ace repo.

+1
The trick didn't work for me. It keeps trying to start worker.
I wonder if I set useWorker false, does it stop trying to create a worker? Or it creates one but not use it.

{
  ...,
  setOptions: {
    useWorker: false
  }
}

is disabling all annotations for me

I also encountered the problem of disabled annotations not taking effect.
image
Quick operations can still be used to annotate in development

Try removing $useWorker: false from the editorProps. It looks like setting _both_ of the options actually doesn't disable the linter. You just need useWorker: false in setOptions.

yeah, this works

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Yuanye picture Yuanye  路  7Comments

burks10 picture burks10  路  3Comments

ghiden picture ghiden  路  3Comments

avalkowsky picture avalkowsky  路  6Comments

nenadlukic picture nenadlukic  路  6Comments