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.
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-configImportant
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.
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:
// 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;
Alternatively, to use overrides:
Find desired named exports:
javascriptConfigtypescriptConfigreactConfignextConfigreactNativeConfig
// eslint.config.mjs
export { nextConfig, defineConfig } from '@commencis/eslint-config';
export default defineConfig(next, {
// 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
});We welcome contributions to improve this package. Feel free to open issues or pull requests to suggest enhancements or report any issues.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
© Commencis, 2024. All rights reserved.