-
Notifications
You must be signed in to change notification settings - Fork 41
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
Search for .jshintrc file by scanning up directories from the current file instead of checking the root of the project only #25
Comments
I just thinking about this issue, brackets can´t handle the current file path for inspection? the problem seems be in function getJshintrcFile () {
var dirPath = document.file.fullPath.split('/');
var result;
while ( dirPath != ProjectManager.getProjectRoot().fullPath && !result) {
dirPath.pop();
result = FileSystem.getFileForPath(dirPath.join('/') + '.jshintrc');
}
return result;
} I´ll spent some time on this, cause now i´m just learning how to build the environment to test and debug the this plugin code... |
@globexdesigns the behavior simulating node's version of jshint behavior will be implemented once support for asynchronous providers will be in place. it will be soon, hopefully. currently, as you mentioned, only the file at the project root is loaded (it's documented in README.md at the very top), because the only opportunity to load anything is the start-up and it's done in a hacky way. however, i don't think it should go beyond the project tree. it's not a good thing for an extension to scan the entire filesystem. the most important use case, IMO, for the project tree scan are submodules which may use different jshint settings. it is important to distinguish node's jshint executable and brackets extension based on JSHint api. i believe brackets should limit its scope of fs acces to the project root. at the end, jshintrc setup is (ideally) once per project and it contains project-specific settings, such as "global" section. |
Any update on this since sprint 37 was released? |
The ability to do async linting wasn't adding in 37 afaik. |
+1 |
+1 |
I'm open to someone doing a PR for this. |
JSHint docs current state:
"In case of .jshintrc, JSHint will look for this file in the current working directory and, if not found, will move one level up the directory tree all the way up to the filesystem root. (Note that if the input comes from stdin, JSHint doesn't attempt to find a configuration file)"
However, brackets-jshint currently only scans the project root directory for this file.
Can we update the extension to behave the way JSHint was designed?
The text was updated successfully, but these errors were encountered: