Skip to content

Instantly share code, notes, and snippets.

@kenyk7
Last active November 3, 2022 21:58
Show Gist options
  • Save kenyk7/abf55a6f140a32068cc32a15567b22f5 to your computer and use it in GitHub Desktop.
Save kenyk7/abf55a6f140a32068cc32a15567b22f5 to your computer and use it in GitHub Desktop.
Eslint

Mi "App js"

Escribiendo "Hello world" en Javascript

Primer acto

var hello_world ="Hello world"
console.log(hello_world)

Eslint: Error: Unexpected var, use let or const instead no-var

Corrijo y 2do acto

const hello_world ="Hello world"
console.log(hello_world)

Eslint: Error: Identifier 'hello_world' is not in camel case camelcase

Corrijo y 3er acto

const helloWorld ="Hello world"
console.log(helloWorld)

Eslint: Error: Replace "Hello world" with [space]'Hello world'

Corrijo y 4to acto

const helloWorld = 'Hello world'
console.log(helloWorld)

Eslint: Error: Insert ; at the end of line 1

Corrijo y 5to acto

const helloWorld = 'Hello world';
console.log(helloWorld)

Eslint: Error: Insert ; at the end of line 2

Corrijo y 6to acto

const helloWorld = 'Hello world';
console.log(helloWorld);

Eslint: Warning: Unexpected console statement no-console

Donate

Nota: Eslint no muestra los errores 1 a 1, sinó el total, eso fue demostrativo.

Si bien javascript nos permite escribir código como mejor nos plasca, hay herramientas que nos ayudan a mejorar la calidad del mismo.

Los dejo la configuración base para mis applicaciones en React y React/Next.

Boilerplate base para React

Boilerplate base para React/Next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment