eslint-config-lion

raw JSON →
2.2.7 verified Fri May 01 auth: no javascript

eslint-config-lion is a shareable ESLint configuration preset by itsmelion, providing a unified linting style for JavaScript, React, React Native, TypeScript, and Node.js projects. The current stable version is 2.2.7. It relies on peer dependencies installed via install-peerdeps and offers presets for various environments: 'lion' for base, 'lion/react-native' for React Native, 'lion/typescript' for TypeScript web, 'lion/typescript-node' for TypeScript Node, and 'lion/node' for Node. It also includes additional dependency groups for React, TypeScript, and Node. Key differentiator: modular presets with explicit environment-specific configurations.

error Error: Cannot find module 'eslint-plugin-react'
cause Missing peer dependency for React rules.
fix
Run install-peerdeps to install all peer dependencies: npx install-peerdeps --dev eslint-config-lion
error ESLint couldn't find the config "lion/typescript". Check that the package name "eslint-config-lion/typescript" is correct.
cause Incorrect extends value; using full package name or invalid subpath.
fix
Use "extends": "lion/typescript" (short name).
error Configuration for rule "react/jsx-uses-react" is invalid: Value "error" is not an allowed value.
cause Mismatch between ESLint plugin version and configuration; typically due to wrong peer dependency version.
fix
Reinstall peer dependencies with install-peerdeps to match versions.
gotcha Do not manually install peer dependencies; use install-peerdeps to get correct versions.
fix Run npx install-peerdeps --dev eslint-config-lion
gotcha For React projects using Create React App, you must extend both 'lion' and 'react-app'.
fix Set extends to ["lion", "react-app"] and install eslint-config-react-app and eslint-plugin-flowtype.
gotcha Node preset requires setting 'type': 'module' or 'type': 'commonjs' in package.json.
fix Add "type": "module" in package.json for ES modules, or "type": "commonjs" for CommonJS.
gotcha React Native preset requires eslint-import-resolver-alias to be installed.
fix Run npm install --save-dev eslint-import-resolver-alias
npm install eslint-config-lion
yarn add eslint-config-lion
pnpm add eslint-config-lion

Install eslint-config-lion and its peer dependencies, then configure ESLint for a TypeScript project.

# Install peer dependencies automatically (npm 5+)
npx install-peerdeps --dev eslint-config-lion
# Then for TypeScript project, also install:
npm install --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser
# Create .eslintrc.json
cat <<'EOF' > .eslintrc.json
{
  "extends": "lion/typescript"
}
EOF
# Run ESLint
npx eslint .