-
Notifications
You must be signed in to change notification settings - Fork 1k
Should functions contain a .eslintignore file? #2913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@hithomasmorelli thank you for explaining this so clearly! |
First: when But: I went and tried to figure out why this happens on a new Functions instantiation and not this repository (which
Sure enough, doing a bunch of digging leads me to this: eslint/eslint#12888. They are now "unignore"-ing Now onto what to do. I think adding (As a side node: the experience between "all-terminal development" and "IDE development" is something that I like keeping the same - all warnings/errors should show up as warnings/errors in both. It's sometimes hard, but totally worth it in the long run.) Also, this will be something fun for me to check on when I upgrade What do you think about the idea above? |
Arrgh, my own work is coming back to haunt me. Does this mean I've made it?! I hope I don't get a reputation for fixing one bug and creating another 😄 On a serious note, @bkendall what you're suggesting looks good to me. However, this comes with the caveat that I have little experience with I agree that, if possible (which it seems to be), ESLint should also be validating I also completely agree with you on trying to keep "all-terminal" and IDE development experiences the same. On a side note - thank you for your digging! I had done some trying to get to the bottom of this myself, but I ended up between |
[REQUIRED] Environment info
firebase-tools: 8.17.0
Platform: macOS Big Sur 11.0.1
[REQUIRED] Test case
See repository at https://github.com/hithomasmorelli/vscode-eslint-parseroptions-project-repro
[REQUIRED] Steps to reproduce
Follow the steps in the README.md file within the repository linked above
[REQUIRED] Expected behavior
As
npm run lint
is set to only run eslint on"src/**/*"
, I think it would be expected for (or, at least, I expected) the VS Code ESLint extension to lint those same files.[REQUIRED] Actual behavior
However, the VS Code ESLint extension seems to work by calling
eslint .
on the specified working directory. This leads to the following problem to display within VS Code when openingfunctions/.eslintrc.js
(as, if I understand correctly, only thesrc
directory - which does not include.eslintrc.js
- isinclude
d withintsconfig.json
):I raised issue microsoft/vscode-eslint#1135 in relation to this, but it was closed as the extension working as expected - as the same result was obtained by running
eslint .
from the terminal.I then enquired as to whether or not there was a way to tell the VS Code ESLint extension to only match a specified pattern (
"src/**/*"
) within thefunctions
working directory - to which the answer was ".eslintignore
".So, here is the dilemma. Should the default
functions
setup include an.eslintignore
file, in order to prevent VS Code (and any other editors/extensions that may use ESLint in this way) from flagging files that we don't actually intend to be linted? And, if an.eslintignore
file is added, and set up so that it excluded everything except for"src/**/*"
, should the command that is run fornpm run lint
be changed to justeslint .
?Interested to hear people's thoughts on this.
The text was updated successfully, but these errors were encountered: