A comprehensive ESLint configuration for TypeScript and Vue.js projects with opinionated rules for code quality and consistency.
- ✨ TypeScript Support - Strict TypeScript linting with
typescript-eslint - 🎯 Vue.js Ready - Optional Vue.js configuration with SFC support
- 🔧 Opinionated Rules - Curated set of rules for consistent code style
- 📦 Plugin Integration - Includes popular plugins:
eslint-config-prettier- Prettier compatibilityeslint-plugin-perfectionist- Import and object sortingeslint-plugin-unicorn- Additional JavaScript ruleseslint-plugin-vue- Vue.js specific linting
- 🚀 Modern ESLint - Uses the new flat config format (ESLint 9+)
- 📁 Gitignore Integration - Automatically respects your
.gitignorefile
npm install --save-dev @derviloper/eslint-configMake sure you have ESLint installed:
npm install --save-dev eslintCreate an eslint.config.js file in your project root:
import { config } from "@derviloper/eslint-config";
export default config("typescript");For Vue.js projects with TypeScript:
import { config } from "@derviloper/eslint-config";
export default config("vue");You can extend the configuration with your own rules:
import { config } from "@derviloper/eslint-config";
export default [
...config("typescript"),
{
rules: {
// Your custom rules here
"no-console": "warn",
},
},
];- ESLint Recommended - Base ESLint rules
- TypeScript ESLint - Strict type checking and stylistic rules
- Perfectionist - Automatic sorting of imports, objects, and types
- Unicorn - Modern JavaScript best practices
- Prettier Integration - Disables conflicting formatting rules
Everything from TypeScript configuration plus:
- Vue Recommended - Vue.js specific linting rules
- SFC Support - Single File Component linting
- Template Linting - Vue template specific rules
- Nuxt.js Ready - Special filename casing for Nuxt.js projects
- Consistent Type Definitions - Enforces
typeoverinterface - Import Sorting - Automatically sorts imports alphabetically
- Object Sorting - Sorts object properties with
idandnamefirst - Filename Casing - Enforces camelCase for TypeScript files, PascalCase for Vue components
- No Unused Variables - Strict unused variable detection with underscore prefix exception
- Function Style - Enforces function declarations over expressions
# Development with watch mode
npm run dev
# Build the package
npm run build
# Lint the codebase
npm run lint
# Format code
npm run format
# Type checking
npm run types- ESLint 9.0.0 or higher
- Node.js 18.0.0 or higher
- TypeScript 5.0.0 or higher (for TypeScript projects)
MIT © Daniel da Silva
Issues and pull requests are welcome! Please check the repository for more information.