Skip to content

Commit

Permalink
Update migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Nov 8, 2023
1 parent 9a6621c commit 565ba5d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/migration-guide/to-16.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This release contains breaking changes. We've:

- removed deprecated stylistic rules
- removed support for Node.js less than 18.12.0
- changed `.js` extension to `.mjs` and `.cjs`
- changed Node.js API returned resolved object
- changed CLI to print problems to stderr
- changed CLI exit code for flag errors
Expand All @@ -20,6 +21,31 @@ Node.js 14 and 16 have reached end-of-life. We've removed support for them so th

You should use the 18.12.0 or higher versions of Node.js.

## Changed `.js` extensions to `.mjs` and `.cjs`

We've changed the file extension `.js` to `.mjs` and `.cjs` to support ESM and CJS.

You should modify your code if using `.js` for `import` or `require`. For example:

ESM:

```diff js
-import('stylelint/lib/utils/typeGuards.js');
+import('stylelint/lib/utils/typeGuards.mjs');
```

CJS:

```diff js
-require('stylelint/lib/utils/typeGuards.js');
+require('stylelint/lib/utils/typeGuards.cjs');
```

> [!WARNING]
> We've strongly recommended copying the internal utilities to your project instead of importing them.
> You can unsafely continue to `import` or `require` the files, but we will disallow access to them in the next major release.
> See also [`stylelint.utils`](../developer-guide/plugins.md#stylelintutils) in the developer guide.
## Changed Node.js API returned resolved object

We've changed the resolved object of the Promise returned by `stylelint.lint()` so that:
Expand Down

0 comments on commit 565ba5d

Please sign in to comment.