-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Labels
area:ignore.prettierignore file, --ignore-path CLI option, /* prettier-ignore */ comments and so on.prettierignore file, --ignore-path CLI option, /* prettier-ignore */ comments and so onarea:rangesIssues about formatting/ignoring/etc segments of filesIssues about formatting/ignoring/etc segments of fileshelp wantedWe're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!We're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!lang:htmlIssues affecting HTML (and SVG but not JSX)Issues affecting HTML (and SVG but not JSX)
Description
Prettier 1.15.2
Playground link
--parser htmlInput:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<!-- prettier-ignore-start -->
<%
// - copies _all_ stage-specific configs from `./config/*.js` into the bundle,
// but only `./config/config.js` will be loaded
// - by default we rename `config.local.js` to `config.js` for development,
// but on deployment to a specific stage the corresponding config will be renamed to `config.js`
// - if you want to use a different config for local development pass `-e STAGE={stage-name}` to `yarn build`/`yarn watch`
require.context('!copy-loader!./config/', true, /^\.\/.*\.js$/);
require('!file-loader?name=./config/config.js!./config/config.local.js')
%>
<!-- prettier-ignore-end -->
<script src="/v2/config/config<%= process.env.STAGE ? '.' + process.env.STAGE : '' %>.js"></script>
</body>
</html>Output:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<!-- prettier-ignore-start -->
<% // - copies _all_ stage-specific configs from `./config/*.js` into the
bundle, // but only `./config/config.js` will be loaded // - by default we
rename `config.local.js` to `config.js` for development, // but on
deployment to a specific stage the corresponding config will be renamed to
`config.js` // - if you want to use a different config for local development
pass `-e STAGE={stage-name}` to `yarn build`/`yarn watch`
require.context('!copy-loader!./config/', true, /^\.\/.*\.js$/);
require('!file-loader?name=./config/config.js!./config/config.local.js') %>
<!-- prettier-ignore-end -->
<script src="/v2/config/config<%= process.env.STAGE ? '.' + process.env.STAGE : '' %>.js"></script>
</body>
</html>Expected behavior:
Keep Input.
Now that HTML support has landed in Prettier it would be nice, if we could use range ignore for the same reasons it is supported in Markdown.
💡 The best solution for the example above would be, if underscore templates could be treated as JavaScript, but range ignore would be a great start to mix HTML with several other templating flavors.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:ignore.prettierignore file, --ignore-path CLI option, /* prettier-ignore */ comments and so on.prettierignore file, --ignore-path CLI option, /* prettier-ignore */ comments and so onarea:rangesIssues about formatting/ignoring/etc segments of filesIssues about formatting/ignoring/etc segments of fileshelp wantedWe're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!We're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue!lang:htmlIssues affecting HTML (and SVG but not JSX)Issues affecting HTML (and SVG but not JSX)