@commencis/eslint-config
v3.5.0
Published
Commencis ESLint config
Downloads
802
Readme
@commencis/eslint-config
This package provides the ESLint configuration with custom rules for enforcing coding standards within Commencis projects. With predefined rules and configurations, it ensures consistent code quality and style across codebases.
Installation
To use this ESLint configuration in your project, simply install it as a dev dependency:
With npm:
npm install --save-dev eslint @commencis/eslint-configWith yarn:
yarn add --dev eslint @commencis/eslint-configWith pnpm:
pnpm add --save-dev eslint @commencis/eslint-configUsage
[!IMPORTANT] All the configs provided by this package is for the new ESLint Flat config that supported with
ESLint >= v9
Access the defineConfig function directly from this package, or import it from eslint/config as needed.
Configs & Helper Exports
This package includes pre-configured configs for:
- Javascript
- Typescript
- React
- NextJs
- ReactNative
To use the default rules without additional customization, export the base configuration as shown below:
Basic Usage without Overrides
// eslint.config.mjs
export { default } from '@commencis/eslint-config/react';Default export is available on:
@commencis/eslint-config/javascript;@commencis/eslint-config/typescript;@commencis/eslint-config/react;@commencis/eslint-config/next;@commencis/eslint-config/native;
Flexible Usage with Overrides
Alternatively, to use overrides:
Find desired named exports:
javascriptConfigtypescriptConfigreactConfignextConfigreactNativeConfig
// eslint.config.mjs
export { nextConfig, defineConfig } from '@commencis/eslint-config';
export default defineConfig(next, {
// overrides
});New configFactory Usage with Overrides:
// eslint.config.mjs
export { configFactory, defineConfig } from '@commencis/eslint-config';
const config = configFactory({
react: true,
next: true,
jsxA11y: true,
reactCompiler: true,
});
export default defineConfig(config, {
// overrides
});References
Contribution
We welcome contributions to improve this package. Feel free to open issues or pull requests to suggest enhancements or report any issues.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
© Commencis, 2024. All rights reserved.
