eslint-config-typescript-shareable

raw JSON →
1.9.0 verified Fri May 01 auth: no javascript maintenance

Shared ESLint, Stylelint, and Prettier configurations for TypeScript projects, version 1.9.0 (stable, last release Oct 2022). Provides consistent linting rules for TypeScript codebases including React, React Hooks, functional programming, import ordering, SCSS, and styled-components. Requires manual installation of many peer dependencies (ESLint 8, Prettier 2, TypeScript 4, etc.). Unlike single-purpose configs, this is a monorepo-style package covering both JS/TS linting and CSS linting with stylelint, aiming for opinionated uniformity across teams.

error Error: Failed to load plugin 'typescript' declared in 'eslint-config-typescript-shareable': Cannot find module 'eslint-plugin-import'
cause Missing peer dependency.
fix
Install the missing plugin: npm install eslint-plugin-import --save-dev
error Error: Cannot find module 'stylelint-config-recommended'
cause Missing peer dependency.
fix
Install: npm install stylelint-config-recommended --save-dev
error ESLint couldn't find the config 'eslint-config-typescript-shareable' after extending.
cause Config not installed or incorrect extends syntax.
fix
Ensure you have installed the package and use the string 'eslint-config-typescript-shareable' in extends array.
error Error: No configuration provided for stylelint
cause Stylelint config file missing or not properly extended.
fix
Create .stylelintrc.js with 'extends': ['eslint-config-typescript-shareable/stylelint']
gotcha Missing peer dependencies will cause silent errors or unexpected behavior.
fix Install all peer dependencies as listed in the package.json.
deprecated The package's last release was in October 2022; updates to ESLint 9 or newer are not available.
fix Consider migrating to more actively maintained configs like @typescript-eslint/eslint-plugin's own recommended config.
breaking The package requires Node.js >=18.0.0.
fix Update Node.js to version 18 or higher.
gotcha The configs are very opinionated; they may override or conflict with other ESLint plugins or custom rules.
fix Review the source configs in the repository to understand rules, and override as needed.
gotcha PostCSS and stylelint plugins may have compatibility issues with newer versions of PostCSS or stylelint.
fix Lock versions to those specified in peer dependencies or test upgrades carefully.
npm install eslint-config-typescript-shareable
yarn add eslint-config-typescript-shareable
pnpm add eslint-config-typescript-shareable

This shows how to install all required peer dependencies and set up ESLint, Stylelint, and Prettier configurations by extending the shared configs from the package.

// Install all peer dependencies:
npm install --save-dev eslint-config-typescript-shareable @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-plugin-functional eslint-plugin-import eslint-plugin-react eslint-plugin-react-hooks postcss postcss-scss postcss-styled postcss-syntax prettier stylelint stylelint-config-recommended stylelint-config-standard-scss stylelint-config-styled-components stylelint-processor-styled-components typescript typescript-styled-plugin

// .eslintrc.js
module.exports = {
  extends: ['eslint-config-typescript-shareable'],
  // Other ESLint settings...
};

// .stylelintrc.js
module.exports = {
  extends: ['eslint-config-typescript-shareable/stylelint'],
};

// .prettierrc.js
module.exports = {
  ...require('eslint-config-typescript-shareable/prettier'),
};