Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 7c873e9

Browse files
committed
ignored-names-importer
1 parent d4688cd commit 7c873e9

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

Diff for: lib/ignored-names-importer.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export async function ignoredNamesImporter() {
2+
return await import('./ignored-names')
3+
}

Diff for: lib/ignored-names.coffee

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
Minimatch = null # Defer requiring until actually needed
1+
# this file is lazy loaded by ignored-names-importer
2+
import minimatch from 'minimatch'
23

34
export default class IgnoredNames
45
constructor: ->
56
@ignoredPatterns = []
67

7-
Minimatch ?= require('minimatch').Minimatch
8-
98
ignoredNames = atom.config.get('core.ignoredNames') ? []
109
ignoredNames = [ignoredNames] if typeof ignoredNames is 'string'
1110
for ignoredName in ignoredNames when ignoredName
1211
try
13-
@ignoredPatterns.push(new Minimatch(ignoredName, matchBase: true, dot: true))
12+
@ignoredPatterns.push(new minimatch(ignoredName, matchBase: true, dot: true))
1413
catch error
1514
atom.notifications.addWarning("Error parsing ignore pattern (#{ignoredName})", detail: error.message)
1615

Diff for: lib/tree-view.coffee

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import AddDialog from './add-dialog'
1010
import MoveDialog from './move-dialog'
1111
import CopyDialog from './copy-dialog'
1212
IgnoredNames = null # Defer requiring until actually needed
13+
import {ignoredNamesImporter} from './ignored-names-importer.js'
1314

1415
import AddProjectsView from './add-projects-view'
1516

@@ -332,7 +333,7 @@ export default class TreeView
332333
addProjectsViewElement = @element.querySelector('#add-projects-view')
333334
@element.removeChild(addProjectsViewElement) if addProjectsViewElement
334335

335-
IgnoredNames ?= await import('./ignored-names')
336+
IgnoredNames ?= await ignoredNamesImporter()
336337

337338
@roots = for projectPath in projectPaths
338339
stats = fs.lstatSyncNoException(projectPath)

Diff for: package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474
"atom"
7575
],
7676
"ignore": [
77-
"/spec/fixtures/"
77+
"/spec/fixtures/",
78+
"lib/ignored-names-importer.js"
7879
]
7980
},
8081
"configSchema": {

0 commit comments

Comments
 (0)