question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `physicalFilename` option into rule tester

See original GitHub issue

@snitin315 @nzakas @mdjermanovic

I find physicalFilename is not available in ValidTestCase, so it makes testing cases for virtual filename unavailable, should that be supported?

Before context.getPhysicalFilename, I have a custom util getPhysicalFilename and a test case like:

ruleTester.run('remark', remark, {
  valid: [
    {
      code: '<header>Header2</header>',
      parser,
      parserOptions,
      filename: path.resolve(__filename, '0-fake.mdx'), // virtual filename
    },
  ],
})

But when I migrate to context.getPhysicalFilename, it results context.getPhysicalFilename() === filename, it is not correct, so maybe a new physicalFilename option is required for this case:

ruleTester.run('remark', remark, {
  valid: [
    {
      code: '<header>Header2</header>',
      parser,
      parserOptions,
      physicalFilename: __filename,
      filename: path.resolve(__filename, '0-fake.mdx'), // virtual filename
    },
  ],
})

_Originally posted by @JounQin in https://github.com/eslint/eslint/issues/14616#issuecomment-878712207_

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
btmillscommented, Oct 20, 2021

It sounded like mysticatea had a couple changes planned for the existing RFC, so I left a comment inquiring what those might be before I make any changes of my own, but I haven’t heard back. I’ll go ahead and update it for review by the team.

1reaction
btmillscommented, Jul 19, 2021

In the most recent TSC meeting, we agreed to go with the approach described in RFC31. I’ll be picking up that RFC to update it as necessary and get it through approval.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Renaming Logical and Physical file names in SQL Server on ...
In this blog post we will explain you the easiest way for renaming Logical and Physical file names in SQL Server on Linux....
Read more >
logical file name - SAP Community
To create a physical file name from a logical file name in your ABAP programs, use the function module FILE_GET_NAME. To insert the...
Read more >
Module mod_rewrite - IBM
Use this when you want to add more data to the query string via a rewrite rule. passthrough|PT: This flag forces the rewriting...
Read more >
Statements : FILE - SAS OnlineDoc, V8
It must conform to the same rules as a fileref. ... the LRECL= option in the FILE statement when you write to a...
Read more >
DBCC TRACEON - Trace Flags (Transact-SQL)
Note: Ensure that you thoroughly test this option, before rolling it ... to optimize insert performance for records inserted into new pages.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found