Skip to content

Commit

Permalink
[7.x] [precommit] lint ts files with eslint (#36218) (#36236)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer authored May 8, 2019
1 parent 57459db commit 9079b26
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 9079b26

Please sign in to comment.