putout v23.5.0
What about 🗺Source Map?
Mounting the Ox, slowly
I return homeward.
The voice of my flute intones
through the evening.
Measuring with hand-beats
the pulsating harmony,
I direct the endless rhythm.
Whoever hears this melody
will join me
(c) Zen Ten Bulls
Hi folks!
Source maps is everywhere! Each time you open a website, it loads tones of minified JavaScript bundles and some of them has source maps to simplify debugging.
Same thing exists in node.js and one nice tool requires it. This is mock-import. It helps to mock import you are using, so you can test it easily with 📼Supertape (of course 😏!).
🗺 Sourcemap
When you need sourcemap you can have it easily, just pass:
- ✅
sourceFileName; - ✅
sourceMapName;
putout(source, {
fix: false,
sourceFileName: 'hello.js',
sourceMapName: 'world.js',
plugins: [
'remove-unused-variables',
],
});
// returns
({
code: '\n' +
` const hello = 'world';\n` +
` const hi = 'there';\n` +
' \n' +
' console.log(hello);\n' +
'// {"version": 3, ...}',
places: [{
rule: 'remove-unused-variables',
message: '"hi" is defined but never used',
position: {line: 3, column: 10},
}],
});That's all for today! Have a nice maps 🦉 🥳 !
🐞 fix
- (eslint-plugin-putout) newline-function-call-arguments: exclude code contains quote
🔥 feature
- (putout) add support of sourcemaps
- (@putout/engine-parser) add sourcemaps support
