vuejs / vue-eslint-parser

The ESLint custom parser for `.vue` files.
MIT License
443 stars 74 forks source link

If I have AST parsed by 'vue-eslint-parser'.parsed(), is there any api to recover source vue code ? #224

Closed LLwyct closed 2 months ago

LLwyct commented 7 months ago

If I have AST parsed by 'vue-eslint-parser'.parsed(), is there any api to recover source vue code ?

import { parse } from 'vue-eslint-parser';

const ast = parse('code');

// travel ast and do some my modify

const code = // ???? //(ast);

fs.write('file', code);

for example

<temp v-if="isMobileDevice"></temp>
<temp v-if="isPCDevice"></temp >

when I publish code to PC env, I want to delete code running in moblie device.

and similer code in Githubissues.

  • Githubissues is a development platform for aggregating issues.