1.0.5 • Published 8 months ago

@miorso/eslint-config v1.0.5

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

@miorso/eslint-config

A shared and customizable ESLint configuration for consistent code quality and style across projects.

⚠️ Requires ESLint 9 or later

Install

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

Configuration

The following table lists the available configuration options:

OptionDefaultDescription
coretrueEnables core ESLint rules.
javascripttrueEnables JavaScript-specific rules.
typescriptfalseEnables TypeScript support.
styletrueEnables code styling rules.
reactfalseEnables React-specific rules.
qualitytrueEnables additional quality rules.
vitesttrueEnables support for the Vitest testing framework.
playwrightfalseEnables support for the Playwright framework.

Usage

Create an eslint.config.js file in your project and import the configuration:

Basic Configuration

import { getConfig } from '@miorso/eslint-config';

export default getConfig({});

Custom Configuration

You can customize the configuration by passing an options object:

import { getConfig } from '@miorso/eslint-config';

export default getConfig({
	core: true,
	javascript: true,
	typescript: true,
	style: true,
	react: true,
	quality: true,
	vitest: true,
	playwright: false,
});

Extending the Configuration

If you need to modify specific ESLint rules while still using the shared base configuration, you can extend it programmatically:

import { getConfig } from '@miorso/eslint-config';

/** @type {import("eslint").Linter.Config[]} */
const config = [
	...getConfig({ typescript: true, react: true }),
	{
		rules: {
			'no-console': 'off',
		},
	},
];

export default config;

💡 For more details on ESLint rules and configuration, visit ESLint's official documentation.