Is there a way to configure the linting folder in the .eslintrc.json
file rather than within the package.json
?
package.json (snippet)
"scripts: {
"lint": "eslint ./src --ext .js,.jsx,.ts,.tsx",
}
I'm interested in simplifying it to:
"scripts: {
"lint": "eslint",
}
and setting the path and extensions in the .eslintrc.json
file.
Alternatively, can I use the .eslintignore
file to exclude everything except for the ./src
folder when linting. I want to focus only on the src-folder and not the root directory. This requirement also extends to using the eslint
plugin in vscode
.
This is my current approach:
.eslintignore
/*
!/src
I find myself wondering why there isn't an option in the configuration files to specify the folders to lint. I am searching for the most common and elegant solution, as I have not come across a similar discussion to address my issue.