eslint-plugin-code-style 1.1.2 → 1.2.0

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.
Files changed (5) hide show
  1. package/AGENTS.md +27 -29
  2. package/README.md +1427 -820
  3. package/index.d.ts +16 -0
  4. package/index.js +4720 -294
  5. package/package.json +1 -1
package/AGENTS.md CHANGED
@@ -4,20 +4,21 @@ Instructions for AI coding agents working with this codebase.
4
4
 
5
5
  ## Project Overview
6
6
 
7
- **eslint-plugin-code-style** is an ESLint plugin providing 47 custom auto-fixable formatting rules for React/JSX projects. It's designed for ESLint v9+ flat config system.
7
+ **eslint-plugin-code-style** is an ESLint plugin providing 56 custom auto-fixable formatting rules for React/JSX projects. It's designed for ESLint v9+ flat config system.
8
8
 
9
- - **Main entry:** `index.js` - Contains all 47 rules in a single file
9
+ - **Main entry:** `index.js` - Contains all 56 rules in a single file
10
10
  - **Type definitions:** `index.d.ts` - TypeScript declarations for IDE support
11
11
  - **Recommended configs:** `recommended-configs/` - Ready-to-use ESLint configurations
12
12
  - **Test apps:** `_tests_/` - Sample apps for testing rules
13
13
 
14
14
  ### Available Configurations
15
15
 
16
- | Config | Folder | Status |
17
- |--------|--------|--------|
18
- | React (JS) | `react/` | Available |
19
- | React + TypeScript | `react-ts/` | Coming Soon |
20
- | React + TS + Tailwind | `react-ts-tw/` | Coming Soon |
16
+ | Config | Recommended Folder | Test Folder | Status |
17
+ |--------|-------------------|-------------|--------|
18
+ | React (JS) | `recommended-configs/react/` | `_tests_/react/` | Available |
19
+ | React + TS + Tailwind | `recommended-configs/react-ts-tw/` | `_tests_/react-ts-tw/` | Available |
20
+ | React + TypeScript | - | - | Coming Soon |
21
+ | React + Tailwind | - | - | Coming Soon |
21
22
 
22
23
  ## Build & Test Commands
23
24
 
@@ -43,7 +44,7 @@ index.js
43
44
  ├── imports (fs, path, url)
44
45
  ├── Rule 1 definition (const ruleName = { create(), meta: {} })
45
46
  ├── Rule 2 definition
46
- ├── ... (47 rules total)
47
+ ├── ... (56 rules total)
47
48
  └── export default { meta: {}, rules: {} }
48
49
  ```
49
50
 
@@ -197,26 +198,23 @@ if (node.parent?.type === "CallExpression") return;
197
198
 
198
199
  ## Rule Categories
199
200
 
200
- Rules are organized in these categories (see default export):
201
-
202
- - **Array rules:** `array-*`
203
- - **Arrow function rules:** `arrow-function-*`, `curried-arrow-*`
204
- - **Assignment rules:** `assignment-*`
205
- - **Block statement rules:** `block-statement-*`
206
- - **Comment rules:** `comment-*`
207
- - **Function rules:** `function-*`
208
- - **Hook rules:** `hook-*`
209
- - **If statement rules:** `if-statement-*`, `multiline-if-*`
210
- - **Import/Export rules:** `absolute-imports-*`, `export-*`, `import-*`, `index-export-*`, `module-index-*`
211
- - **JSX rules:** `jsx-*`
212
- - **Member expression rules:** `member-expression-*`
213
- - **Nested call rules:** `nested-call-*`
214
- - **No empty lines rules:** `no-empty-lines-*`
215
- - **Object property rules:** `object-property-*`
216
- - **Opening brackets rules:** `opening-brackets-*`
217
- - **Simple call rules:** `simple-call-*`, `single-argument-*`
218
- - **String property rules:** `string-property-*`
219
- - **Variable rules:** `variable-*`
201
+ Rules are organized in these categories (alphabetically sorted in index.js and README.md):
202
+
203
+ - **Array Rules:** `array-items-per-line`, `array-objects-on-new-lines`
204
+ - **Arrow Function Rules:** `arrow-function-block-body`, `arrow-function-simple-jsx`, `arrow-function-simplify`, `curried-arrow-same-line`
205
+ - **Call Expression Rules:** `function-arguments-format`, `nested-call-closing-brackets`, `no-empty-lines-in-function-calls`, `opening-brackets-same-line`, `simple-call-single-line`, `single-argument-on-one-line`
206
+ - **Comment Rules:** `comment-format`
207
+ - **Component Rules:** `component-props-destructure`, `component-props-inline-type`
208
+ - **Control Flow Rules:** `block-statement-newlines`, `if-statement-format`, `multiline-if-conditions`, `no-empty-lines-in-switch-cases`
209
+ - **Function Rules:** `function-call-spacing`, `function-naming-convention`, `function-object-destructure`, `function-params-per-line`, `no-empty-lines-in-function-params`
210
+ - **Hook Rules:** `hook-callback-format`, `hook-deps-per-line`
211
+ - **Import/Export Rules:** `absolute-imports-only`, `export-format`, `import-format`, `import-source-spacing`, `index-export-style`, `module-index-exports`
212
+ - **JSX Rules:** `jsx-children-on-new-line`, `jsx-closing-bracket-spacing`, `jsx-element-child-new-line`, `jsx-logical-expression-simplify`, `jsx-parentheses-position`, `jsx-prop-naming-convention`, `jsx-simple-element-one-line`, `jsx-string-value-trim`, `jsx-ternary-format`, `no-empty-lines-in-jsx`
213
+ - **Object Rules:** `no-empty-lines-in-objects`, `object-property-per-line`, `object-property-value-brace`, `object-property-value-format`, `string-property-spacing`
214
+ - **React Rules:** `react-code-order`
215
+ - **Spacing Rules:** `assignment-value-same-line`, `member-expression-bracket-spacing`
216
+ - **TypeScript Rules:** `enum-format`, `interface-format`, `type-annotation-spacing`, `type-format`, `typescript-definition-location`
217
+ - **Variable Rules:** `variable-naming-convention`
220
218
 
221
219
  ## Naming Conventions
222
220
 
@@ -232,7 +230,7 @@ Rules are organized in these categories (see default export):
232
230
 
233
231
  ## Documentation Files
234
232
 
235
- - `README.md` - Main documentation with all 47 rules
233
+ - `README.md` - Main documentation with all 56 rules
236
234
  - `recommended-configs/<config-name>/README.md` - Config-specific documentation (references main README for rule details)
237
235
  - `index.d.ts` - TypeScript types for IDE autocomplete
238
236