0
我之前在Codemirror上玩過CoffeeScript,我不知道爲什麼,但linting不能與Codemirror一起工作。即使是Codemirror包提供的lint也不適合我。在Codemirror上顯示CoffeeScript Lint
我在做什麼錯,我該如何解決這個問題?
// Initialize CodeMirror editor
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
mode: "text/x-coffeescript",
tabMode: "indent",
styleActiveLine: true,
lineNumbers: true,
lineWrapping: true,
autoCloseTags: true,
foldGutter: true,
dragDrop: true,
lint: true,
gutters: ["CodeMirror-lint-markers", "CodeMirror-linenumbers", "CodeMirror-foldgutter"]
})
.CodeMirror {
width: 100%;
height: auto;
}
<link rel="stylesheet" href="https://necolas.github.io/normalize.css/4.0.0/normalize.css">
<link rel="stylesheet" href="http://codemirror.net/lib/codemirror.css">
<link rel="stylesheet" href="http://codemirror.net/addon/fold/foldgutter.css">
<link rel="stylesheet" href="http://codemirror.net/addon/hint/show-hint.css">
<link rel="stylesheet" href="http://codemirror.net/addon/lint/lint.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://codemirror.net/lib/codemirror.js"></script>
<script src="http://codemirror.net/mode/javascript/javascript.js"></script>
<script src="http://codemirror.net/mode/xml/xml.js"></script>
<script src="http://codemirror.net/mode/css/css.js"></script>
<script src="http://codemirror.net/mode/htmlmixed/htmlmixed.js"></script>
<script src="http://codemirror.net/addon/edit/closetag.js"></script>
<script src="http://codemirror.net/addon/edit/matchbrackets.js"></script>
<script src="http://codemirror.net/addon/selection/active-line.js"></script>
<script src="http://codemirror.net/addon/fold/foldcode.js"></script>
<script src="http://codemirror.net/addon/fold/foldgutter.js"></script>
<script src="http://codemirror.net/addon/fold/brace-fold.js"></script>
<script src="http://codemirror.net/addon/fold/xml-fold.js"></script>
<script src="http://codemirror.net/addon/fold/comment-fold.js"></script>
<script src="http://coffeescript.org/extras/coffee-script.js"></script>
<script src="http://coffeelint.org/js/coffeelint.js"></script>
<script src="http://codemirror.net/mode/coffeescript/coffeescript.js"></script>
<script src="http://codemirror.net/addon/lint/coffeescript-lint.js"></script>
<textarea id="code">function() {}</textarea>
如果有咖啡上鏡那麼鏡像將無法正常工作,你可能期望。我建議下載Cloth或Rag,並使用'Cloth.wipe()'或'Rag.spitOn().wipe()'。我希望這有幫助。 – Chrillewoodz
咖啡鏡子只是'coffeescript-lint.js'文件需要的。我不熟悉布料或抹布。 –