This repository was archived by the owner on Aug 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import * as path from 'path'
4
4
import * as fs from 'fs'
5
5
import { tmpdir } from 'os'
6
6
import rimraf from 'rimraf'
7
- import linterEslint from '../dist/main'
7
+ import * as linterEslint from '../dist/main'
8
8
9
9
import { processESLintMessages } from '../dist/helpers'
10
10
@@ -76,6 +76,10 @@ async function getNotification(expectedMessage) {
76
76
} )
77
77
}
78
78
79
+ /**
80
+ * @param {import("atom").TextEditor } textEditor
81
+ * @returns {Promise<void> }
82
+ */
79
83
async function makeFixes ( textEditor ) {
80
84
const editorReloadPromise = new Promise ( ( resolve ) => {
81
85
// Subscribe to file reload events
@@ -280,6 +284,10 @@ describe('The eslint provider for Linter', () => {
280
284
rimraf . sync ( tempDir )
281
285
} )
282
286
287
+ /**
288
+ * @param {import("atom").TextEditor } textEditor
289
+ * @returns {Promise<void> }
290
+ */
283
291
async function firstLint ( textEditor ) {
284
292
const messages = await lint ( textEditor )
285
293
// The original file has two errors
@@ -290,7 +298,6 @@ describe('The eslint provider for Linter', () => {
290
298
await firstLint ( editor )
291
299
await makeFixes ( editor )
292
300
const messagesAfterFixing = await lint ( editor )
293
-
294
301
expect ( messagesAfterFixing . length ) . toBe ( 0 )
295
302
} )
296
303
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ export async function generateDebugString() {
160
160
* @param {string } [options.severity='error'] Can be one of: 'error', 'warning', 'info'
161
161
* @param {string } [options.excerpt=''] Short text to use in the message
162
162
* @param {string|Function } [options.description] Used to provide additional information
163
- * @return {Array } Message to user generated from the parameters
163
+ * @return {import("atom/linter").Message[] } Message to user generated from the parameters
164
164
*/
165
165
export function generateUserMessage ( textEditor , options ) {
166
166
const {
@@ -182,9 +182,9 @@ export function generateUserMessage(textEditor, options) {
182
182
/**
183
183
* Generates a message to the user in order to nicely display the Error being
184
184
* thrown instead of depending on generic error handling.
185
- * @param {TextEditor } textEditor The TextEditor to use to build the message
185
+ * @param {import("atom"). TextEditor } textEditor The TextEditor to use to build the message
186
186
* @param {Error } error Error to generate a message for
187
- * @return {Array } Message to user generated from the Error
187
+ * @return {import("atom/linter").Message[] } Message to user generated from the Error
188
188
*/
189
189
export function handleError ( textEditor , error ) {
190
190
const { stack, message } = error
Original file line number Diff line number Diff line change @@ -173,6 +173,10 @@ module.exports = {
173
173
grammarScopes : scopes ,
174
174
scope : 'file' ,
175
175
lintsOnChange : true ,
176
+ /**
177
+ * @param {import("atom").TextEditor } textEditor
178
+ * @returns {Promise<import("atom/linter").Message[]> }
179
+ */
176
180
lint : async ( textEditor ) => {
177
181
if ( ! atom . workspace . isTextEditor ( textEditor ) ) {
178
182
// If we somehow get fed an invalid TextEditor just immediately return
You can’t perform that action at this time.
0 commit comments