An open API service indexing awesome lists of open source software.

https://github.com/joska-p/my-eslint-config

A shareable ESLint configuration for my JavaScript projects. Includes a basic set of rules to maintain code quality and consistency.
https://github.com/joska-p/my-eslint-config

code-quality configuration eslint javascript linting

Last synced: 3 months ago
JSON representation

A shareable ESLint configuration for my JavaScript projects. Includes a basic set of rules to maintain code quality and consistency.

Awesome Lists containing this project

README

        

# My ESLint Config

This is a simple NPM package that exports a ESLint configurations for my JavaScript projects.

## Installation

To use this ESLint configuration, you'll need to install the package as a development dependency in your project:

```shell
npm install --save-dev @jpotin/my-eslint-config
```

## Usage

Once the package is installed, you can use the exported configuration in your react project's .eslintrc.config.mjs file.

```mjs
import { config } from "@jpotin/my-eslint-config/react";

/** @type {import("eslint").Linter.Config} */
export default config;
```

Alternatively, you can specify the configuration in your package.json file:

```json
{
"eslintConfig": {
"extends": "my-eslint-config"
}
}
```

## Configuration

The package export 2 configurations:

### Base configuration

The base configuration includes the following rules:

- no-console: Warn when using console.log() statements

- no-unused-vars: Disables this rule, as it is handled by TypeScript.

- import/order: Enforces a consistent ordering of imports, with built-in modules first, followed by external modules, parent modules, sibling modules, and index modules.

### React Configuration

The React configuration extends the base configuration and adds the following rules:

- react: Enables the React plugin.

- react-hooks: Enables the React hooks plugin.

- jsx-a11y: Enables the jsx-a11y plugin.

- react-compiler: Enables this rule with an error severity.

You can customize or extend this configuration by creating your own .eslintrc.config.mjs file in your project and overriding the rules as needed.

## Contributing

If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the [GitHub repository](https://github.com/joska-p/my-eslint-config).

## License

This project is licensed under the [MIT License](https://mit-license.org/).