eslint-plugin-code-style 1.0.6 → 1.0.7

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 (2) hide show
  1. package/index.d.ts +148 -0
  2. package/package.json +4 -1
package/index.d.ts ADDED
@@ -0,0 +1,148 @@
1
+ import type { Linter, Rule } from "eslint";
2
+
3
+ /**
4
+ * All available rule names in eslint-plugin-code-style
5
+ */
6
+ export type RuleNames =
7
+ | "code-style/absolute-imports-only"
8
+ | "code-style/array-items-per-line"
9
+ | "code-style/array-objects-on-new-lines"
10
+ | "code-style/arrow-function-block-body"
11
+ | "code-style/arrow-function-simple-jsx"
12
+ | "code-style/arrow-function-simplify"
13
+ | "code-style/assignment-value-same-line"
14
+ | "code-style/block-statement-newlines"
15
+ | "code-style/comment-spacing"
16
+ | "code-style/curried-arrow-same-line"
17
+ | "code-style/export-format"
18
+ | "code-style/function-call-spacing"
19
+ | "code-style/function-naming-convention"
20
+ | "code-style/function-params-per-line"
21
+ | "code-style/hook-callback-format"
22
+ | "code-style/hook-deps-per-line"
23
+ | "code-style/if-statement-format"
24
+ | "code-style/import-format"
25
+ | "code-style/import-source-spacing"
26
+ | "code-style/jsx-children-on-new-line"
27
+ | "code-style/jsx-closing-bracket-spacing"
28
+ | "code-style/jsx-element-child-new-line"
29
+ | "code-style/jsx-logical-expression-simplify"
30
+ | "code-style/jsx-parentheses-position"
31
+ | "code-style/jsx-prop-naming-convention"
32
+ | "code-style/jsx-simple-element-one-line"
33
+ | "code-style/jsx-string-value-trim"
34
+ | "code-style/jsx-ternary-format"
35
+ | "code-style/member-expression-bracket-spacing"
36
+ | "code-style/module-index-exports"
37
+ | "code-style/multiline-argument-newline"
38
+ | "code-style/multiline-if-conditions"
39
+ | "code-style/multiple-arguments-per-line"
40
+ | "code-style/nested-call-closing-brackets"
41
+ | "code-style/no-empty-lines-in-function-calls"
42
+ | "code-style/no-empty-lines-in-function-params"
43
+ | "code-style/no-empty-lines-in-jsx"
44
+ | "code-style/no-empty-lines-in-objects"
45
+ | "code-style/no-empty-lines-in-switch-cases"
46
+ | "code-style/object-property-per-line"
47
+ | "code-style/object-property-value-brace"
48
+ | "code-style/object-property-value-format"
49
+ | "code-style/opening-brackets-same-line"
50
+ | "code-style/simple-call-single-line"
51
+ | "code-style/single-argument-on-line"
52
+ | "code-style/string-property-spacing"
53
+ | "code-style/variable-naming-convention";
54
+
55
+ /**
56
+ * Rule severity levels
57
+ */
58
+ export type RuleSeverity = "off" | "warn" | "error" | 0 | 1 | 2;
59
+
60
+ /**
61
+ * Rule configuration: severity only or [severity, options]
62
+ */
63
+ export type RuleConfig = RuleSeverity | [RuleSeverity, ...unknown[]];
64
+
65
+ /**
66
+ * Rules configuration object for eslint-plugin-code-style
67
+ */
68
+ export type CodeStyleRulesConfig = {
69
+ [K in RuleNames]?: RuleConfig;
70
+ };
71
+
72
+ /**
73
+ * Plugin rules object containing all rule modules
74
+ */
75
+ interface PluginRules {
76
+ "absolute-imports-only": Rule.RuleModule;
77
+ "array-items-per-line": Rule.RuleModule;
78
+ "array-objects-on-new-lines": Rule.RuleModule;
79
+ "arrow-function-block-body": Rule.RuleModule;
80
+ "arrow-function-simple-jsx": Rule.RuleModule;
81
+ "arrow-function-simplify": Rule.RuleModule;
82
+ "assignment-value-same-line": Rule.RuleModule;
83
+ "block-statement-newlines": Rule.RuleModule;
84
+ "comment-spacing": Rule.RuleModule;
85
+ "curried-arrow-same-line": Rule.RuleModule;
86
+ "export-format": Rule.RuleModule;
87
+ "function-call-spacing": Rule.RuleModule;
88
+ "function-naming-convention": Rule.RuleModule;
89
+ "function-params-per-line": Rule.RuleModule;
90
+ "hook-callback-format": Rule.RuleModule;
91
+ "hook-deps-per-line": Rule.RuleModule;
92
+ "if-statement-format": Rule.RuleModule;
93
+ "import-format": Rule.RuleModule;
94
+ "import-source-spacing": Rule.RuleModule;
95
+ "jsx-children-on-new-line": Rule.RuleModule;
96
+ "jsx-closing-bracket-spacing": Rule.RuleModule;
97
+ "jsx-element-child-new-line": Rule.RuleModule;
98
+ "jsx-logical-expression-simplify": Rule.RuleModule;
99
+ "jsx-parentheses-position": Rule.RuleModule;
100
+ "jsx-prop-naming-convention": Rule.RuleModule;
101
+ "jsx-simple-element-one-line": Rule.RuleModule;
102
+ "jsx-string-value-trim": Rule.RuleModule;
103
+ "jsx-ternary-format": Rule.RuleModule;
104
+ "member-expression-bracket-spacing": Rule.RuleModule;
105
+ "module-index-exports": Rule.RuleModule;
106
+ "multiline-argument-newline": Rule.RuleModule;
107
+ "multiline-if-conditions": Rule.RuleModule;
108
+ "multiple-arguments-per-line": Rule.RuleModule;
109
+ "nested-call-closing-brackets": Rule.RuleModule;
110
+ "no-empty-lines-in-function-calls": Rule.RuleModule;
111
+ "no-empty-lines-in-function-params": Rule.RuleModule;
112
+ "no-empty-lines-in-jsx": Rule.RuleModule;
113
+ "no-empty-lines-in-objects": Rule.RuleModule;
114
+ "no-empty-lines-in-switch-cases": Rule.RuleModule;
115
+ "object-property-per-line": Rule.RuleModule;
116
+ "object-property-value-brace": Rule.RuleModule;
117
+ "object-property-value-format": Rule.RuleModule;
118
+ "opening-brackets-same-line": Rule.RuleModule;
119
+ "simple-call-single-line": Rule.RuleModule;
120
+ "single-argument-on-line": Rule.RuleModule;
121
+ "string-property-spacing": Rule.RuleModule;
122
+ "variable-naming-convention": Rule.RuleModule;
123
+ }
124
+
125
+ /**
126
+ * ESLint plugin for enforcing consistent code formatting and style rules
127
+ */
128
+ interface CodeStylePlugin {
129
+ meta: {
130
+ name: "eslint-plugin-code-style";
131
+ version: string;
132
+ };
133
+ rules: PluginRules;
134
+ }
135
+
136
+ declare const plugin: CodeStylePlugin;
137
+
138
+ export default plugin;
139
+
140
+ /**
141
+ * Module augmentation for ESLint's Linter.RulesRecord
142
+ * Enables type checking for rule configurations in eslint.config.js
143
+ */
144
+ declare module "eslint" {
145
+ namespace Linter {
146
+ interface RulesRecord extends CodeStyleRulesConfig {}
147
+ }
148
+ }
package/package.json CHANGED
@@ -1,17 +1,20 @@
1
1
  {
2
2
  "name": "eslint-plugin-code-style",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "A custom ESLint plugin for enforcing consistent code formatting and style rules in React/JSX projects",
5
5
  "main": "index.js",
6
+ "types": "index.d.ts",
6
7
  "type": "module",
7
8
  "exports": {
8
9
  ".": {
10
+ "types": "./index.d.ts",
9
11
  "import": "./index.js",
10
12
  "default": "./index.js"
11
13
  }
12
14
  },
13
15
  "files": [
14
16
  "index.js",
17
+ "index.d.ts",
15
18
  "README.md",
16
19
  "LICENSE"
17
20
  ],