729 B
729 B
Support insertPragma and requirePragma in files has shebang (#8376 by @fisker)
// `--insert-pragma`
// Input
#!/usr/bin/env node
hello
.world();
// Prettier stable
SyntaxError: Unexpected token (3:1)
1 | /** @format */
2 |
> 3 | #!/usr/bin/env node
| ^
4 | hello
5 | .world();
// Prettier master
#!/usr/bin/env node
/** @format */
hello.world();
// `--require-pragma`
// Input
#!/usr/bin/env node
/**
* @format
*/
hello
.world();
// Prettier stable
#!/usr/bin/env node
/**
* @format
*/
hello
.world();
// Prettier master
#!/usr/bin/env node
/**
* @format
*/
hello.world();