@breadstone-infrastructure/eslint-rules
v0.0.226
Published
Custom eslint rules for mosaik projects
Readme
📦 @breadstone-infrastructure/eslint-rules
| Package Status | Source |
|----------------|--------|
| | infra/eslint-rules |
Custom ESLint rules for the Mosaik Nx workspace and Breadstone projects. Enforces code style, consistency, and best practices for TypeScript/JavaScript and localization.
📁 Project Structure
Part of the monorepo mosaik
Package path: infra/eslint-rules
Version: see npm
License: MIT
📦 Installation
yarn add -D @breadstone-infrastructure/eslint-rules
# or
npm install --save-dev @breadstone-infrastructure/eslint-rules🔧 Usage
Add the rules to your ESLint configuration:
// .eslintrc.js
module.exports = {
extends: [
// ...other configs
],
plugins: [
'@breadstone-infrastructure/eslint-rules'
],
rules: {
'@breadstone-infrastructure/eslint-rules/region-in-classes': 'warn',
'@breadstone-infrastructure/eslint-rules/region-in-interfaces': 'warn',
'@breadstone-infrastructure/eslint-rules/command-naming': 'error',
'@breadstone-infrastructure/eslint-rules/duplicate-keys': 'error',
'@breadstone-infrastructure/eslint-rules/empty-values': 'error',
'@breadstone-infrastructure/eslint-rules/key-consistency': 'error',
'@breadstone-infrastructure/eslint-rules/missing-translations': 'error',
'@breadstone-infrastructure/eslint-rules/multiple-key-usage': 'error',
'@breadstone-infrastructure/eslint-rules/unused-keys': 'error',
'@breadstone-infrastructure/eslint-rules/class-extends-implements-newline': 'warn'
}
};⚙️ Available Rules
| Rule Name | Description |
|----------------------------------|----------------------------------------------------------------------------------------------|
| region-in-classes | Require #region/#endregion tags for Fields, Ctor, Properties, Methods in classes |
| region-in-interfaces | Require #region/#endregion tags for Properties and Methods in interfaces |
| command-naming | Enforce [verb][Object]Command naming for commands |
| duplicate-keys | Detect duplicate translation keys in resource files |
| empty-values | Detect translation keys with empty values |
| key-consistency | Ensure translation keys are consistent across locales |
| missing-translations | Detect missing translations in resource files |
| multiple-key-usage | Detect inconsistent usage of translation keys |
| unused-keys | Detect unused translation keys in resource files |
| class-extends-implements-newline | Ensure extends and implements are on separate lines in class declarations |
| _component-documentation | (WIP) Enforce JSDoc comments for components |
Rule Documentation
- region-in-classes
- region-in-interfaces
- command-naming
- See source files in
src/Rules/Resources/for translation resource rules.
🛠 Recommendations
- Use these rules in conjunction with
@breadstone-infrastructure/eslint-configfor best results. - Integrate into your Nx workspace for consistent linting.
📦 Publishing
yarn nx run eslint-rules:publish📄 License
MIT © Breadstone
