A set of ESLint rules that enforce best practices used in Croct projects.
This plugin uses ESLint's flat config format (ESLint v9+).
These are the current available presets:
Enforces Croct's standard JavaScript best practices.
To enable this preset, create an eslint.config.mjs file:
import { defineConfig } from 'eslint/config';
import croct from '@croct/eslint-plugin';
export default defineConfig(
croct.configs.javascript,
);Enforces Croct's standard TypeScript best practices.
To enable this preset, create an eslint.config.mjs file:
import { defineConfig } from 'eslint/config';
import croct from '@croct/eslint-plugin';
export default defineConfig(
croct.configs.typescript,
);This preset extends the JavaScript preset – no need to include it as well.
Enforces best practices for React-based projects.
To enable this preset, create an eslint.config.mjs file:
import { defineConfig } from 'eslint/config';
import croct from '@croct/eslint-plugin';
export default defineConfig(
croct.configs.react,
);This preset extends the JavaScript preset – no need to include it as well.
Enforces Croct's best practices for writing Cypress acceptance tests.
To enable this preset, create an eslint.config.mjs file:
import { defineConfig } from 'eslint/config';
import croct from '@croct/eslint-plugin';
export default defineConfig(
croct.configs.cypress,
);This preset extends the JavaScript preset – no need to include it as well.
The plugin also ships with a few custom ESLint rules, all enabled by default in the related preset.
| Rule | Description |
|---|---|
| newline-per-chained-call | Enforces a newline before chained calls. |
| argument-spacing | Enforces a surrounding line break before and after the argument list in multiline functional calls. |
| complex-expression-spacing | Enforces a surrounding line break in complex expression. |
| jsx-attribute-spacing | Enforces a surrounding line break in multiline JSX attributes. |
| min-chained-call-depth | Enforces a minimum depth for multiline chained calls. |