Codility Solutions

TOC

Introduction

All solutions from Codility

Workspace

  • Visual Studio Code 1.45.1

    • VSCode extensions:

      • Prettier - Code formatter 4.7.0
      • Eslint 2.1.5
      • VSCode MDX 0.1.4
    • VSCode settings:

    {
      "editor.defaultFormatter": "esbenp.prettier-vscode",
      "editor.codeActionsOnSave": {
        "source.fixAll.eslint": false
      },
      "javascript.validate.enable": false,
      "eslint.validate": ["markdown", "md", "mdx"],
      "prettier.requireConfig": true,
    }

Configuration

  1. Install these packages/applications (prefer the listed versions):
  • Node 12.18.2
  • Yarn 1.21.1
  1. Install all dependencies with yarn (not npm!!)
yarn
  1. Run each file with (only need the required params)
node filename.js param1 param2 param3 param4...
  1. Commands
# Installs all dependendies
$ yarn

# Checks Eslint errors
$ yarn lint

# Formats all files with prettier
$ yarn format

# Checks if all files are formatted with prettier
$ yarn check-format

# Checks typescript errors
$ yarn check-types

# Commits with karma interface
$ yarn commit