►
From YouTube: GitLab JavaScript Style Guide
Description
No description was provided for this meeting.
If this is YOUR meeting, an easy way to fix this is to add a description to your video, wherever mtngs.io found it (probably YouTube).
A
A
Firstly,
what
is
a
star
guide.
A
star
guide
is
a
collection
of
rules
that
define
how
code
should
be
written
and
organized.
It
also
serves
as
a
collection
of
best
practices
and
solutions
to
known
issues.
It
could
be
considered
a
blueprint
for
how
code
should
look
within
an
organization,
as
you
can
see
from
the
screenshots
below
this
could
cover
items
such
as
where
braces
are
situated
in
an
if
statement.
A
A
A
A
Eslint
can
be
run
locally
during
development.
It
can
also
be
integrated
into
your
git
workflow.
It
can
highlight
and
often
fix
problems
before
code
is
committed
to
your
branch.
This
can
be
done
manually
or
via
pre-commit
hook.
As
you
can
see
in
the
screenshot,
the
browser
is
complaining
about
the
import
order
of
the
specific
line.
There's
an
eslint
rule
configured
which
specifies
that
imports
should
occur
in
a
certain
order
based
on
the
location
of
the
import.
A
A
A
Another
way
in
which
we
ensure
that
our
style
guide
is
followed
is
via
code
review.
Each
merge
request
undergoes
two
rounds
of
review.
An
initial
review
and
a
maintainer
review
code
review
is
aimed
at
catching
bugs
and
improving
code
quality,
but
also
serves
as
a
great
tool
in
detecting
style
initials,
which
weren't
detected
by
eslint.
A
A
few
of
our
star
guide
suggestions
avoid
for
each
when
mutating
data.
This
minimizes
mutations
in
functions,
which
can
sometimes
cause
hard
to
find
bugs
instead
use
javascript
functions
such
as
map
reduce
or
filter.
These
don't
mutate
the
targeted
object,
but
instead
return
a
new
object
which
minimizes
the
potential
for
side
effects.
A
Limit
the
number
of
parameters
passed
to
a
function
if
your
function
has
more
than
three
parameters
use
an
object.
Instead,
this
is
specifically
useful
when
you
pass
in
multiple
parameters
to
a
function,
and
you
don't
necessarily
want
to
consider
the
order,
and
you
might
potentially
not
be
passing
some
of
the
parameters
through.