Skip to content

Commit

Permalink
fixup! Use eslint-config-metarhia and fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
belochub committed Oct 24, 2018
1 parent 4e0f9ae commit e12346a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
10 changes: 6 additions & 4 deletions lib/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ const passwordTests = {
options: { number: 2 },
},
MIN_LOWERCASE_CHARS: {
test: (password, option) =>
stringIncludesChars(password, unicodeCategories.Ll, option.number),
test: (password, option) => stringIncludesChars(
password, unicodeCategories.Ll, option.number
),
hint: options => ({ name: 'MIN_LOWERCASE_CHARS', number: options.number }),
options: { number: 1 },
},
MIN_UPPERCASE_CHARS: {
test: (password, options) =>
stringIncludesChars(password, unicodeCategories.Lu, options.number),
test: (password, options) => stringIncludesChars(
password, unicodeCategories.Lu, options.number
),
hint: options => ({ name: 'MIN_UPPERCASE_CHARS', number: options.number }),
options: { number: 1 },
},
Expand Down
18 changes: 10 additions & 8 deletions lib/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ const ALPHA_DIGIT = ALPHA + DIGIT;
// content - string, to escape
// Returns: string
// Example: htmlEscape('5>=5') = '5<=5'
const htmlEscape = content =>
content.replace(HTML_ESCAPE_REGEXP, char => HTML_ESCAPE_CHARS[char]);
const htmlEscape = content => content.replace(
HTML_ESCAPE_REGEXP,
char => HTML_ESCAPE_CHARS[char]
);

const subst = (
// Substitute variables
Expand Down Expand Up @@ -91,8 +93,8 @@ const subst = (
// Returns: string
// Example: fileExt('/dir/file.txt')
// Result: 'txt'
const fileExt = fileName =>
path.extname(fileName).replace('.', '').toLowerCase();
const fileExt = fileName => path.extname(fileName)
.replace('.', '').toLowerCase();

// Remove file extension from file name
// fileName - string, file name
Expand All @@ -106,10 +108,10 @@ const CAPITALIZE_REGEXP = /\w+/g;
// Capitalize string
// s - string
// Returns: string
const capitalize = s =>
s.replace(CAPITALIZE_REGEXP, word =>
word.charAt(0).toUpperCase() + word.substr(1).toLowerCase()
);
const capitalize = s => s.replace(
CAPITALIZE_REGEXP,
word => word.charAt(0).toUpperCase() + word.substr(1).toLowerCase()
);

const UNDERLINE_REGEXP = /_/g;

Expand Down
5 changes: 3 additions & 2 deletions lib/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ const callerFilepath = (depth = 0, stack = null) => {
return '';
};

const callerFilename =
(depth = 0, stack = null) => basename(callerFilepath(depth + 1, stack) || '');
const callerFilename = (depth = 0, stack = null) => basename(
callerFilepath(depth + 1, stack) || ''
);

module.exports = {
deprecate,
Expand Down

0 comments on commit e12346a

Please sign in to comment.