2.2.0 • Published 3 years ago

@valtech-ch/eslint-config v2.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

eslint-config

Configuration and rules for ESLint, Prettier and TypeScript.

We recommend and assume your project to have TypeScript.

Install

Add this package

yarn add -D @valtech-ch/eslint-config

Add peer dependencies (for existing projects maybe you prefer to add them manually)

npx install-peerdeps -D @valtech-ch/eslint-config

Content

This package contains configurations and rules:

For JavaScript

@valtech-ch/eslint-config/config
@valtech-ch/eslint-config/plugins
@valtech-ch/eslint-config/rules

For React

@valtech-ch/eslint-config/config/react
@valtech-ch/eslint-config/plugins/react
@valtech-ch/eslint-config/rules/react

For Next.js

@valtech-ch/eslint-config/config/react
@valtech-ch/eslint-config/plugins/react
@valtech-ch/eslint-config/rules/nextjs

Usage

  1. To setup ESLint, create a .eslintrc.js file with

    • this content if you want our given config:
module.exports = {
  extends: [
    '@valtech-ch/eslint-config/config',
    '@valtech-ch/eslint-config/plugins',
    '@valtech-ch/eslint-config/rules',
  ],
}
  • or this content if you want your own config instead:
module.exports = {
  // your custom config
  extends: [
    '@valtech-ch/eslint-config/plugins',
    '@valtech-ch/eslint-config/rules',
  ],
}
  1. To setup Prettier, create a prettier.config.js file with this content:

    module.exports = require("@valtech-ch/eslint-config/prettier.config")

  2. To setup TypeScript, create a tsconfig.json file with

    • this content for non-React projects:

    { "extends": "@valtech-ch/eslint-config/tsconfig" }

    • this content for React projects:

    { "extends": "@valtech-ch/eslint-config/tsconfig.react" }

2.2.0

3 years ago

2.1.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago