Skip to content

Commit

Permalink
Search .htmlhintrc in parent directory
Browse files Browse the repository at this point in the history
  • Loading branch information
yaniswang committed Oct 6, 2015
1 parent 921a842 commit 6a121d7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
22 changes: 18 additions & 4 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
HTMLHint change log
====================

## ver 0.9.8 (2015-10-6)

add:

1. Search `.htmlhintrc` in parent directory
2. Allow comments in json
3. Support hint any file without `.html` or `.htm` extension, just like: `htmlhint test.xhtml`
4. Support json raw format in cli

fix:

1. fix issue: #77 `<link rel=icon><link rel=icon>`
2. Made the descriptions and error messages of rules more clear to people

## ver 0.9.7 (2015-3-8)

fix:
Expand All @@ -27,7 +41,7 @@ add:
1. add rule: src-not-empty

fix:

1. fix attr-value-double-quotes rule: `<img src=''>` should result error

## ver 0.9.3 (2013-5-24)
Expand All @@ -45,14 +59,14 @@ fix:

add:

1. add rule: csslint
1. add rule: csslint
2. add rule: jshint
3. add rule: id-unique
4. add cli

fix:

1. compatible with:
1. compatible with:

<div class="foo"
<div class"foo">
Expand All @@ -75,4 +89,4 @@ add:
10. add rule: style-disabled
11. add rule: tagname-lowercase
12. add rule: tag-pair
13. add rule: tag-self-close
13. add rule: tag-self-close
11 changes: 10 additions & 1 deletion bin/htmlhint
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,16 @@ function listRules(){

function getConfig(configFile){
if(configFile === undefined){
configFile = '.htmlhintrc';
// find default config file in parent directory
var curDir = process.cwd();
while(curDir){
var tmpConfigFile = path.resolve(curDir+path.sep, '.htmlhintrc');
if(fs.existsSync(tmpConfigFile)){
configFile = tmpConfigFile;
break;
}
curDir = curDir.substring(0,curDir.lastIndexOf(path.sep));
}
}
if(fs.existsSync(configFile)){
var config = fs.readFileSync(configFile, 'utf-8'),
Expand Down

0 comments on commit 6a121d7

Please sign in to comment.