eslint-plugin-spellbookx 0.7.1 → 0.7.3

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.
@@ -1,12 +1,8 @@
1
1
 
2
- > eslint-plugin-spellbookx@0.7.1 build /home/runner/work/spellbookx/spellbookx/packages/eslint-plugin-spellbookx
3
- > rolldown -c
2
+ > eslint-plugin-spellbookx@0.7.3 build /home/runner/work/spellbookx/spellbookx/packages/eslint-plugin-spellbookx
3
+ > rolldown -c && tsc
4
4
 
5
5
  [log] <DIR>/types.js chunk │ size: 0.32 kB
6
6
  [log] <DIR>/index.js chunk │ size: 10.88 kB
7
7
  [log]
8
- [success] rolldown v1.0.0-rc.1 Finished in 13.53 ms
9
-
10
- > eslint-plugin-spellbookx@0.7.1 postbuild /home/runner/work/spellbookx/spellbookx/packages/eslint-plugin-spellbookx
11
- > tsc
12
-
8
+ [success] rolldown v1.0.0-rc.1 Finished in 36.10 ms
package/README.md CHANGED
@@ -1,145 +1,92 @@
1
1
  # eslint-plugin-spellbookx
2
2
 
3
- This plugin offers a unified, modern ESLint Flat Config setup to reduce configuration overhead while enforcing best practices, clean code, and maintainable project structures for modern JavaScript, TypeScript, and React projects.
3
+ An ESLint plugin containing shared configurations for the Spellbookx project. This package bundles and pre-configures a variety of essential ESLint plugins for a consistent and high-quality codebase.
4
4
 
5
- ---
5
+ ## Description
6
6
 
7
- ## Table of Contents
7
+ This ESLint plugin provides a set of shareable configurations that are fine-tuned for modern JavaScript/TypeScript development. It includes rules for:
8
8
 
