eslint-config-olo
raw JSON → 0.2.0 verified Sat Apr 25 auth: no javascript maintenance
Olo's ESLint shared config, based on Airbnb's style guide. Current version 0.2.0, released as a shared config for ES6+ and React projects. It exports three configurations: default (ES6+), React (ES6+ with React), and legacy (ES5-). Requires eslint as a peer dependency, babel-eslint for modern configs, and eslint-plugin-react for React config. Not actively maintained: last release in 2016, and TSLint configs have been deprecated. Suitable for legacy projects but not recommended for new projects.
Common errors
error Cannot find module 'eslint-config-olo' ↓
cause Forgot to install eslint-config-olo as a devDependency or missing npm install
fix
npm install eslint-config-olo --save-dev
error ESLint couldn't find the plugin "babel-eslint" ↓
cause babel-eslint is required but not installed
fix
npm install babel-eslint --save-dev
error Error: Failed to load plugin 'react' ↓
cause Using the 'olo/react' config without installing eslint-plugin-react
fix
npm install eslint-plugin-react --save-dev
error Parsing error: Unexpected token ↓
cause Using ES6 syntax but the parser is not set to babel-eslint
fix
Add "parser": "babel-eslint" to your .eslintrc
Warnings
deprecated tslint-config-olo is deprecated and not maintained ↓
fix Migrate to eslint or typescript-eslint
breaking Version 0.2.0 requires eslint^3.0.0 and may not work with newer ESLint versions ↓
fix Pin eslint to ^3.0.0 or use a more modern config
gotcha Rules defined as warnings may transition to errors in future versions; do not ignore them permanently ↓
fix Address warnings as if they were errors to avoid future breakage
Install
npm install eslint-config-olo yarn add eslint-config-olo pnpm add eslint-config-olo Imports
- extends: 'olo' wrong
"extends": "eslint-config-olo"correct"extends": "olo" - extends: 'olo/react' wrong
"extends": "olo-react"correct"extends": "olo/react" - extends: 'olo/legacy' wrong
"extends": "olo/legacy"correct"extends": "olo/legacy"
Quickstart
// eslintrc.json
{
"extends": "olo",
"parser": "babel-eslint",
"rules": {
"no-console": "warn"
}
}
// package.json
devDependencies: {
"eslint": "^3.0.0",
"babel-eslint": "^7.0.0",
"eslint-config-olo": "^0.2.0"
}