0.0.5 • Published 4 months ago

@10xscale/eslint-modern v0.0.5

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

@10xScale/eslint-config

A shareable ESLint configuration for React projects, designed to enforce consistent code style and best practices across your codebase. Built for use with ESLint v9+ Flat Config.

Installation

Install the package:

# Using npm
npm install --save-dev @10xscale/eslint-modern

# Using yarn
yarn add --dev @10xscale/eslint-modern

# Using pnpm
pnpm add -D @10xscale/eslint-modern

Install the package and all required peer dependencies:

# Using npm
npm install --save-dev @10xscale/eslint-modern @babel/eslint-parser @eslint/eslintrc @eslint/js eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-promise eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-sonarjs eslint-plugin-unicorn

# Using yarn
yarn add --dev @10xscale/eslint-modern @babel/eslint-parser @eslint/eslintrc @eslint/js eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-promise eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-sonarjs eslint-plugin-unicorn

# Using pnpm
pnpm add -D @10xscale/eslint-modern @babel/eslint-parser @eslint/eslintrc @eslint/js eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-promise eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-sonarjs eslint-plugin-unicorn

Note: You must also install all listed peer dependencies. Check the peerDependencies section in package.json for the required versions.

Usage (ESLint v9+ Flat Config)

Important: This config is published as an ES module. You must set "type": "module" in your project's package.json to use it, or use the .mjs extension for your ESLint config file.

1. Enable ES Modules in your project

Add this to your package.json:

{
  "type": "module"
}

2. Create an eslint.config.js (or .mjs) file in your project root:

// eslint.config.js
import config from '@10xscale/eslint-modern';

export default [
  ...config,
  // Add your custom rules or overrides here
];

If you cannot use type: "module", rename your config to eslint.config.mjs and use the same import/export syntax.

Updating Peer Dependencies

When updating this package, always ensure your project's peer dependencies match the versions specified in package.json. Update them as needed to avoid version conflicts.

Contributing & Contact

Contributions, issues, and suggestions are welcome! Please open an issue or pull request on the repository.

For questions or support, contact the maintainers via the repository's issue tracker.