Skip to content

Crypho/eslint-config-crypho

Repository files navigation

Crypho eslint configuration

This package contains the standard eslint configuration for Crypho.

It exposes separate configurations:: one for normal usage and one for React projects.

JavaScript

For Javascript projects you only need to add @crypho to your .eslintrc:

{
  "extends": [
    "crypho"
  ]
}

This will enable the following rules:

TypeScript

If you use Typescript you will also need to install some extra packages:

npm install @typescript-eslint/eslint-plugin @typescript-eslint/parser --save-dev

or, if you use yarn:

yarn add @typescript-eslint/eslint-plugin @typescript-eslint/parser --only=dev

You must also add crypho/typescript to your .eslintrc configuration file:

{
  "extends": [
    "crypho",
    "crypho/typescript"
  ]
}

React

For React using projects you can also enable a set of React-specific rules:

{
  "extends": [
    "crypho",
    "crypho/react",
  ]
}

This enables several rules:

  • Use Babel to parse files

  • For *.jsx and *.tsx files:

    • Enable JSX parsing
    • Disable the unicorn/filename-case rule
  • Assume a browser environment in all files

  • The recommended rules from eslint-plugin-react

Command-line tools

For packages containing only command-line tools you can use the crypho/cli ruleset:

{
  "extends": [
    "crypho",
    "crypho/cli",
  ]
}

This will:

  • assume the node environment
  • allow console statements