Skip to content

Commit

Permalink
test: check CASE_SENSITIVE_FS correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Mar 18, 2024
1 parent 0fc32b3 commit 0a41ce0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rules/no-unresolved.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export = createRule<[Options?], MessageId>({
messages: {
unresolved: "Unable to resolve path to module '{{module}}'.",
casingMismatch:
"Casing of '{{module}}' does not match the underlying filesystem.",
'Casing of {{module}} does not match the underlying filesystem.',
},
schema: [
makeOptionsSchema({
Expand Down
14 changes: 13 additions & 1 deletion src/utils/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,21 @@ export type Resolver = {
}

export const CASE_SENSITIVE_FS = !fs.existsSync(
path.join(__dirname.toUpperCase(), 'reSOLVE.js'),
path.resolve(
__dirname,
path.basename(__filename.replace(/^resolve\./, 'reSOLVE.')),
),
)

console.log(
path.resolve(
__dirname,
path.basename(__filename.replace(/^resolve\./, 'reSOLVE.')),
),
)

console.log('CASE_SENSITIVE_FS:', CASE_SENSITIVE_FS)

const ERROR_NAME = 'EslintPluginImportResolveError'

const fileExistsCache = new ModuleCache()
Expand Down

0 comments on commit 0a41ce0

Please sign in to comment.