A comprehensive, opinionated ESLint configuration for TypeScript projects with Prettier integration.
- 🎯 TypeScript-first: Built with TypeScript projects in mind
- 🔧 Strict rules: Includes ESLint recommended + TypeScript strict configurations
- 🎨 Prettier integration: Automatic code formatting with conflict resolution
- 📦 Import validation: Smart import/export validation with TypeScript support
- 📚 TSDoc support: Validates TypeScript documentation comments
- ⚡ Modern ESLint: Uses the new flat config format (ESLint 9+)
npm install --save-dev @skellla/lint-config eslint prettier typescript
# or
pnpm add -D @skellla/lint-config eslint prettier typescript
# or
yarn add -D @skellla/lint-config eslint prettier typescript
Create an eslint.config.js
file in your project root:
// Option 1: Import the main config (default export)
import sharedConfig from '@skellla/lint-config';
export default [
...sharedConfig,
// Add your custom rules here if needed
{
rules: {
// Your project-specific overrides
},
},
];
// Option 2: Import the eslint config explicitly
import eslintConfig from '@skellla/lint-config/eslint';
export default [
...eslintConfig,
// Add your custom rules here if needed
{
rules: {
// Your project-specific overrides
},
},
];
Create a prettier.config.js
file in your project root:
import prettierConfig from '@skellla/lint-config/prettier';
export default prettierConfig;
Or extend it with your own settings:
import prettierConfig from '@skellla/lint-config/prettier';
export default {
...prettierConfig,
// Your custom overrides
printWidth: 100,
};
import sharedConfig from '@skellla/lint-config';
export default [
...sharedConfig,
{
// Override for specific file patterns
files: ['src/legacy/**/*.js'],
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
},
},
{
// Additional ignores
ignores: ['build/**', 'public/**'],
},
];
This configuration includes:
- ESLint recommended rules
- TypeScript ESLint strict and stylistic rules
- Import/export validation with TypeScript resolver
- Prettier integration with automatic formatting
- TSDoc validation for documentation comments
- Sensible defaults for Node.js environments
Make sure you have these installed in your project:
eslint
^9.0.0prettier
^3.0.0typescript
^5.0.0
MIT
Issues and pull requests are welcome on GitHub.