Skip to content

Commit

Permalink
{space,tab}-validator will returns success at empty indented line
Browse files Browse the repository at this point in the history
  • Loading branch information
ndxbn committed Jun 7, 2018
1 parent 9fc3443 commit 38bd79c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/validation/space/space-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const validate = (line, lineNumber, editorconfig) => {
}
}

if (!line.match(/^ *[^\s]+/)) {
if (!line.match(/^ *[\S\r\n]+/)) {
return `${lineNumber}: Mixed indentation (only spaces expected)`;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/validation/tab/tab-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const validate = (line, lineNumber, editorconfig) => {
if (line.length > 0 && editorconfig.indent_style === 'tab') {
// Starts with tab character * (none, one or more)
// and everything but whitespace or space and * (block comment)
if (!line.match(/^\t*([^\s]+| \*)/)) {
if (!line.match(/^\t*([\S\r\n]+| \*)/)) {
return `${lineNumber}: Mixed indentation (only tabs expected)`;
}
}
Expand Down

0 comments on commit 38bd79c

Please sign in to comment.