Skip to content

Commit 93cd1c4

Browse files
committed
feature: @putout/plugin-esm: merge convert-assert-to-with
1 parent 15fbf4b commit 93cd1c4

File tree

17 files changed

+54
-174
lines changed

17 files changed

+54
-174
lines changed

packages/plugin-convert-assert-to-with/.eslintrc.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

packages/plugin-convert-assert-to-with/.gitignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/plugin-convert-assert-to-with/.madrun.mjs

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/plugin-convert-assert-to-with/.npmignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/plugin-convert-assert-to-with/.nycrc.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/plugin-convert-assert-to-with/LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/plugin-convert-assert-to-with/README.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

packages/plugin-convert-assert-to-with/package.json

Lines changed: 0 additions & 53 deletions
This file was deleted.

packages/plugin-esm/README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ console.log(putout);
176176

177177
Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/f9f34acddbefba0ded53225ca10fa44e/7b4dba44602b9b2d28fe3a98989474a4b0d8d73d).
178178

179-
## ❌ Example of incorrect code
179+
### ❌ Example of incorrect code
180180

181181
```js
182182
import json from './mod.json' with { type: 'json' };
@@ -192,7 +192,7 @@ import json from './mod.json' with { type: 'json' };
192192

193193
Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/521e2ff199243a7ce1f65db7140c272e/28c0588281286f8a6765b8aa2ecabbfcde2973a7).
194194

195-
## ❌ Example of incorrect code
195+
### ❌ Example of incorrect code
196196

197197
```js
198198
import {
@@ -204,7 +204,7 @@ import {
204204
import a1 from 'a1';
205205
```
206206

207-
## ✅ Example of correct code
207+
### ✅ Example of correct code
208208

209209
```js
210210
import a1 from 'a1';
@@ -216,6 +216,38 @@ import {
216216
} from 'd';
217217
```
218218

219+
## convert-assert-to-with
220+
221+
> This feature would ideally use the `with` keyword to denote attributes, but there are existing implementations based on a previous version of the proposal using the `assert` keyword. Due to potential web compatibility risks, the proposal still includes `assert` marked as deprecated. Usage of the old syntax is discouraged, and its removal is being investigated.
222+
>
223+
> (c) [tc39](https://tc39.es/proposal-import-attributes/)
224+
225+
Check out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/9f85897b998c6458efc19db6a5414b79/57ef7cdd113c7a0087e0f7a6e70522f60baa04f4).
226+
227+
## ❌ Example of incorrect code
228+
229+
```js
230+
import json from './foo.json' assert { type: 'json' };
231+
232+
import('foo.json', {
233+
assert: {
234+
type: 'json',
235+
},
236+
});
237+
```
238+
239+
## ✅ Example of correct code
240+
241+
```js
242+
import json from './foo.json' with { type: 'json' };
243+
244+
import('foo.json', {
245+
with: {
246+
type: 'json',
247+
},
248+
});
249+
```
250+
219251
## License
220252

221253
MIT

packages/plugin-convert-assert-to-with/test/fixture/convert-assert-to-with-fix.js renamed to packages/plugin-esm/lib/convert-assert-to-with/fixture/convert-assert-to-with-fix.js

File renamed without changes.

0 commit comments

Comments
 (0)