Tâmia ESLint config
JavaScript
Clone or download
sapegin Changelog: 🚀
* Update to ESLint 5
Latest commit c2c720a Jul 5, 2018
Permalink
Failed to load latest commit information.
rules
test
.editorconfig
.eslintignore
.eslintrc
.gitignore
.npmignore
.travis.yml
Readme.md Remove Prettier plugin, extend eslint:recommended Dec 19, 2017
index.js Feat: Update to ESLint 4, Yarn → npm 5 Jun 13, 2017
legacy.js
package-lock.json
package.json Chore: Update semantic-release Jul 5, 2018
react.js

Readme.md

eslint-config-tamia

Build Status npm

This package provides Tâmia’s .eslintrc as an extensible shared config. Based on eslint-config-airbnb.

Should be used with Prettier, has no own code style rules.

Usage

We export three ESLint configurations:

eslint-config-tamia

Our default export contains all of our ESLint rules, including EcmaScript 6+. It requires eslint.

npm install --save-dev eslint-config-tamia eslint

.eslintrc:

{
  "extends": "tamia"
}

eslint-config-tamia/react

Lints ES6+ but and React. Requires eslint and eslint-plugin-react.

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

.eslintrc:

{
  "extends": "tamia/react"
}

eslint-config-tamia/legacy

Lints ES5 and below. Only requires eslint.

npm install --save-dev eslint-config-tamia eslint

.eslintrc:

{
  "extends": "tamia/legacy"
}

Code style at a glance

  • Tab indentation.
  • Single-quotes.
  • Semicolons.
  • Declare variables just before their first usage.
  • Multiple variable statements.
  • Make const, not var.
  • Use === and !== over == and !=.
  • Return early.
  • Limit line lengths to 80 chars.
  • Prefer readability over religion.
  • Use ES6.

Example:

function eatFood(food) {
	if (!food.length) {
		return ['No food'];
	}

	return food.map(dish => `No ${dish.toLowerCase()}`);
}

const food = ['Pizza', 'Buger', 'Coffee'];
console.log(eatFood(food));

See ESlint config docs for more information.