Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use eslint-config-metarhia and fix linting issues #204

Closed
wants to merge 1 commit into from

Conversation

belochub
Copy link
Member

@belochub belochub self-assigned this Oct 18, 2018
lib/array.js Outdated
// Shuffle an array
// arr - array
// Returns: array
const shuffle = arr => (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better remove () in such cases

Suggested change
const shuffle = arr => (
const shuffle = arr => arr.sort(() => Math.random() - 0.5);

lib/callbacks.js Outdated
) => {
// Empty asynchronous callback-last single-argument function
// callback - function, callback to be called with (null)
const nop = callback => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case can't be optimized to single-line

lib/array.js Outdated
// Get last element of array
// arr - array
// Returns: element
const last = arr => (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I mean in all case like this, Nick knows

lib/strings.js Outdated
// s - string
// Returns: string
// Example: escapeRegExp('/path/to/res?search=this.that')
const escapeRegExp = s => (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto here and below.

lib/auth.js Outdated
test: (password, option) => (
stringIncludesChars(password, unicodeCategories.Ll, option.number)
),
test: (password, option) =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer:

test: (password, option) => stringIncludesChars(
  password, unicodeCategories.Ll, option.number
),

lib/auth.js Outdated
test: (password, options) => (
stringIncludesChars(password, unicodeCategories.Lu, options.number)
),
test: (password, options) =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

lib/strings.js Outdated
content.replace(HTML_ESCAPE_REGEXP, char => HTML_ESCAPE_CHARS[char])
);
const htmlEscape = content =>
content.replace(HTML_ESCAPE_REGEXP, char => HTML_ESCAPE_CHARS[char]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const htmlEscape = content => content.replace(
  HTML_ESCAPE_REGEXP,
  char => HTML_ESCAPE_CHARS[char]
);

lib/strings.js Outdated
path.extname(fileName).replace('.', '').toLowerCase()
);
const fileExt = fileName =>
path.extname(fileName).replace('.', '').toLowerCase();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const fileExt = fileName => path.extname(fileName)
  .replace('.', '').toLowerCase();

lib/strings.js Outdated
const capitalize = s => (
s.replace(CAPITALIZE_REGEXP, word => (
const capitalize = s =>
s.replace(CAPITALIZE_REGEXP, word =>
word.charAt(0).toUpperCase() + word.substr(1).toLowerCase()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const capitalize = s => s.replace(
  CAPITALIZE_REGEXP,
  word => word.charAt(0).toUpperCase() + word.substr(1).toLowerCase()
);

@tshemsedinov
Copy link
Member

@belochub please land this

@belochub belochub force-pushed the use-eslint-config-metarhia branch 2 times, most recently from 097dc0f to eb16cf5 Compare October 29, 2018 18:48
belochub added a commit that referenced this pull request Oct 29, 2018
@belochub
Copy link
Member Author

Landed in 5ae54f2.

@belochub belochub closed this Oct 29, 2018
@belochub belochub deleted the use-eslint-config-metarhia branch October 29, 2018 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants