What's the best way to handle linting when there are multiple files that will be compiled to a single file that share global variables/functions. For example:
file_1.js:
{
const my_flag = 1;
}
file_2.js:
{
if (my_flag) {
// etc.
When the two files are compiled and combined, there's no problem. But file_1.js throws a linting error related to an unused variable, and file_2.js throws a linting error related to an undefined variable.
I relize I could ignore the specific lines related to the issue, but that's defeating the purpose of linting the files. What's the best way to share the information between the files during the linting process?
The .eslintrc
configuration file allows naming globals which solved the problem:
"globals": {
"my_global": true,
"another_global": true,
"third_global": true
}
http://eslint.org/docs/user-guide/configuring#specifying-globals