@favorodera/eslint-config 0.0.2 → 0.0.4

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,144 @@
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
+
40
+ ## Usage
41
+
42
+ ### Install
43
+
44
+ <details>
45
+ <summary><b>pnpm</b></summary>
46
+
47
+ ```bash
48
+ pnpm install -D eslint @favorodera/eslint-config
49
+ ```
50
+ </details>
51
+
52
+ <details>
53
+ <summary><b>npm</b></summary>
54
+
55
+ ```bash
56
+ npm install -D eslint @favorodera/eslint-config
57
+ ```
58
+ </details>
59
+
60
+ <details>
61
+ <summary><b>yarn</b></summary>
62
+
63
+ ```bash
64
+ yarn add -D eslint @favorodera/eslint-config
65
+ ```
66
+ </details>
67
+
68
+ <details>
69
+ <summary><b>bun</b></summary>
70
+
71
+ ```bash
72
+ bun add -D eslint @favorodera/eslint-config
73
+ ```
74
+ </details>
75
+
76
+ ### Configure
77
+
78
+ 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:
79
+
80
+ ```javascript
81
+ import { factory } from '@favorodera/eslint-config'
82
+
83
+ export default factory({
84
+ // All configs are true by default!
85
+
86
+ // Example: Disable tailwind if you aren't using it
87
+ tailwind: false,
88
+
89
+ // Example: Customize specific rulesets
90
+ stylistic: {
91
+ settings: {
92
+ quotes: 'double',
93
+ indent: 4
94
+ }
95
+ }
96
+ })
97
+ ```
98
+
99
+ ## Development
100
+
101
+ ### Prerequisites
102
+
103
+ - [Node.js](https://nodejs.org/) v22 or later
104
+ - [pnpm](https://pnpm.io/installation) v11 or later
105
+
106
+ ### Getting Started
107
+
108
+ ```bash
109
+ # Install all dependencies
110
+ pnpm install
111
+
112
+ # Start compiler in watch mode and open ESLint config inspector
113
+ pnpm dev
114
+
115
+ # Build the project
116
+ pnpm build
117
+
118
+ # Lint, typecheck, build, and test in one go
119
+ pnpm ready
120
+ ```
121
+
122
+ ### Useful Commands
123
+
124
+ | Command | What it does |
125
+ |---------|-------------|
126
+ | `pnpm dev` | Generates types, starts watch mode, and opens `@eslint/config-inspector` |
127
+ | `pnpm build` | Production build using `tsdown` |
128
+ | `pnpm script:generate-rules-types` | Extracts and generates type definitions for all ESLint rules |
129
+ | `pnpm lint` | Lint the repository |
130
+ | `pnpm typecheck` | Type-check without emitting files |
131
+ | `pnpm test` | Run test suites with Vitest |
132
+ | `pnpm ready` | Full pipeline: install → build → lint → typecheck → test |
133
+
134
+ ## Contributing & Issues
135
+
136
+ 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.
137
+
138
+ ## Inspiration
139
+
140
+ 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.
141
+
142
+ ## License
143
+
144
+ [MIT](./LICENSE) &copy; [Favour Emeka](https://github.com/favorodera)