Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jul 15, 2023
1 parent ab7732e commit 05fb2d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/rules/prefer-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Prefer using the [JavaScript module](https://developer.mozilla.org/en-US/docs/We
Replacements:

```js
import {fileURLToPath} from 'url';
import path from 'path';
import {fileURLToPath} from 'node:url';
import path from 'node:path';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(fileURLToPath(import.meta.url));
Expand All @@ -34,7 +34,7 @@ Prefer using the [JavaScript module](https://developer.mozilla.org/en-US/docs/We
However, in most cases, this is better:

```js
import {fileURLToPath} from 'url';
import {fileURLToPath} from 'node:url';

const foo = fileURLToPath(new URL('foo.js', import.meta.url));
```
Expand Down

0 comments on commit 05fb2d8

Please sign in to comment.