Permalink
Browse files

Chore: regex.test => string.startsWith (#9518)

  • Loading branch information...
Aladdin-ADD committed Oct 25, 2017
1 parent de0bef4 commit 350a72cd452cd5130d6d67e1abfaab80496c85fa
Showing with 3 additions and 3 deletions.
  1. +1 −1 Makefile.js
  2. +2 −2 lib/cli-engine.js
View
@@ -978,7 +978,7 @@ target.checkGitCommit = function() {
}
// Only check non-release messages
if (!semver.valid(commitMsgs[0]) && !/^Revert /.test(commitMsgs[0])) {
if (!semver.valid(commitMsgs[0]) && !commitMsgs[0].startsWith("Revert")) {
if (commitMsgs[0].split(/\r?\n/)[0].length > 72) {
echo(" - First line of commit message must not exceed 72 characters");
failed = true;
View
@@ -240,8 +240,8 @@ function processFile(filename, configHelper, options, linter) {
function createIgnoreResult(filePath, baseDir) {
let message;
const isHidden = /^\./.test(path.basename(filePath));
const isInNodeModules = baseDir && /^node_modules/.test(path.relative(baseDir, filePath));
const isInBowerComponents = baseDir && /^bower_components/.test(path.relative(baseDir, filePath));
const isInNodeModules = baseDir && path.relative(baseDir, filePath).startsWith("node_modules");
const isInBowerComponents = baseDir && path.relative(baseDir, filePath).startsWith("bower_components");
if (isHidden) {
message = "File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override.";

0 comments on commit 350a72c

Please sign in to comment.