Skip to content

Commit

Permalink
fix: update the check for root htmlhintrc (#285)
Browse files Browse the repository at this point in the history
**Fixes**: #163 and #181

- [x] Check the commit's or even all commits' message styles matches our requested structure.
- [x] Check your code additions will fail neither code linting checks nor unit test.

#### Short description of what this resolves:

The fix was originally suggested by @phaux and make HTMLHint checking the root for the config file. 

#### Proposed changes:

- Change the tmpConfigFilve variable.
- Force the console to "break" if base is not found.
  • Loading branch information
thedaviddias committed Sep 3, 2018
1 parent 0172d62 commit a6acb03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/htmlhint
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,12 @@ function getConfig(configPath, base, formatter){
base = path.dirname(base);
}
while(base){
var tmpConfigFile = path.resolve(base+path.sep, '.htmlhintrc');
var tmpConfigFile = path.resolve(base, '.htmlhintrc');
if(fs.existsSync(tmpConfigFile)){
configPath = tmpConfigFile;
break;
}
if (!base) {break;}
base = base.substring(0,base.lastIndexOf(path.sep));
}
}
Expand Down

0 comments on commit a6acb03

Please sign in to comment.