Skip to content

Repository files navigation

ESLint config Cecilia

📦 Zero-config ESLint + Prettier setup for JS/React/Node projects with deterministic installs and modern flat config.

Welcome to ESLint config Cecilia

npm version tests license Made with ❤️ by @sandro_m_m

ESLint configuration for my projects.

ESLint config Cecilia is an opinionated shareable ESLint config used in my JavaScript projects (Vanilla.js, React.js or Node.js).

Table of Contents

  1. Goals
  2. Installation
  3. Stability
  4. Debugging
  5. Credits
  6. Contributing
  7. Questions
  8. License

Goals

  • I want to use ESLint to lint my files using the modern flat config
  • I want to use Prettier as a standalone formatter (not inside ESLint)
  • I want a fast and predictable linting experience (no heavy or legacy configs)
  • I want to keep the code clean and consistent across several projects
  • I want to avoid maintaining complex ESLint setups across projects
  • I want consistent and deterministic linting behavior across all environments
  • I want built-in support for code quality, documentation (JSDoc), and modern best practices
  • I want ESLint core recommended rules enabled by default for baseline security and code quality

Installation

Set up the config automatically (recommended)

With npm

npm i -D eslint-config-cecilia
npx cecilia

Or with Yarn

yarn add --dev eslint-config-cecilia
yarn cecilia
  1. Select "1" or "2" to install the necessary dependencies with npm/Yarn
  2. Select the type of project: React (1) Node (2) Both (3) None (4)
  3. Select "y" to create the eslint.config.mjs file
  4. Select "y" to create the .prettierrc.js file
  5. Select "y" to add the lint script commands in your package.json

Optional - Override Rules or Ignore Patterns

Use the eslint.config.mjs if you want to override, extend or add ignore patterns to the config:

// eslint.config.mjs
import cecilia from 'eslint-config-cecilia'

export default [
  // First block for ignores (optional, to add more ignores)
  {
    ignores: [
      '**/custom-ignored-folder/**',
    ],
  },

  // Default cecilia config
  ...cecilia,

  // Block for custom rules
  {
    rules: {
      'no-console': 'off',
      // your custom rules here
    },
  },
]

For more information, see "ESLint Config Files".

Pro tip

Check the list of available rules.

Optional - Specifying Environments

To specify environments, add a block with env:

// eslint.config.mjs
import cecilia from 'eslint-config-cecilia'

export default [
  ...cecilia,
  {
    env: {
      browser: true,
      node: true,
      es2023: true,
    },
  },
]

Optional - Use .prettierrc.js file to change some rules

Example:

module.exports = {
  semi: false,
  singleQuote: true,
  trailingComma: 'all',
}

Optional - Add scripts to the package.json file

Open the package.json file and add the following scripts entries:

  ...

  "scripts": {
    "lint": "eslint \"src/**/*.{js,jsx}\" --cache",
    "lint:fix": "eslint \"src/**/*.{js,jsx}\" --fix --cache",
    "format": "prettier --write ."
  }

  ...

Usage

Run the script

yarn lint or npm run lint to lint your code (fast with cache).

yarn lint:fix or npm run lint:fix to lint and fix your code.

yarn format or npm run format to format your code using Prettier.

Pro tip

Install ESLint and Prettier extensions for Visual Studio Code.

Stability

Cecilia installs all dependencies using fixed versions to ensure deterministic behavior.

This means:

  • The linting results are consistent across machines and environments
  • No unexpected rule changes after reinstalling dependencies
  • Updates only happen when you explicitly upgrade Cecilia
  • No hidden performance regressions caused by third-party configs

This avoids common issues caused by version ranges (e.g. ^) where plugin updates can silently change linting behavior.

Debugging

It will print the resolved config, including all rules and plugins used internally.

npx cecilia-debug

It will print the resolved config, including all extended rules and environments, like this:

{
  "extends": [
    "@eslint/js (recommended)",
    "./rules/unicorn.js",
    "./rules/jsdoc.js",
    "./rules/react-hooks.js",
    "./rules/react.js",
    "./rules/cecilia.js"
  ],
  "env": {
    "browser": true,
    "jest": true,
    "node": true
  },
  "parserOptions": {
    "ecmaVersion": "latest",
    "sourceType": "module",
    "ecmaFeatures": { "jsx": true }
  }
}

Credits

Core Rules

  • @eslint/js recommended rules
    • Includes essential rules like no-undef, no-unused-vars, no-debugger, no-cond-assign, etc.

Plugins

Contributing

Want to contribute? All contributions are welcome. Read the contributing guide.

Questions

If you have questions tweet me at @sandro_m_m or open an issue.

License

This project is licensed under the MIT License - see the LICENSE file for details

~ sharing is caring ~

This project helped you? Please consider giving this repository a star ⭐.

Releases

Packages

Used by

Contributors

Languages