@favorodera/eslint-config 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1 +1,148 @@
1
- # Eslint Config
1
+ <div align="center">
2
+ <h1>ESLint Config</h1>
3
+ <p><strong>Opinionated, type-safe flat ESLint configuration factory</strong></p>
4
+ <p>
5
+ <a href="https://github.com/favorodera/eslint-config/blob/main/LICENSE"><img src="https://img.shields.io/github/license/favorodera/eslint-config.svg?style=plastic&label=License&color=blue" alt="License"></a>
6
+ <a href="https://github.com/favorodera/eslint-config/stargazers"><img src="https://img.shields.io/github/stars/favorodera/eslint-config.svg?style=plastic&label=Stars&color=blue" alt="GitHub Stars"></a>
7
+ <a href="https://www.npmjs.com/package/@favorodera/eslint-config"><img src="https://img.shields.io/npm/v/@favorodera/eslint-config.svg?style=plastic&label=Version&color=blue" alt="NPM Version"></a>
8
+ </p>
9
+ </div>
10
+
11
+ <br>
12
+
13
+ An opinionated, highly customizable ESLint flat configuration factory. It provides a seamless, type-safe linting experience out-of-the-box for Vue, TypeScript, Tailwind CSS, Markdown, and more.
14
+
15
+ ## Features
16
+
17
+ - **Flat Config First** — Built from the ground up for ESLint's new flat config system.
18
+ - **TypeScript Support** — Robust linting for TypeScript out of the box.
19
+ - **Vue Integration** — First-class support for Vue 3 single-file components.
20
+ - **Stylistic Rules** — Consistent code styling powered by ESLint Stylistic.
21
+ - **Tailwind CSS** — Built-in rules for Tailwind classes sorting and best practices.
22
+ - **Auto-formatting** — Formats JSON, JSONC, Markdown, and JS/TS automatically.
23
+ - **Type-safe Rules** — Rules are generated with JSDoc comments, giving you rich auto-complete and descriptions right in your IDE.
24
+ - **Highly Configurable** — Easily enable or disable specific rulesets based on your project's needs.
25
+
26
+ ## Supported Configs
27
+
28
+ The following configurations are bundled and enabled by default (they can be individually disabled or customized):
29
+
30
+ - **JavaScript** — Core ESLint rules (`@eslint/js`)
31
+ - **TypeScript** — Type-aware linting (`typescript-eslint`)
32
+ - **Vue** — Single-file component support (`eslint-plugin-vue`, `vue-eslint-parser`)
33
+ - **Stylistic** — Formatting rules (`@stylistic/eslint-plugin`)
34
+ - **Tailwind CSS** — Utility class linting and sorting (`eslint-plugin-better-tailwindcss`)
35
+ - **Imports** — Auto-sorting and unused imports removal (`eslint-plugin-import-lite`, `eslint-plugin-unused-imports`)
36
+ - **Markdown** — Linting for markdown files and embedded code blocks (`@eslint/markdown`)
37
+ - **JSON/JSONC/JSON5** — Formatting and sorting for JSON files like `package.json` (`eslint-plugin-jsonc`)
38
+ - **JSDoc** — Standardized comment formatting (`eslint-plugin-jsdoc`)
39
+ - **Unicorn** — Various code quality improvements (`eslint-plugin-unicorn`)
40
+ - **Perfectionist** — Sorting objects, imports, classes, etc. (`eslint-plugin-perfectionist`)
41
+ - **Node** — Node.js specific linting rules (`eslint-plugin-n`)
42
+
43
+
44
+ ## Usage
45
+
46
+ ### Install
47
+
48
+ <details>
49
+ <summary><b>pnpm</b></summary>
50
+
51
+ ```bash
52
+ pnpm install -D eslint @favorodera/eslint-config
53
+ ```
54
+ </details>
55
+
56
+ <details>
57
+ <summary><b>npm</b></summary>
58
+
59
+ ```bash
60
+ npm install -D eslint @favorodera/eslint-config
61
+ ```
62
+ </details>
63
+
64
+ <details>
65
+ <summary><b>yarn</b></summary>
66
+
67
+ ```bash
68
+ yarn add -D eslint @favorodera/eslint-config
69
+ ```
70
+ </details>
71
+
72
+ <details>
73
+ <summary><b>bun</b></summary>
74
+
75
+ ```bash
76
+ bun add -D eslint @favorodera/eslint-config
77
+ ```
78
+ </details>
79
+
80
+ ### Configure
81
+
82
+ Create an `eslint.config.mjs` (or `eslint.config.ts`) file in the root of your project. Since all configurations are enabled by default, you only need to pass options if you want to disable or customize something:
83
+
84
+ ```javascript
85
+ import { factory } from '@favorodera/eslint-config'
86
+
87
+ export default factory({
88
+ // All configs are true by default!
89
+
90
+ // Example: Customize specific rulesets
91
+ stylistic: {
92
+ settings: {
93
+ indent: 4,
94
+ quotes: 'double',
95
+ },
96
+ },
97
+
98
+ // Example: Disable tailwind if you aren't using it
99
+ tailwind: false,
100
+ })
101
+ ```
102
+
103
+ ## Development
104
+
105
+ ### Prerequisites
106
+
107
+ - [Node.js](https://nodejs.org/) v22 or later
108
+ - [pnpm](https://pnpm.io/installation) v11 or later
109
+
110
+ ### Getting Started
111
+
112
+ ```bash
113
+ # Install all dependencies
114
+ pnpm install
115
+
116
+ # Start compiler in watch mode and open ESLint config inspector
117
+ pnpm dev
118
+
119
+ # Build the project
120
+ pnpm build
121
+
122
+ # Lint, typecheck, build, and test in one go
123
+ pnpm ready
124
+ ```
125
+
126
+ ### Useful Commands
127
+
128
+ | Command | What it does |
129
+ |---------|-------------|
130
+ | `pnpm dev` | Generates types, starts watch mode, and opens `@eslint/config-inspector` |
131
+ | `pnpm build` | Production build using `tsdown` |
132
+ | `pnpm script:generate-rules-types` | Extracts and generates type definitions for all ESLint rules |
133
+ | `pnpm lint` | Lint the repository |
134
+ | `pnpm typecheck` | Type-check without emitting files |
135
+ | `pnpm test` | Run test suites with Vitest |
136
+ | `pnpm ready` | Full pipeline: install → build → lint → typecheck → test |
137
+
138
+ ## Contributing & Issues
139
+
140
+ Feel free to open an issue or submit a pull request if you'd like to improve the rules, add new features, or fix a bug. Please ensure you run `pnpm ready` before submitting your PR to make sure tests and linting pass.
141
+
142
+ ## Inspiration
143
+
144
+ This project takes heavy inspiration from [antfu/eslint-config](https://github.com/antfu/eslint-config) and similar modern ESLint presets, adapting their best patterns into a custom set of opinionated rules.
145
+
146
+ ## License
147
+
148
+ [MIT](./LICENSE) &copy; [Favour Emeka](https://github.com/favorodera)