9
- - [Installation](#installation)
10
- - [Available Configurations](#available-configurations)
11
- - [Usage Examples](#usage-examples)
12
- - [Rules Explanation](#rules-explanation)
13
- - [License](#license)
9
+ - **JavaScript**: Best practices, error prevention, and code style.
10
+ - **TypeScript**: Static typing, and modern language features.
11
+ - **JSON**: Linting for JSON files.
12
+ - **Markdown**: Linting for Markdown files.
13
+ - **Imports**: Sorting and organizing imports.
14
+ - **JSDoc**: Enforcing JSDoc comments.
15
+ - **Prettier**: Integrating Prettier for code formatting.
16
+ - **CSpell**: Spell-checking within your code.
14
17
 
15
- ---
18
+ ## Why use this?
19
+
20
+ This plugin saves you the hassle of manually installing and configuring multiple ESLint plugins. By providing a centralized and opinionated configuration, it helps to:
21
+
22
+ - Enforce a consistent code style across the entire monorepo.
23
+ - Catch potential errors and bugs early in the development process.
24
+ - Improve code readability and maintainability.
16
25
 
17
26
  ## Installation
18
27
 
19
- ```bash
20
- npm install -g eslint
21
- npm install -D eslint eslint-plugin-spellbookx
22
- ```
28
+ Install the package and its peer dependencies using your favorite package manager:
23
29
 
24
- or
30
+ **npm**
25
31
 
26
32
  ```bash
27
- pnpm add -g eslint
28
- pnpm add -D eslint eslint-plugin-spellbookx
33
+ npm install --save-dev eslint-plugin-spellbookx eslint
29
34
  ```
30
35
 
31
- or
36
+ **pnpm**
32
37
 
33
38
  ```bash
34
- yarn global add eslint
35
- yarn add -D eslint eslint-plugin-spellbookx
39
+ pnpm add -D eslint-plugin-spellbookx eslint
36
40
  ```
37
41
 
38
- or
42
+ **yarn**
39
43
 
40
44
  ```bash
41
- bun add -g eslint
42
- bun add -D eslint eslint-plugin-spellbookx
45
+ yarn add -D eslint-plugin-spellbookx eslint
43
46
  ```
44
47
 
45
- Then use Flat Config by importing the desired configurations:
48
+ **bun**
46
49
 
47
- ```js
48
- // eslint.config.js
49
- import spellbookx from 'eslint-plugin-spellbookx';
50
-
51
- export default [...spellbookx.configs.recommended];
50
+ ```bash
51
+ bun add -d eslint-plugin-spellbookx eslint
52
52
  ```
53
53
 
54
- ---
54
+ ## Usage
55
55
 
56
- ## Available Configurations
56
+ To use this plugin, create an `eslint.config.mjs` file in your project's root and extend the desired configurations.
57
57
 
58
- | Config Name | Description |
59
- | ------------- | --------------------------------------------------------------------------------------------------------------- |
60
- | `ignores` | Global ignore patterns for node modules, build artifacts, caches, and IDE/project files. |
61
- | `javascript` | Base rules for JS/TS files with Unicorn, Prettier, JSDoc, and TypeScript-specific adjustments. |
62
- | `react` | Adds React/JSX/TSX rules and React Hooks best practices. |
63
- | `json` | Enforces JSON, JSON5, JSONC, and `package.json` best practices including property ordering and required fields. |
64
- | `markdown` | Lints Markdown files and code blocks within them. |
65
- | `cspell` | Integrates with Code Spell Checker for detecting typos in code and text. |
66
- | `prettier` | Ensures Prettier formatting rules are applied consistently. |
67
- | `recommended` | Combines ignores, JS/TS, JSON, Markdown, Prettier, and cspell for a full setup. |
58
+ ### Recommended Configuration
68
59
 
69
- ---
60
+ The `recommended` configuration includes all the essential rules for a typical JavaScript/TypeScript project.
70
61
 
71
- ## Usage Examples
72
-
73
- ### JavaScript / TypeScript
74
-
75
- ```js
76
- // eslint.config.js
62
+ ```javascript
77
63
  import spellbookx from 'eslint-plugin-spellbookx';
78
64
 
79
- export default [...spellbookx.configs.recommended];
65
+ export default [
66
+ ...spellbookx.configs.recommended,
67
+ // Add your custom rules here
68
+ ];
80
69
  ```
81
70
 
82
- ### JSON / Package Files
71
+ ### Advanced Configuration
83
72
 
84
- ```js
85
- import spellbookx from 'eslint-plugin-spellbookx';
73
+ You can also create a more tailored configuration by picking and choosing the configs you need:
86
74
 
87
- export default [...spellbookx.configs.json];
88
- ```
89
-
90
- ### Markdown with Embedded Code
91
-
92
- ```js
75
+ ```javascript
93
76
  import spellbookx from 'eslint-plugin-spellbookx';
94
77
 
95
- export default [...spellbookx.configs.markdown];
78
+ export default [
79
+ ...spellbookx.configs.ignores,
80
+ ...spellbookx.configs.javascript,
81
+ ...spellbookx.configs.typescript,
82
+ ...spellbookx.configs.json,
83
+ ...spellbookx.configs.markdown,
84
+ ...spellbookx.configs.vuoto,
85
+ ...spellbookx.configs.cspell,
86
+ // any other configuration
87
+ ];
96
88
  ```
97
89
 
98
- ---
99
-
100
- ## Rules Explanation
101
-
102
- ### TypeScript-Specific
103
-
104
- - **`@typescript-eslint/no-unused-vars`**: Replaces ESLint's default `no-unused-vars` to understand TypeScript constructs like interfaces, enums, and types. Variables prefixed with `_` are ignored.
105
- - **`@typescript-eslint/quotes` & `@typescript-eslint/semi`**: Disabled to defer to Prettier for formatting consistency.
106
-
107
- ### Unicorn Rules
108
-
109
- - Enforces consistent filename casing (`kebab-case`).
110
- - Prefers modern safe methods (`Buffer.from`, `Array.includes`, `String.replaceAll`, `TypeError`).
111
- - Prevents unsafe patterns like `instanceof Array` or manual `new Error()` without a proper type.
112
- - `no-null` and `prevent-abbreviations` are disabled to allow flexibility.
113
- - Explicit length checks are warned, not enforced.
114
-
115
- ### JSDoc
116
-
117
- - Encourages documentation for functions, classes, and methods.
118
- - Enforces descriptions for all significant code structures.
119
-
120
- ### Prettier
121
-
122
- - Ensures consistent formatting across JS/TS, JSON, Markdown, and React code.
123
-
124
- ### Import Sorting
125
-
126
- Uses `eslint-plugin-simple-import-sort` for structured, deterministic import ordering:
127
-
128
- 1. Environment variables (`dotenv`, `@dotenvx/dotenvx`)
129
- 2. Side-effect imports
130
- 3. Node built-ins
131
- 4. React core and ecosystem
132
- 5. Backend frameworks and middlewares
133
- 6. State management, data-fetching, GraphQL clients
134
- 7. Generic third-party libraries
135
- 8. UI libraries and icon packs
136
- 9. Relative imports
137
- 10. Styles, assets, and media
138
-
139
- This promotes readability, predictable structure, and clear separation between layers of the project.
140
-
141
- ---
142
-
143
90
  ## License
144
91
 
145
92
  This project is licensed under the MIT License.
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "eslint-plugin-spellbookx",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "private": false,
5
- "description": "Shared ESLint plugin and configs tuned for the Spellbookx monorepo and common JS/TS frameworks.",
5
+ "description": "A comprehensive ESLint plugin with shareable configs for JS/TS, React, JSON, and more.",
6
6
  "keywords": [
7
7
  "eslint",
8
+ "eslint-config",
8
9
  "eslint-plugin",
9
10
  "lint",
11
+ "prettier",
10
12
  "spellbookx",
11
- "eslint-config"
13
+ "typescript"
12
14
  ],
13
15
  "homepage": "https://github.com/spellbookx/spellbookx#readme",
14
16
  "bugs": {
@@ -63,7 +65,7 @@
63
65
  "eslint": "^9.39.2",
64
66
  "rolldown": "1.0.0-rc.1",
65
67
  "typescript": "5.9.2",
66
- "@spellbookx/typescript-config": "0.7.1"
68
+ "@spellbookx/typescript-config": "0.7.3"
67
69
  },
68
70
  "peerDependencies": {
69
71
  "eslint": "^9.39.2"
@@ -72,7 +74,6 @@
72
74
  "access": "public"
73
75
  },
74
76
  "scripts": {
75
- "build": "rolldown -c",
76
- "postbuild": "tsc"
77
+ "build": "rolldown -c && tsc"
77
78
  }
78
79
  }