Skip to content

Commit

Permalink
chore: make eslint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Jul 11, 2024
1 parent 30a5a1a commit 4faf25c
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/utils/export-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class ExportMap {
return null
}

exportMap.mtime = stats().mtime.valueOf();
exportMap.mtime = stats().mtime.valueOf()

exportCache.set(cacheKey, exportMap)

Expand All @@ -149,7 +149,7 @@ export class ExportMap {
let ast: TSESTree.Program
let visitorKeys: TSESLint.SourceCode.VisitorKeys | null
try {
; ({ ast, visitorKeys } = parse(filepath, content, context))
;({ ast, visitorKeys } = parse(filepath, content, context))
} catch (error) {
m.errors.push(error as ParseError)
return m // can't continue
Expand Down Expand Up @@ -522,17 +522,17 @@ export class ExportMap {
const exportedName =
n.type === 'TSNamespaceExportDeclaration'
? (
n.id ||
// @ts-expect-error - legacy parser type
n.name
).name
n.id ||
// @ts-expect-error - legacy parser type
n.name
).name
: ('expression' in n &&
n.expression &&
(('name' in n.expression && n.expression.name) ||
('id' in n.expression &&
n.expression.id &&
n.expression.id.name))) ||
null
n.expression &&
(('name' in n.expression && n.expression.name) ||
('id' in n.expression &&
n.expression.id &&
n.expression.id.name))) ||
null

const getRoot = (
node: TSESTree.TSQualifiedName,
Expand All @@ -551,7 +551,7 @@ export class ExportMap {
('name' in node.id
? node.id.name === exportedName
: 'left' in node.id &&
getRoot(node.id).name === exportedName)) ||
getRoot(node.id).name === exportedName)) ||
('declarations' in node &&
node.declarations.find(
d => 'name' in d.id && d.id.name === exportedName,
Expand Down Expand Up @@ -666,7 +666,7 @@ export class ExportMap {
m.namespace.set('default', {}) // add default export
}

const prevParseGoal = m.parseGoal;
const prevParseGoal = m.parseGoal
defineLazyProperty(m, 'parseGoal', () => {
if (prevParseGoal !== 'Module' && unambiguouslyESM()) {
return 'Module'
Expand Down Expand Up @@ -708,7 +708,7 @@ export class ExportMap {

declare doc: Annotation | undefined

constructor(public path: string) { }
constructor(public path: string) {}

get hasDefault() {
return this.get('default') != null
Expand Down Expand Up @@ -993,7 +993,6 @@ function captureJsDoc(comments: TSESTree.Comment[]) {
}
}


/**
* parse TomDoc section from comments
*/
Expand Down

0 comments on commit 4faf25c

Please sign in to comment.