diff --git a/.eslintrc.js b/.eslintrc.js index 1132dc6..87469c5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,7 +3,8 @@ module.exports = { env: { browser: true, es6: true, - node: true + node: true, + mocha: true }, extends: ['eslint:recommended', 'plugin:react/recommended', 'plugin:jsx-a11y/recommended'], parserOptions: { diff --git a/cypress/integration/background-color-spec.js b/cypress/integration/background-color-spec.js index b8d397d..471868f 100644 --- a/cypress/integration/background-color-spec.js +++ b/cypress/integration/background-color-spec.js @@ -1,4 +1,3 @@ -/* eslint-env mocha */ /* global cy */ import { editorVisible } from '../support' diff --git a/cypress/integration/basic.js b/cypress/integration/basic.js index f7bd8ce..3dc9ca4 100644 --- a/cypress/integration/basic.js +++ b/cypress/integration/basic.js @@ -1,4 +1,3 @@ -/* eslint-env mocha */ /* global cy */ import { editorVisible } from '../support' describe('Basic', () => { diff --git a/cypress/integration/gist.js b/cypress/integration/gist.js index 647b269..026bcaf 100644 --- a/cypress/integration/gist.js +++ b/cypress/integration/gist.js @@ -1,4 +1,3 @@ -/* eslint-env mocha */ /* global cy Cypress */ import { editorVisible } from '../support' describe('Gist', () => { diff --git a/cypress/integration/localStorage-spec.js b/cypress/integration/localStorage-spec.js index 2624b9c..d675cd5 100644 --- a/cypress/integration/localStorage-spec.js +++ b/cypress/integration/localStorage-spec.js @@ -1,4 +1,3 @@ -/* eslint-env mocha */ /* global cy */ import { editorVisible } from '../support' diff --git a/lib/custom/modes/apache.js b/lib/custom/modes/apache.js index 86da57e..6f99ed8 100644 --- a/lib/custom/modes/apache.js +++ b/lib/custom/modes/apache.js @@ -1,11 +1,10 @@ -/* eslint-disable */ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE // Apache mode by gloony const CodeMirror = require('codemirror') -CodeMirror.defineMode('apache', function(config) { +CodeMirror.defineMode('apache', function(/* config */) { return { token: function(stream, state) { var sol = stream.sol() || state.afterSection @@ -28,7 +27,9 @@ CodeMirror.defineMode('apache', function(config) { } if (sol) { - while (stream.eatSpace()) {} + while (stream.eatSpace()) { + /* pass */ + } } var ch = stream.next() diff --git a/lib/custom/modes/elixir.js b/lib/custom/modes/elixir.js index 0bf89e1..003c5f9 100644 --- a/lib/custom/modes/elixir.js +++ b/lib/custom/modes/elixir.js @@ -1,3 +1,2 @@ -/* eslint-disable */ // Require Codemirror elixir mode from npm modules and register it here import 'codemirror-mode-elixir' diff --git a/lib/custom/modes/graphql.js b/lib/custom/modes/graphql.js index 8cc222d..c4effd1 100644 --- a/lib/custom/modes/graphql.js +++ b/lib/custom/modes/graphql.js @@ -1,2 +1 @@ -/* eslint-disable */ import 'codemirror-graphql/mode' diff --git a/lib/custom/modes/nimrod.js b/lib/custom/modes/nimrod.js index 59045c7..60e7348 100755 --- a/lib/custom/modes/nimrod.js +++ b/lib/custom/modes/nimrod.js @@ -1,4 +1,3 @@ -/* eslint-disable */ const CodeMirror = require('codemirror') CodeMirror.defineMode('nimrod', function(conf, parserConf) { @@ -375,10 +374,10 @@ CodeMirror.defineMode('nimrod', function(conf, parserConf) { } // Handle Number Literals - if (stream.match(/^[0-9\.]/, false)) { + if (stream.match(/^[0-9.]/, false)) { var floatLiteral = false // Floats - if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { + if (stream.match(/^\d*\.\d+(e[+-]?\d+)?/i)) { floatLiteral = true } if (stream.match(/^\d+\.\d*/)) { @@ -407,10 +406,9 @@ CodeMirror.defineMode('nimrod', function(conf, parserConf) { intLiteral = true } // Decimal - if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { + if (stream.match(/^[1-9]\d*(e[+-]?\d+)?/)) { // Decimal literals may be "imaginary" stream.eat(/J/i) - // TODO - Can you have imaginary longs? intLiteral = true } // Zero by itself with no other piece of number. @@ -572,7 +570,7 @@ CodeMirror.defineMode('nimrod', function(conf, parserConf) { if (delimiter_index !== -1) { indent(stream, state, '])}'.slice(delimiter_index, delimiter_index + 1)) - } else if (stream.eol() && current.match(/\=|\:|import|include|type|const|var|let/)) { + } else if (stream.eol() && current.match(/=|:|import|include|type|const|var|let/)) { indent(stream, state) }