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 theassert
keyword. Due to potential web compatibility risks, the proposal still includesassert
marked as deprecated. Usage of the old syntax is discouraged, and its removal is being investigated.
(c) tc39
🐊Putout plugin adds ability to convert assert
to with
.
Check out in 🐊Putout Editor.
npm i @putout/plugin-convert-assert-to-with -D
{
"rules": {
"convert-assert-to-with": "on"
}
}
import json from './foo.json' with { type: 'json' };
import('foo.json');
import json from './foo.json' with { type: 'json' };
import('foo.json');
MIT