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'
44import * as fs from 'fs'
55import { tmpdir } from 'os'
66import rimraf from 'rimraf'
7- import linterEslint from '../dist/main'
7+ import * as linterEslint from '../dist/main'
88
99import { processESLintMessages } from '../dist/helpers'
1010
@@ -76,6 +76,10 @@ async function getNotification(expectedMessage) {
7676 } )
7777}
7878
79+ /**
80+ * @param {import("atom").TextEditor } textEditor
81+ * @returns {Promise<void> }
82+ */
7983async function makeFixes ( textEditor ) {
8084 const editorReloadPromise = new Promise ( ( resolve ) => {
8185 // Subscribe to file reload events
@@ -280,6 +284,10 @@ describe('The eslint provider for Linter', () => {
280284 rimraf . sync ( tempDir )
281285 } )
282286
287+ /**
288+ * @param {import("atom").TextEditor } textEditor
289+ * @returns {Promise<void> }
290+ */
283291 async function firstLint ( textEditor ) {
284292 const messages = await lint ( textEditor )
285293 // The original file has two errors
@@ -290,7 +298,6 @@ describe('The eslint provider for Linter', () => {
290298 await firstLint ( editor )
291299 await makeFixes ( editor )
292300 const messagesAfterFixing = await lint ( editor )
293-
294301 expect ( messagesAfterFixing . length ) . toBe ( 0 )
295302 } )
296303
Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ export async function generateDebugString() {
160160 * @param {string } [options.severity='error'] Can be one of: 'error', 'warning', 'info'
161161 * @param {string } [options.excerpt=''] Short text to use in the message
162162 * @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
164164 */
165165export function generateUserMessage ( textEditor , options ) {
166166 const {
@@ -182,9 +182,9 @@ export function generateUserMessage(textEditor, options) {
182182/**
183183 * Generates a message to the user in order to nicely display the Error being
184184 * 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
186186 * @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
188188 */
189189export function handleError ( textEditor , error ) {
190190 const { stack, message } = error
Original file line number Diff line number Diff line change @@ -173,6 +173,10 @@ module.exports = {
173173 grammarScopes : scopes ,
174174 scope : 'file' ,
175175 lintsOnChange : true ,
176+ /**
177+ * @param {import("atom").TextEditor } textEditor
178+ * @returns {Promise<import("atom/linter").Message[]> }
179+ */
176180 lint : async ( textEditor ) => {
177181 if ( ! atom . workspace . isTextEditor ( textEditor ) ) {
178182 // If we somehow get fed an invalid TextEditor just immediately return
You can’t perform that action at this time.
0 commit comments