Skip to content

A modern, opinionated ESLint configuration for TypeScript and Vue.js projects with built-in code quality and consistency rules.

License

Notifications You must be signed in to change notification settings

Derviloper/eslint-config

Repository files navigation

@derviloper/eslint-config

A comprehensive ESLint configuration for TypeScript and Vue.js projects with opinionated rules for code quality and consistency.

Features

  • 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:
  • 🚀 Modern ESLint - Uses the new flat config format (ESLint 9+)
  • 📁 Gitignore Integration - Automatically respects your .gitignore file

Installation

npm install --save-dev @derviloper/eslint-config

Peer Dependencies

Make sure you have ESLint installed:

npm install --save-dev eslint

Usage

TypeScript Projects

Create an eslint.config.js file in your project root:

import { config } from "@derviloper/eslint-config";

export default config("typescript");

Vue.js Projects

For Vue.js projects with TypeScript:

import { config } from "@derviloper/eslint-config";

export default config("vue");

Custom Configuration

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",
    },
  },
];

What's Included

TypeScript Configuration

  • 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

Vue.js Configuration (when using "vue")

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

Key Rules Highlights

  • Consistent Type Definitions - Enforces type over interface
  • Import Sorting - Automatically sorts imports alphabetically
  • Object Sorting - Sorts object properties with id and name first
  • 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 Commands

# 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

Requirements

  • ESLint 9.0.0 or higher
  • Node.js 18.0.0 or higher
  • TypeScript 5.0.0 or higher (for TypeScript projects)

License

MIT © Daniel da Silva

Contributing

Issues and pull requests are welcome! Please check the repository for more information.

About

A modern, opinionated ESLint configuration for TypeScript and Vue.js projects with built-in code quality and consistency rules.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published