0.0.29 • Published 9 months ago

@gcomas/huenei-eslint v0.0.29

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Logo

Extend ESLint Configuration

License: MIT

This guide explains how to extend an existing ESLint configuration in your project. By extending a shared or base configuration, you can standardize linting rules across multiple projects while still allowing for customizations.

Installation

npm install @huenei/eslint

Prerequisites

Ensure you have the following installed:

  • Node.js: Version 22.6.0 or later.
  • npm or yarn: For managing dependencies.
  • ESLint: Install locally in your project:
npm install eslint --save-dev

Usage

Customize ESLint Config file

Add the extended configuration to the config file.

eslint.config.js

import hueneiLinter from '@huenei/eslint'

/** @type {import('eslint').Linter.Config[]} */
export default [
   { files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] }, // affected extensions
   { languageOptions: { globals: globals.browser } }, 
   ...hueneiLinter.plugins, // extends plugins
   {
      rules: {
            ...hueneiLinter.rules, // extends rules
      },
      ignores: ['node_modules', 'dist'],
      languageOptions: {
            ecmaVersion: 'latest',
            sourceType: 'module',
      },
   },
]

Run ESLint in your project

Add a script to your package.json:

{
   "scripts": {
      "lint": "eslint .",
      "lint:fix": "eslint . --fix"
   }
}

Then run

npm run lint

Customizing the Configuration

You can override or add specific rules or add more extensions to tailor the ESLint configuration to your project's needs. Place these overrides under the rules section in your .eslint.config.js file.

import hueneiLinter from '@huenei/eslint'

/** @type {import('eslint').Linter.Config[]} */
export default [
   { languageOptions: { globals: globals.browser } }, 
   ...hueneiLinter.plugins,
   ..newExtensions // add more extension rules
   {
      rules: {
            ...hueneiLinter.rules,
            indent: ['error', 4] // override rules
      },
   },
]
0.0.29

9 months ago

0.0.28

10 months ago

0.0.27

10 months ago

0.0.26

10 months ago

0.0.25

10 months ago

0.0.24

10 months ago

0.0.23

10 months ago

0.0.22

10 months ago

0.0.21

10 months ago

0.0.20

10 months ago

0.0.19

10 months ago

0.0.18

10 months ago

0.0.17

10 months ago

0.0.16

10 months ago

0.0.15

10 months ago

0.0.14

10 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago