Skip to content

Instantly share code, notes, and snippets.

@jonesnxt
Last active October 17, 2022 23:28
Show Gist options
  • Save jonesnxt/e20ce8d213fe4b07ab98ad7bdb1a1812 to your computer and use it in GitHub Desktop.
Save jonesnxt/e20ce8d213fe4b07ab98ad7bdb1a1812 to your computer and use it in GitHub Desktop.
const { parsers: typescriptParsers } = require('prettier/parser-typescript');
const { parsers: javascriptParsers } = require('prettier/parser-babel');
const S = require('subsecond');
function preprocess(text, opts) {
S.load({ 'any.tsx': text });
// A quick test to make sure everything works.
S().append('// its working!');
// TODO: Your code modification goes here
return S.print()['any.tsx'];
}
module.exports = {
parsers: {
typescript: {
...typescriptParsers.typescript,
preprocess,
},
babel: {
...javascriptParsers.babel,
preprocess,
},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment