@putout/plugin-convert-assert-to-with
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.
Install
npm i @putout/plugin-convert-assert-to-with -D
Rule
{
"rules": {
"convert-assert-to-with": "on"
}
}
❌ Example of incorrect code
import json from './foo.json' with { type: 'json' };
import('foo.json');
✅ Example of correct code
import json from './foo.json' with { type: 'json' };
import('foo.json');
License
MIT