Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
[precommit] lint ts files with eslint (elastic#36218)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer committed May 7, 2019
1 parent d46b0d5 commit 0149f7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/dev/eslint/pick_files_to_lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function pickFilesToLint(log, files) {
const cli = new CLIEngine();

return files.filter(file => {
if (!file.isJs()) {
if (!file.isJs() && !file.isTypescript()) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/dev/precommit_hook/check_file_casing.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ async function checkForSnakeCase(log, files) {

const ignored = matchesAnyGlob(path, IGNORE_FILE_GLOBS);
if (ignored) {
log.debug('%j ignored', file);
log.debug('[casing] %j ignored', file);
return;
}

const pathToValidate = getPathWithoutIgnoredParents(file);
const invalid = NON_SNAKE_CASE_RE.test(pathToValidate);
if (!invalid) {
log.debug('%j uses valid casing', file);
log.debug('[casing] %j uses valid casing', file);
} else {
const ignoredParent = file.getRelativePath().slice(0, -pathToValidate.length);
errorPaths.push(`${dim(ignoredParent)}${pathToValidate}`);
Expand Down

0 comments on commit 0149f7a

Please sign in to comment.