eslint-plugin-astige
v0.0.37
Published
Anthony Astige's eslint base with custom rules
Downloads
64
Readme
eslint-plugin-astige
My personal ESLint plugin collection containing multiple focused plugins with recommended configurations.
Installation
npm install eslint-plugin-astige --save-dev
npx eslint-plugin-astige-initUsage (eslint.config.ts)
Assuming you're using ESLint's new flat config system and have TypeScript support, you can add the auto plugin collection to your ESLint configuration and optionally customize:
import { type FlatConfig } from "@typescript-eslint/utils/dist/ts-eslint";
import * as astige from "eslint-plugin-astige";
const config: FlatConfig.Config[] = [
// Get all the recommended configs
...astige.auto,
// Optionally: Take or override specific plugin rules
{
plugins: {
"astige-javascript": astige.plugins.javascript,
},
rules: {
"astige-javascript/no-tsx-without-jsx": "warn",
"astige-javascript/fta-complexity-needs-improvement": [
"error",
{ "when-above": 66 },
],
},
},
];
export default config;Plugins
📏 Contains Custom Rules
Guiding Principles
This extremely opinionated preset is designed with these key principles:
- One Right Way: The config is intentionally strict and opinionated to encourage consistency across all projects. There should be minimal ambiguity about how code should be written. This is still JavaScript/TypeScript though, so there will be inherent flexibility.
- Formatters First: Linters are not formatters and are inherently slower. We rely on formatters for whatever they can do, and minimize the formatting work we have ESLint do.
- TypeScript Best Practices: Fully embrace TypeScript's type system and idioms, following TypeScript conventions and best practices wherever practical.
- Fast: Any included rules should be fast enough to run across entire codebases with hundreds of files in seconds, and on individual files within milliseconds for complete analysis and editor integration.
- LLM-Friendly Code: The rules are optimized for code that is easily processed and understood by large language models (LLMs), emphasizing clear and explicit code patterns with minimal use of complex or ambiguous syntax. The code maintains consistent formatting and structure while being modular and concise for better context window management. This results in consistent, predictable code patterns that are easy to parse, simple to extend, and clear in intent.
- Technology Foundations: The preset is built around a carefully curated set of core technologies that provide a stable development foundation. Current primary influences include:
- Custom Rules When Necessary: While I prioritize leveraging existing ESLint rules to maintain consistency and development speed, I'm willing to create custom rules when needed to enforce my guiding principles and address specific needs.
- Multiple Sub-Plugins: The plugin is structured as a collection of sub-plugins in a single repository to enable logical grouping by usage, modular rule adoption, and a single source of truth for all shared ESLint configurations. This approach simplifies dependency management, versioning, and coding of multiple plugins while enabling focused development and testing of specific rule sets.
The plugins
📏 Contains Custom Rules
Tightly Coupled Non-ESLint Configurations
These base configurations are included and installed with npx eslint-plugin-astige-init. They help reduce conflicts and duplication with ESLint rules:
dprint.base.json: Handles code formatting to minimize ESLint formatting rulestsconfig.base.json: Manages TypeScript compiler options to reduce overlap with ESLint rules
Contributing
While this is primarily my personal preset, I welcome suggestions and discussions about the rules. Please open an issue to start a conversation.
License
ISC
Related
- ESLint - Pluggable JavaScript linter
- TypeScript ESLint - TypeScript support for ESLint
