.eslintignore being treated by prettier as a markdown file - prettier

So, just like the title of the question entails, my .eslintignore is threated as a markdown file by prettier.
So tl:dr, I only recently started using eslint in projects, and I was surprised to see that when I ctrl+s to save the file, some of the entries were overwritten by prettier and replaced.
For example, stuff like
# Minified files
*.min.js
*.min.css
Would be formated to
# Minified files
_.min.js
_.min.css
I solved this by telling prettier to ignore the .eslintignore file by adding an entry to the .prettierignore file, but is this really the intended way of doing so?

Related

Rmarkdown rticles - MDPI template. How to print your own abbreviations

I am using the MDPI template (from the rticles package), and keen to also use the glossaries packages so I don't have to manually feed all the abbreviation on the appropriate YAML field.
For such, I have loaded the LaTex package glossaries using the header-includes:
header-includes:
\usepackage{inputenc}
\usepackage[acronym, section=section]{glossaries}
\setacronymstyle{long-short}
\makeglossaries
\makeindex
\input{glossary}
after creating several acronyms within the Rmarkdown body, I would be willing to either input the latex commands and have it printed in within the "Abbreviations" section of the template.
Currently, I am able to hack it through the following steps (I am sure there is a better way):
1- keep all the aux files chunk with :
options(tinytex.clean = FALSE)
2- cmd makeglossaries "filename"
3- Raw Latex on Rmarkdown file:
\begin{abbreviations}
\setabbreviationstyle[acronym]{long-short}
\printglossary[type=\acronymtype,title={}]
\end{abbreviations}
However, I would be keen to know if I could insert something on the YAML and use the MDPI formatting.
Alternatively, I could edit the rticles MDPI template (but I am not sure how).
Any ideas?
Cheers,
Include in YAML:
include-after: glossary.tex
I tried without success, but it seems reasonable that this approach might work with a few modifications

gruntfile not color codes like other JS files

For some reason Webstorm will not color the code within a Gruntfile, it opens like a standard text file, I cant seem to find the settings to make it work like a normal JS file. I don't recall changing any setting which could have effected this.
Please check if 'Gruntfile.js' (or 'gruntfile.js' if your file name starts with lower case) is added to text file patterns in Settings | Editor | File types -> 'Text files' file type. Removing this pattern should solve your problem

Include a text file in a gh-pages jekyll template also available to js

I'm making a "this day in history" sort of site in gh-pages, using javascript to pull the day's entry for the front page and a collection to store all the other entries indexed by date.
The entries are text files.
I've made markdown files as stubs to pull in the text files. I don't want to replicate the text files if possible, because then any typos I would have to remember to fix in two places.
As far as I can see, there are two ways to include the text files in the template:
{% include date.txt %} which requires the txt files to be in the _includes directory, thus not generated into the site and not available to the javascript on the front page
{% include_relative date.txt %} which requires the txt file to be in the collection folder, which is also not generated unless it has a yaml header, in which case it would be difficult to extract the text from the generated html.
Is there another way I'm missing for jekyll to include plain text files without them having to be in special _folders?
I'm using github pages, so plugins are out.
I think there is no other way to include text files through liquid. It is part of the way it separates published files from the pieces that go together to make the files.
The way forward is to adapt the javascript to read the text from a raw blob from the github repository.
But using an http request to raw.githubusercontent.com gives a Cross Origin Resource Sharing error.
So next way is to make a new collection with a new layout to output the input files as they are.

How to correctly assign template file in IntelliJ?

I inherited an old Zope project, and I am also new to Intellij.
Template files got the file ending .xpt (eXtended PageTemplates)
They contain mostly html, but also tal-tags, which either include syntax like person/getName or even "name python: user.getName()".
Currently, those files show white text on black background.
I want those file endings associated with html/xml whatever, so I get a better overview visually.
BUT I really need to keep the Intellij functions like refactor and find usages and so on working, so Intellij finds methods, which are only called inside those templates.
Any help is appreciated!
Go to File -> Settings -> File types. There in Recognized File Types you can find XML files template, then in Registered Patterns add your file pattern: *.xpt

PyCharm not doing full syntax coloring for a specific file name

In my Django projet, I have one models.py file that PyCharm is only partially syntax coloring: it's coloring the Python keywords and comments but not other things it normally does like coloring method names, keyword parameters. This is the only file in my project like this -- all other .py files are fully syntax colored.
It's the file name not contents that is the issue. I know this because when I rename the file, PyCharm immediately fully syntax colors it. When I rename it back to models.py, it goes back to partial coloring.
Note it's not just the syntax coloring that's off -- it's also other code analysis-related tools for this file.
What could be causing PyCharm to be treating this one file differently?
In the PyCharm status bar, there is a "Highlighting level" indicator. Clicking on it allows you to choose the highlighting level between "None", "Syntax" and "Inspections", and the selected value is persisted per file. Please try clicking on it and making sure that the level is set to "Inspections".