Starting a personal node project could be easy; starting a team node project could be challenging.
I am a developer currently working in SEEK Australia.
In my experience, common mistakes developer make when starting a projects are:
- No Linting
| //recibe un array y una callback asyncrona | |
| // y cada promesa se va ejecutando secuencialmente | |
| // seria lo contrario a un Promise.all() | |
| // me fue util para manejar los insert en la bd con typeorm y evitar conflictos de ids, duplicacion y fallos en las queries | |
| export const runPromisesSequentally = async ( | |
| arr: any, | |
| asyncFn: (item: any) => Promise<any> | |
| ): Promise<any[]> => { | |
| const allContents = []; | 
| units: { | |
| type: pagination.Page(Unit), | |
| description: "Return the 'first' X number of items 'after' the specified cursor'", | |
| args: { | |
| first: { | |
| type: graphql.GraphQLInt, | |
| description: "Limits the number of results returned in the page. Defaults to 10." | |
| }, | |
| after: { | |
| type: graphql.GraphQLString, | 
Starting a personal node project could be easy; starting a team node project could be challenging.
I am a developer currently working in SEEK Australia.
In my experience, common mistakes developer make when starting a projects are:
| module.exports = { | |
| parser: '@typescript-eslint/parser', // Specifies the ESLint parser | |
| extends: [ | |
| 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin | |
| 'prettier/@typescript-eslint', // agrega las reglas de prettier a eslint | |
| 'plugin:prettier/recommended' // agregar el plugin que integra eslint con prettier | |
| ], | |
| parserOptions: { | |
| ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features | |
| sourceType: 'module' // Allows for the use of imports | 
| { | |
| "env": { | |
| "browser": true, | |
| "es6": true | |
| }, | |
| "extends": ["react-app", "prettier"], | |
| "plugins": ["react", "prettier"], | |
| "parserOptions": { | |
| "ecmaVersion": 2018 | |
| }, | 
| const mongoose = require('mongoose') | |
| const connect = async function () { | |
| try { | |
| await mongoose.connect('mongodb://localhost:27017/graphql-test', { | |
| useNewUrlParser: true, | |
| useUnifiedTopology: true, | |
| }) | |
| console.log('Mongo DB is connected...') | |
| } catch (error) { | 
| { | |
| "env": { | |
| "node": true, | |
| "commonjs": true, | |
| "es2021": true | |
| }, | |
| "extends": ["airbnb-base", "prettier"], | |
| "plugins": ["prettier"], | |
| "parserOptions": { | |
| "ecmaVersion": "latest" | 
| <?php | |
| use Illuminate\Support\Facades\Schema; | |
| use Illuminate\Database\Schema\Blueprint; | |
| use Illuminate\Database\Migrations\Migration; | |
| class CreateRegionsTable extends Migration | |
| { | |
| /** | |
| * Run the migrations. | 
| <template> | |
| <v-dialog v-model="dialog" :max-width="options.width" :style="{ zIndex: options.zIndex }" @keydown.esc="cancel"> | |
| <v-card> | |
| <v-toolbar dark :color="options.color" dense flat> | |
| <v-toolbar-title class="white--text">{{ title }}</v-toolbar-title> | |
| </v-toolbar> | |
| <v-card-text v-show="!!message" class="pa-4">{{ message }}</v-card-text> | |
| <v-card-actions class="pt-0"> | |
| <v-spacer></v-spacer> | |
| <v-btn color="primary darken-1" text @click.native="agree">Yes</v-btn> | 
| //returns true if is empty | |
| Object.keys(obj).length === 0 && obj.constructor === Object |