From 316dfd1f267728e2569b45e06bf6efb48119b693 Mon Sep 17 00:00:00 2001 From: Andrew Dupont Date: Mon, 6 Jan 2025 17:19:46 -0800 Subject: [PATCH] [spell-check] Fixes for a possible patch release (#1173) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [spell-check] Change test so it works identically across platforms * [spell-check] Remove errant `console.log`… …and clean up specs. * [spell-check] Revert addition to `spell-check.grammars`… …of the `"source comment"` value. A user can add it back in if they want spell-checking of code comments, but it's probably a bit too opinionated to be the default. --- packages/spell-check/lib/scope-helper.js | 1 - packages/spell-check/package.json | 1 - packages/spell-check/spec/.eslintrc.js | 17 ++++++++++------- packages/spell-check/spec/spell-check-spec.js | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/spell-check/lib/scope-helper.js b/packages/spell-check/lib/scope-helper.js index f43135e607..31c526ba7c 100644 --- a/packages/spell-check/lib/scope-helper.js +++ b/packages/spell-check/lib/scope-helper.js @@ -60,7 +60,6 @@ class ScopeSelector { enforceSegmentOrder: false, ...rawOptions, }; - console.log(this, 'matches', scopeDescriptorOrArray); let scopeList; if (Array.isArray(scopeDescriptorOrArray)) { scopeList = scopeDescriptorOrArray; diff --git a/packages/spell-check/package.json b/packages/spell-check/package.json index 6d8d48193b..862fb9f1b4 100644 --- a/packages/spell-check/package.json +++ b/packages/spell-check/package.json @@ -30,7 +30,6 @@ "grammars": { "type": "array", "default": [ - "source comment", "source.asciidoc", "source.gfm", "text.git-commit", diff --git a/packages/spell-check/spec/.eslintrc.js b/packages/spell-check/spec/.eslintrc.js index 5226d69213..fdc38d9ad2 100644 --- a/packages/spell-check/spec/.eslintrc.js +++ b/packages/spell-check/spec/.eslintrc.js @@ -1,9 +1,12 @@ module.exports = { - env: { jasmine: true }, - rules: { - "node/no-unpublished-require": "off", - "node/no-extraneous-require": "off", - "no-unused-vars": "off", - "no-empty": "off" - } + env: { jasmine: true }, + globals: { + advanceClock: true, + }, + rules: { + 'node/no-unpublished-require': 'off', + 'node/no-extraneous-require': 'off', + 'no-unused-vars': 'off', + 'no-empty': 'off', + }, }; diff --git a/packages/spell-check/spec/spell-check-spec.js b/packages/spell-check/spec/spell-check-spec.js index 4c74200dfd..37147971d0 100644 --- a/packages/spell-check/spec/spell-check-spec.js +++ b/packages/spell-check/spec/spell-check-spec.js @@ -114,7 +114,7 @@ class SpeledWrong {}` `speledWrong = 5; function speledWrong() {} // We only care about mispelings in comments and strings! -let foo = "this is speled wrong" +let fxo = "this is speled wrong" class SpeledWrong {}` ); @@ -751,6 +751,7 @@ class SpeledWrong {}` // These tests are only run on Macs because the CI for Windows doesn't have // spelling provided. if (env.isSystemSupported() && env.isDarwin()) { + let markers; describe('when using system checker plugin', function () { it('marks chzz as not a valid word but cheese is', async function () { atom.config.set('spell-check.useSystem', true); @@ -759,7 +760,6 @@ class SpeledWrong {}` await conditionPromise(() => { markers = getMisspellingMarkers(); - console.log(markers); return ( markers.length === 1 && markers[0].getBufferRange().start.column === 7 &&