2.0.1 β€’ Published 1 year ago

@putout/plugin-convert-assert-to-with v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@putout/plugin-convert-assert-to-with NPM version

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.

(c) tc39

🐊Putout plugin adds ability to convert assert to with. Check out in 🐊Putout Editor. Merted with @putout/plugin-esm.

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' assert { type: 'json' };

import('foo.json');

βœ… Example of correct code

import json from './foo.json' with { type: 'json' };

import('foo.json');

License

MIT

2.0.1

1 year ago

2.0.0

2 years ago

1.0.0

3 years ago