Skip to content

Latest commit

 

History

History
60 lines (43 loc) · 2.97 KB

README.md

File metadata and controls

60 lines (43 loc) · 2.97 KB

eslint-config-konnektid

Version 2.0.0

Shareable ESLint (2.0.0+) configuration package for Konnektid code style guides.

Optional dependencies

Working with Babel (ES7) and/or React (JSX) requires you to install a couple of extra dependencies:

    npm install --save-dev babel-eslint eslint-plugin-babel eslint-plugin-react

Basic usage

In your .eslintrc file, add

    { "extends": "konnektid" }

to load the basic configuration. For frontend code, use:

    { "extends": "konnektid/frontend" }

This enables the use of JSX and switches to the browser environment.

Advanced usage

We offer a couple of variations on the basic configuration that you can extend from:

Preset Description ECMA Features Environment
konnektid Basic configuration for Node 5.0.0 projects. ES6 Node
konnektid/tool Relaxes some rules for development scripts/tooling. ES6 Node
konnektid/babel Use for code that transpiles with Babel (stage 2). Babel Node
konnektid/module2, 5 Use for ES6 Modules (export/import syntax). Babel + Modules Node
konnektid/react1, 2 Use for React components with JSX syntax. Babel + JSX Node
konnektid/frontend1, 2 Use for frontend code with React components. Babel + JSX Browser (Webpack3)
konnektid/universal2, 4 Use for code shared between Node and browser. Babel Universal (Webpack3)
konnektid/test5 Add to the unit tests folder. ES6 Mocha
  • [1] Note that both the react and frontend configuration require eslint-plugin-react to be installed.
  • [2] Working with ES7 (Babel) code requires babel-eslint and eslint-plugin-babel to be installed.
  • [3] This allows the use of RequireJS style modules.
  • [4] The universal preset only allows code that works in both NodeJS and the browser. When including environment-specific (conditional) code, make sure to explicitly define the environment of that code as either node or browser.
  • [5] The test and module preset should be combined with the base konnektid or frontend preset.

Happy coding!