Shakacode ESLint Config

raw JSON →
19.0.0 verified Sat Apr 25 auth: no javascript

An ESLint shareable config used by ShakaCode for JavaScript and React projects. Current stable version 19.0.0 requires ESLint ^7.32.0 || ^8.2.0, eslint-plugin-import ^2.25.4, eslint-plugin-jsx-a11y ^6.5.1, and eslint-plugin-react ^7.28.0. Its version number aligns with eslint-config-airbnb. Differentiators: offers separate base config for non-React projects, follows Airbnb style guide with ShakaCode customizations, and has a history of breaking changes tied to major version bumps of dependencies.

error Error: Cannot find module 'eslint-config-shakacode'
cause Package not installed or missing peer dependencies.
fix
npm install --save-dev eslint-config-shakacode eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react
error ESLint couldn't find the config 'eslint-config-shakacode/base'
cause Typo or wrong extension name.
fix
Use 'eslint-config-shakacode/base' for base config, 'eslint-config-shakacode' for React.
error Configuration for rule 'react/jsx-indent' is invalid
cause Outdated rule config incompatible with installed eslint-plugin-react version.
fix
Update eslint-plugin-react to match config's peer requirement.
breaking Version 5.0.0 breaks: eslint-config-airbnb updated to 9.x.x and eslint-plugin-react to 5.x.x.
fix Update to latest config and adjust code for new Airbnb rules.
breaking Version 4.0.0 breaks: babel-eslint updated to 6.x.x.
fix Update babel-eslint to 6.x.x and ensure compatibility.
breaking Version 3.0.0 breaks: eslint-config-airbnb updated to 6.x.x and babel-eslint to 5.x.x. New rules: no-return-assign: [2, 'always'] and no-param-reassign: [2, { 'props': false }].
fix Update dependencies and adjust code for new rules.
breaking Version 2.0.0 breaks: babel-eslint and eslint-config-airbnb moved from devDependencies to dependencies.
fix Ensure these packages are installed as regular dependencies.
gotcha The config version number matches eslint-config-airbnb, not ESLint itself.
fix Check that eslint-config-airbnb version aligns with this config.
deprecated Some rules from earlier versions may be deprecated in newer ESLint.
fix Run eslint --fix and migrate rule configs as needed.
npm install eslint-config-shakacode
yarn add eslint-config-shakacode
pnpm add eslint-config-shakacode

Shows how to configure ESLint to extend Shakacode config in .eslintrc.yml, including peer dep install.

// .eslintrc.yml
---
extends: eslint-config-shakacode

// For non-React projects:
// extends: eslint-config-shakacode/base

// Install peer dependencies:
// npm install --save-dev eslint eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react