Skip to content
This repository was archived by the owner on Dec 11, 2021. It is now read-only.

Latest commit

 

History

History
67 lines (41 loc) · 2.16 KB

File metadata and controls

67 lines (41 loc) · 2.16 KB

ESLint Configuration for CTU

This is a recommended linter configuration for JavaScript projects based on Standard with extra rules per our guidelines.

Usage

Place .eslintrc.yaml file to your project directory.

You will need the following packages:

You can install all of these as development dependencies:

npm install --save-dev eslint eslint-config-standard

Rules Override

Modify the rules to suit your project. For example, if you have a Node-only project, you may want to remove browser: true from env.

You can also override the rules per-file with special comments. For example you may want to specify environment for worker script in only one file:

/*eslint-env worker */

Or you may have some custom globals:

/*global var1, var2*/

Learn more about ESLint configuration.

React/JSX Projects

For projects using React and/or JSX syntax use standard-react.

You will need these dependencies (in addition to those above):

Install everything as development dependency:

npm install --save-dev eslint eslint-config-standard eslint-config-standard-react eslint-plugin-react

In your .eslintrc.yaml file just add standard-react to the extends property, e.g.:

---
extends: [standard, standard-react]
# rest of the file is the same…

Editor Integration

You will get the most of linting by integrating ESLint to your text editor or IDE. See the list of integrations.

Resources