Configuration
Lint fix addon is enabled through a lintFix field in CodeMirror options:
var myCodeMirror = CodeMirror.fromTextArea(myTextArea, {
lint: true,
lintFix: { ... }
});
The addon accepts the following option:
getFixes: function(cm, line: integer, annotations: array<object>) → array<fix>- A function that is used to get fixes for a given line. The structure of
fixobject is:{ apply: function(cm, line: integer, fix: object), text: string, render: function(parent: element, fix: object) // optional }Note that addon can uselintFixhelper (seeCodeMirror.registerHelper) instead ofgetFixesoption.
Commands
lintFixShow- Shows lint fix menu (if available).