Allow to ignore based on languages
See original GitHub issueEnvironments:
- Prettier Version: 1.15.1
Steps to reproduce:
As a user I want to ignore certain languages that are part of a larger file that I do want to format.
App.vue
<template>
<div id="app">
<img src="./assets/logo.png">
<HelloWorld/>
</div>
</template>
<script>
import HelloWorld from './components/HelloWorld'
export default {
name: 'App',
components: {
HelloWorld
}
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
I don’t want to format the HTML template
.prettierignore
{
"languages": ["html"]
}
Expected behavior:
Prettier format the file, but the HTML template.
<template>
<div id="app">
<img src="./assets/logo.png">
<HelloWorld/>
</div>
</template>
<script>
import HelloWorld from "./components/HelloWorld";
export default {
name: "App",
components: {
HelloWorld
}
};
</script>
<style>
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
Actual behavior:
There is no way to ignore a part of a file based on the language.
Related:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:21 (8 by maintainers)
Top Results From Across the Web
git - Ignore the same directory structure on multiples path with ...
I have a website linked to Git repository at Bitbucket. This site is multi language but I need to upload to repository only...
Read more >ignorePlurals API parameter - Algolia
ignorePlurals is used in conjunction with the queryLanguages setting. · You can send ignorePlurals one of 3 values: · For optimum relevance, it...
Read more >Ignore configuration storage collections? [#2973431] - Drupal
We need to be able to ignore what languages are turned on, because the languages ... Extend the base class from config filter...
Read more >Ignore HTTP Accept-Language headers - djangosnippets
A little tiny middleware that, when used in multilingual sites, will make Django I18N ignore any Accept-Language headers in the request, ...
Read more >Ignoring Code - Prettier
Use “prettier-ignore” comments to ignore parts of files. Ignoring Files: .prettierignore. To exclude files from formatting, create a .prettierignore file in the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Because using this means no longer following the style guide.
Because if I’m not following a predefined style guide, I would have to manage / define my own for other team members to use.
Best practice would be to use the standards defined by the framework.