Skip to content

Commit

Permalink
refactor: replace require-style imports (#504)
Browse files Browse the repository at this point in the history
This PR replaces
```
import path = require('path')
```
by
```
import path from 'path'
```
in a couple of files.

---------

Co-authored-by: Jon Eugster <[email protected]>
  • Loading branch information
abentkamp and joneugster authored Dec 10, 2024
1 parent 08f121b commit 1098740
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion vscode-lean4/src/leanclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {
displayNotificationWithOutput,
} from './utils/notifs'
import { willUseLakeServer } from './utils/projectInfo'
import path = require('path')
import path from 'path'

const escapeRegExp = (s: string) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')

Expand Down
2 changes: 1 addition & 1 deletion vscode-lean4/src/projectinit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { lake } from './utils/lake'
import { LeanInstaller } from './utils/leanInstaller'
import { displayNotification, displayNotificationWithInput } from './utils/notifs'
import { checkParentFoldersForLeanProject, isValidLeanProject } from './utils/projectInfo'
import path = require('path')
import path from 'path'

const projectInitNotificationOptions: SetupNotificationOptions = {
errorMode: { mode: 'NonModal' },
Expand Down
2 changes: 1 addition & 1 deletion vscode-lean4/src/utils/fsHelper.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { PathLike, promises } from 'fs'
import path = require('path')
import path from 'path'

/**
* Returns true if `pathFile` exists and is a file
Expand Down
2 changes: 1 addition & 1 deletion vscode-lean4/src/utils/projectInfo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as fs from 'fs'
import { ExtUri, FileUri, getWorkspaceFolderUri } from './exturi'
import { dirExists, fileExists } from './fsHelper'
import path = require('path')
import path from 'path'

// Detect lean4 root directory (works for both lean4 repo and nightly distribution)

Expand Down
3 changes: 1 addition & 2 deletions vscode-lean4/test/suite/utils/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import assert from 'assert'
import * as fs from 'fs'
import * as os from 'os'
import { basename, join } from 'path'
import path, { basename, join } from 'path'
import * as vscode from 'vscode'
import { AlwaysEnabledFeatures, EnabledFeatures, Exports } from '../../../src/exports'
import { InfoProvider } from '../../../src/infoview'
import { LeanClient } from '../../../src/leanclient'
import { LeanClientProvider } from '../../../src/utils/clientProvider'
import { logger } from '../../../src/utils/logger'
import path = require('path')

export function sleep(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms))
Expand Down

0 comments on commit 1098740

Please sign in to comment.