@ofk/eslint-config-recommend

eslint config with typescript and prettier support

Usage no npm install needed!

<script type="module">
  import ofkEslintConfigRecommend from 'https://cdn.skypack.dev/@ofk/eslint-config-recommend';
</script>

README

@ofk/eslint-config-recommend

This is an my eslint config.

It uses Airbnb's as a base, has Prettier and TypeScript ESLint baked in, and overrides some rules I've seen ourselves having to change often.

Quick start

  1. Install the following dev-dependencies:

    npm install --save-dev @ofk/eslint-config-recommend @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint prettier typescript
    
  2. Extend the @ofk/eslint-config-recommend config in your .eslintrc (or eslintConfig key in your package.json):

    "eslintConfig": {
      "extends": "@ofk/eslint-config-recommend",
      // When using in TypeScript. Delete it when using in JavaScript.
      "parserOptions": {
        "project": "./tsconfig.json"
      }
    }
    
  3. Run eslint on your project as part of your lint and format scripts:

    "scripts": {
      "lint": "eslint --ext .js,.jsx,.ts,.tsx .",
      "format": "npm run lint -- --fix",
      "pretest": "npm run lint",
      "test": "test command"
    }
    
  4. (Optional) Set up prettier config in prettier key in your package.json:

    "prettier": "@ofk/eslint-config-recommend/.prettierrc"
    

    Read more about shared configs here, especially if you need to extend/override the default configuration.