@kristijorgji/eslint-plugin 0.1.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 (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +195 -0
  3. package/dist/configs/component-extraction.d.ts +24 -0
  4. package/dist/configs/component-extraction.d.ts.map +1 -0
  5. package/dist/configs/component-extraction.js +51 -0
  6. package/dist/configs/component-extraction.js.map +1 -0
  7. package/dist/configs/recommended.d.ts +12 -0
  8. package/dist/configs/recommended.d.ts.map +1 -0
  9. package/dist/configs/recommended.js +22 -0
  10. package/dist/configs/recommended.js.map +1 -0
  11. package/dist/configs/typed.d.ts +13 -0
  12. package/dist/configs/typed.d.ts.map +1 -0
  13. package/dist/configs/typed.js +25 -0
  14. package/dist/configs/typed.js.map +1 -0
  15. package/dist/index.d.ts +17 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +11 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/plugin.d.ts +4 -0
  20. package/dist/plugin.d.ts.map +1 -0
  21. package/dist/plugin.js +31 -0
  22. package/dist/plugin.js.map +1 -0
  23. package/dist/rules/jsx-leading-prop-order.d.ts +16 -0
  24. package/dist/rules/jsx-leading-prop-order.d.ts.map +1 -0
  25. package/dist/rules/jsx-leading-prop-order.js +143 -0
  26. package/dist/rules/jsx-leading-prop-order.js.map +1 -0
  27. package/dist/rules/no-barrel.d.ts +13 -0
  28. package/dist/rules/no-barrel.d.ts.map +1 -0
  29. package/dist/rules/no-barrel.js +45 -0
  30. package/dist/rules/no-barrel.js.map +1 -0
  31. package/dist/rules/no-multi-comp.d.ts +16 -0
  32. package/dist/rules/no-multi-comp.d.ts.map +1 -0
  33. package/dist/rules/no-multi-comp.js +81 -0
  34. package/dist/rules/no-multi-comp.js.map +1 -0
  35. package/dist/rules/no-pure-type-alias.d.ts +14 -0
  36. package/dist/rules/no-pure-type-alias.d.ts.map +1 -0
  37. package/dist/rules/no-pure-type-alias.js +52 -0
  38. package/dist/rules/no-pure-type-alias.js.map +1 -0
  39. package/dist/rules/no-single-export-barrel.d.ts +10 -0
  40. package/dist/rules/no-single-export-barrel.d.ts.map +1 -0
  41. package/dist/rules/no-single-export-barrel.js +89 -0
  42. package/dist/rules/no-single-export-barrel.js.map +1 -0
  43. package/dist/rules/no-weak-typeof-satisfies.d.ts +15 -0
  44. package/dist/rules/no-weak-typeof-satisfies.d.ts.map +1 -0
  45. package/dist/rules/no-weak-typeof-satisfies.js +93 -0
  46. package/dist/rules/no-weak-typeof-satisfies.js.map +1 -0
  47. package/dist/selectors/mock-body-satisfies.d.ts +7 -0
  48. package/dist/selectors/mock-body-satisfies.d.ts.map +1 -0
  49. package/dist/selectors/mock-body-satisfies.js +31 -0
  50. package/dist/selectors/mock-body-satisfies.js.map +1 -0
  51. package/dist/selectors/object-literal-typing.d.ts +7 -0
  52. package/dist/selectors/object-literal-typing.d.ts.map +1 -0
  53. package/dist/selectors/object-literal-typing.js +23 -0
  54. package/dist/selectors/object-literal-typing.js.map +1 -0
  55. package/dist/selectors/restricted-syntax.d.ts +20 -0
  56. package/dist/selectors/restricted-syntax.d.ts.map +1 -0
  57. package/dist/selectors/restricted-syntax.js +28 -0
  58. package/dist/selectors/restricted-syntax.js.map +1 -0
  59. package/dist/selectors/types.d.ts +5 -0
  60. package/dist/selectors/types.d.ts.map +1 -0
  61. package/dist/selectors/types.js +2 -0
  62. package/dist/selectors/types.js.map +1 -0
  63. package/dist/utils/create-rule.d.ts +9 -0
  64. package/dist/utils/create-rule.d.ts.map +1 -0
  65. package/dist/utils/create-rule.js +7 -0
  66. package/dist/utils/create-rule.js.map +1 -0
  67. package/package.json +53 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 kristijorgji
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,195 @@
1
+ # @kristijorgji/eslint-plugin
2
+
3
+ Custom ESLint rules for TypeScript and React projects, namespaced under `kj`.
4
+
5
+ Ships flat-config ready rule implementations, ready-made config factories, and a
6
+ small "selector" toolkit for composing your own `no-restricted-syntax` rules.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ npm install --save-dev @kristijorgji/eslint-plugin
12
+ # or
13
+ pnpm add -D @kristijorgji/eslint-plugin
14
+ ```
15
+
16
+ Peer dependencies: `eslint@^9 || ^10` and `typescript@^5 || ^6`.
17
+
18
+ ## Usage
19
+
20
+ ### Recommended rules
21
+
22
+ ```js
23
+ // eslint.config.js
24
+ import { recommended } from '@kristijorgji/eslint-plugin';
25
+
26
+ export default [
27
+ ...recommended(),
28
+ // ...your other config blocks
29
+ ];
30
+ ```
31
+
32
+ `recommended()` registers the `kj` plugin on `**/*.{ts,tsx}` and enables:
33
+
34
+ - `kj/no-pure-type-alias`
35
+ - `kj/no-single-export-barrel`
36
+ - `kj/jsx-leading-prop-order`
37
+
38
+ Pass `{ severity: 'warn' }` to downgrade all of them to warnings.
39
+
40
+ `kj/no-weak-typeof-satisfies` is **not** in `recommended()` — it needs type information. Use `typed()` for that.
41
+
42
+ ### Type-aware rules
43
+
44
+ `kj/no-weak-typeof-satisfies` benefits from full type information. Enable it with
45
+ `typed()`, pointing `tsconfigRootDir` at the directory containing your `tsconfig.json`:
46
+
47
+ ```js
48
+ import { typed } from '@kristijorgji/eslint-plugin';
49
+
50
+ export default [
51
+ ...typed({ tsconfigRootDir: import.meta.dirname }),
52
+ ];
53
+ ```
54
+
55
+ ### Component extraction
56
+
57
+ Encourage splitting large components and hooks into smaller modules:
58
+
59
+ ```js
60
+ import { componentExtraction } from '@kristijorgji/eslint-plugin';
61
+
62
+ export default [
63
+ ...componentExtraction({
64
+ severity: 'warn',
65
+ componentMaxLines: 70,
66
+ fileMaxLines: 300,
67
+ hookMaxLines: 120,
68
+ }),
69
+ ];
70
+ ```
71
+
72
+ This enables `kj/no-multi-comp` for `**/*.tsx` files, plus `max-lines-per-function`
73
+ and `max-lines` for components, and `max-lines-per-function` for hook files
74
+ (`**/use*.ts`, `**/hooks/**/*.ts`).
75
+
76
+ ### `no-barrel`
77
+
78
+ `kj/no-barrel` is opt-in and requires two options, since it targets a specific
79
+ workspace package:
80
+
81
+ ```js
82
+ import { plugin } from '@kristijorgji/eslint-plugin';
83
+
84
+ export default [
85
+ {
86
+ files: ['**/*.{ts,tsx}'],
87
+ ignores: ['**/packages/utils/**'],
88
+ plugins: { kj: plugin },
89
+ rules: {
90
+ 'kj/no-barrel': ['error', { packageName: '@repo/utils', exampleSubpath: '@repo/utils/media' }],
91
+ },
92
+ },
93
+ ];
94
+ ```
95
+
96
+ ### Restricted syntax selectors
97
+
98
+ `objectLiteralTypingSelectors` and `mockBodySatisfiesSelectors` are keyed records of
99
+ `no-restricted-syntax` entries (`{ selector, message }`). Compose them with
100
+ `restrictedSyntax()` / `restrictedSyntaxRuleEntry()`:
101
+
102
+ ```js
103
+ import {
104
+ mockBodySatisfiesSelectors,
105
+ objectLiteralTypingSelectors,
106
+ restrictedSyntaxRuleEntry,
107
+ } from '@kristijorgji/eslint-plugin';
108
+
109
+ export default [
110
+ {
111
+ files: ['**/*.{ts,tsx}'],
112
+ rules: {
113
+ 'no-restricted-syntax': restrictedSyntaxRuleEntry(
114
+ [objectLiteralTypingSelectors, mockBodySatisfiesSelectors],
115
+ {
116
+ exclude: ['jsxBinding'],
117
+ extra: [{ selector: 'DebuggerStatement', message: 'No debugger statements.' }],
118
+ },
119
+ ),
120
+ },
121
+ },
122
+ ];
123
+ ```
124
+
125
+ `restrictedSyntaxRuleEntry` returns a ready `['error' | 'warn', ...entries]` tuple;
126
+ use `restrictedSyntax()` directly if you want just the entry array.
127
+
128
+ ## Rules
129
+
130
+ | Rule | Description | Fixable |
131
+ | --- | --- | --- |
132
+ | `kj/no-multi-comp` | Disallow multiple React components in a single file. | No |
133
+ | `kj/no-pure-type-alias` | Discourage pure re-alias type declarations (`type A = B;`). | No |
134
+ | `kj/no-single-export-barrel` | Disallow `index.ts` barrels that only re-export a single symbol. | No |
135
+ | `kj/no-weak-typeof-satisfies` | Disallow `typeof expr` in `satisfies` when `expr` is `any`/`unknown` (enable via `typed()`). | No |
136
+ | `kj/jsx-leading-prop-order` | Require configured leading JSX attributes to appear in order. | Yes |
137
+ | `kj/no-barrel` | Disallow importing/exporting a configured package's barrel entry point. | No |
138
+
139
+ ### Options
140
+
141
+ - **`kj/no-multi-comp`**: `{ max?: number (default 1), ignoreStateless?: boolean (default false) }`.
142
+ When `ignoreStateless` is `true`, only `class` components count towards the limit.
143
+ - **`kj/no-pure-type-alias`**: `{ allowPatterns?: string[] }`. Regex pattern strings;
144
+ alias names matching any of them are allowed.
145
+ - **`kj/no-single-export-barrel`**: `{ exportNamePattern?: string (default '^[A-Z]') }`.
146
+ Only applies to files matching `index.ts`/`index.tsx`.
147
+ - **`kj/no-weak-typeof-satisfies`**: `{ allowUnknown?: boolean (default false) }`.
148
+ When `true`, only `any` is flagged (not `unknown`). Requires type information —
149
+ use with `typed()` or a type-aware parser configuration.
150
+ - **`kj/jsx-leading-prop-order`**: `{ order?: string[] }`, defaults to
151
+ `['data-testid', 'testID', 'key', 'ref', 'id', 'name']`. Never reorders attributes
152
+ across a `{...spread}`.
153
+ - **`kj/no-barrel`**: `{ packageName: string, exampleSubpath: string }` (both
154
+ **required**).
155
+
156
+ ## Migrating from ad-hoc project-local rules
157
+
158
+ If you previously vendored these rules locally, update rule IDs as follows:
159
+
160
+ | Old rule ID | New rule ID |
161
+ | --- | --- |
162
+ | `no-multi-comp/no-multi-comp` | `kj/no-multi-comp` |
163
+ | `type-alias/no-pure-alias` | `kj/no-pure-type-alias` |
164
+ | `no-single-export-barrel/no-single-export-barrel` | `kj/no-single-export-barrel` |
165
+ | `repo-typing/no-weak-typeof-satisfies` | `kj/no-weak-typeof-satisfies` |
166
+ | `jsx-leading-prop-order/jsx-leading-prop-order` | `kj/jsx-leading-prop-order` |
167
+ | `<pkg>/no-barrel` (e.g. `utils/no-barrel`) | `kj/no-barrel` (pass `packageName`/`exampleSubpath` in options) |
168
+
169
+ ## Overriding caveat
170
+
171
+ ESLint flat config merges array entries in order, and **later blocks win** when they
172
+ target overlapping files and rules. If you spread `recommended()` (or any other
173
+ config factory from this package) before your own overrides, put your overrides
174
+ *after* it in the exported array:
175
+
176
+ ```js
177
+ export default [
178
+ ...recommended(),
179
+ {
180
+ files: ['**/*.tsx'],
181
+ rules: {
182
+ // This wins over recommended()'s severity for the same rule/files.
183
+ 'kj/jsx-leading-prop-order': 'off',
184
+ },
185
+ },
186
+ ];
187
+ ```
188
+
189
+ Each config factory (`recommended`, `typed`, `componentExtraction`) returns a fresh
190
+ array on every call, so it's safe to call them multiple times with different options
191
+ in the same config file.
192
+
193
+ ## License
194
+
195
+ MIT
@@ -0,0 +1,24 @@
1
+ import type { Linter } from 'eslint';
2
+ export interface ComponentExtractionOptions {
3
+ severity?: 'warn' | 'error';
4
+ /** Max lines per component function/arrow. Defaults to 70. */
5
+ componentMaxLines?: number;
6
+ /** Max lines per component file. Defaults to 300. */
7
+ fileMaxLines?: number;
8
+ /** Max lines per hook function. Defaults to 120. */
9
+ hookMaxLines?: number;
10
+ /** Glob patterns matching component files. Defaults to `['**\/*.tsx']`. */
11
+ componentFiles?: string[];
12
+ /** Glob patterns matching hook files. Defaults to `['**\/use*.ts', '**\/hooks/**\/*.ts']`. */
13
+ hookFiles?: string[];
14
+ /** Glob patterns excluded from all component-extraction checks. */
15
+ ignores?: string[];
16
+ }
17
+ /**
18
+ * Encourages splitting large components/hooks into smaller modules: flags files with
19
+ * more than one component (`kj/no-multi-comp`), components/files/hooks that exceed
20
+ * configured line limits (`max-lines-per-function` / `max-lines`). Returns a fresh
21
+ * array on every call.
22
+ */
23
+ export declare function componentExtraction(options?: ComponentExtractionOptions): Linter.Config[];
24
+ //# sourceMappingURL=component-extraction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-extraction.d.ts","sourceRoot":"","sources":["../../src/configs/component-extraction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,8FAA8F;IAC9F,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AASD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,0BAA0B,GAAG,MAAM,CAAC,MAAM,EAAE,CAqCzF"}
@@ -0,0 +1,51 @@
1
+ import { plugin } from '../plugin.js';
2
+ const DEFAULT_COMPONENT_MAX_LINES = 70;
3
+ const DEFAULT_FILE_MAX_LINES = 300;
4
+ const DEFAULT_HOOK_MAX_LINES = 120;
5
+ const DEFAULT_COMPONENT_FILES = ['**/*.tsx'];
6
+ const DEFAULT_HOOK_FILES = ['**/use*.ts', '**/hooks/**/*.ts'];
7
+ const DEFAULT_IGNORES = ['**/*.test.tsx', '**/*.stories.tsx', '**/*.test.ts', '**/*.stories.ts'];
8
+ /**
9
+ * Encourages splitting large components/hooks into smaller modules: flags files with
10
+ * more than one component (`kj/no-multi-comp`), components/files/hooks that exceed
11
+ * configured line limits (`max-lines-per-function` / `max-lines`). Returns a fresh
12
+ * array on every call.
13
+ */
14
+ export function componentExtraction(options) {
15
+ const severity = options?.severity ?? 'warn';
16
+ const componentMaxLines = options?.componentMaxLines ?? DEFAULT_COMPONENT_MAX_LINES;
17
+ const fileMaxLines = options?.fileMaxLines ?? DEFAULT_FILE_MAX_LINES;
18
+ const hookMaxLines = options?.hookMaxLines ?? DEFAULT_HOOK_MAX_LINES;
19
+ const componentFiles = options?.componentFiles ?? DEFAULT_COMPONENT_FILES;
20
+ const hookFiles = options?.hookFiles ?? DEFAULT_HOOK_FILES;
21
+ const ignores = options?.ignores ?? DEFAULT_IGNORES;
22
+ return [
23
+ {
24
+ files: componentFiles,
25
+ ignores,
26
+ plugins: { kj: plugin },
27
+ rules: {
28
+ 'kj/no-multi-comp': severity,
29
+ },
30
+ },
31
+ {
32
+ files: componentFiles,
33
+ ignores,
34
+ rules: {
35
+ 'max-lines-per-function': [
36
+ severity,
37
+ { max: componentMaxLines, skipBlankLines: true, skipComments: true },
38
+ ],
39
+ 'max-lines': [severity, { max: fileMaxLines, skipBlankLines: true, skipComments: true }],
40
+ },
41
+ },
42
+ {
43
+ files: hookFiles,
44
+ ignores,
45
+ rules: {
46
+ 'max-lines-per-function': [severity, { max: hookMaxLines, skipBlankLines: true, skipComments: true }],
47
+ },
48
+ },
49
+ ];
50
+ }
51
+ //# sourceMappingURL=component-extraction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-extraction.js","sourceRoot":"","sources":["../../src/configs/component-extraction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAkBtC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AACvC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC,MAAM,uBAAuB,GAAG,CAAC,UAAU,CAAC,CAAC;AAC7C,MAAM,kBAAkB,GAAG,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;AAC9D,MAAM,eAAe,GAAG,CAAC,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAEjG;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAoC;IACtE,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,MAAM,CAAC;IAC7C,MAAM,iBAAiB,GAAG,OAAO,EAAE,iBAAiB,IAAI,2BAA2B,CAAC;IACpF,MAAM,YAAY,GAAG,OAAO,EAAE,YAAY,IAAI,sBAAsB,CAAC;IACrE,MAAM,YAAY,GAAG,OAAO,EAAE,YAAY,IAAI,sBAAsB,CAAC;IACrE,MAAM,cAAc,GAAG,OAAO,EAAE,cAAc,IAAI,uBAAuB,CAAC;IAC1E,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,kBAAkB,CAAC;IAC3D,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,eAAe,CAAC;IAEpD,OAAO;QACL;YACE,KAAK,EAAE,cAAc;YACrB,OAAO;YACP,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACvB,KAAK,EAAE;gBACL,kBAAkB,EAAE,QAAQ;aAC7B;SACF;QACD;YACE,KAAK,EAAE,cAAc;YACrB,OAAO;YACP,KAAK,EAAE;gBACL,wBAAwB,EAAE;oBACxB,QAAQ;oBACR,EAAE,GAAG,EAAE,iBAAiB,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE;iBACrE;gBACD,WAAW,EAAE,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;aACzF;SACF;QACD;YACE,KAAK,EAAE,SAAS;YAChB,OAAO;YACP,KAAK,EAAE;gBACL,wBAAwB,EAAE,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;aACtG;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Linter } from 'eslint';
2
+ export interface RecommendedOptions {
3
+ severity?: 'error' | 'warn';
4
+ }
5
+ /**
6
+ * Baseline recommended rules for TypeScript/TSX files.
7
+ * `kj/no-weak-typeof-satisfies` is type-aware — enable it via `typed()` instead.
8
+ * `no-multi-comp` and `no-barrel` are intentionally left out (see `componentExtraction()`
9
+ * and manual opt-in respectively). Returns a fresh array on every call.
10
+ */
11
+ export declare function recommended(options?: RecommendedOptions): Linter.Config[];
12
+ //# sourceMappingURL=recommended.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recommended.d.ts","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,CAczE"}
@@ -0,0 +1,22 @@
1
+ import { plugin } from '../plugin.js';
2
+ /**
3
+ * Baseline recommended rules for TypeScript/TSX files.
4
+ * `kj/no-weak-typeof-satisfies` is type-aware — enable it via `typed()` instead.
5
+ * `no-multi-comp` and `no-barrel` are intentionally left out (see `componentExtraction()`
6
+ * and manual opt-in respectively). Returns a fresh array on every call.
7
+ */
8
+ export function recommended(options) {
9
+ const severity = options?.severity ?? 'error';
10
+ return [
11
+ {
12
+ files: ['**/*.{ts,tsx}'],
13
+ plugins: { kj: plugin },
14
+ rules: {
15
+ 'kj/no-pure-type-alias': severity,
16
+ 'kj/no-single-export-barrel': severity,
17
+ 'kj/jsx-leading-prop-order': severity,
18
+ },
19
+ },
20
+ ];
21
+ }
22
+ //# sourceMappingURL=recommended.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recommended.js","sourceRoot":"","sources":["../../src/configs/recommended.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAMtC;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,OAA4B;IACtD,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,OAAO,CAAC;IAE9C,OAAO;QACL;YACE,KAAK,EAAE,CAAC,eAAe,CAAC;YACxB,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACvB,KAAK,EAAE;gBACL,uBAAuB,EAAE,QAAQ;gBACjC,4BAA4B,EAAE,QAAQ;gBACtC,2BAA2B,EAAE,QAAQ;aACtC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { Linter } from 'eslint';
2
+ export interface TypedOptions {
3
+ /** Root directory used to resolve the TypeScript project service. */
4
+ tsconfigRootDir: string;
5
+ severity?: 'error' | 'warn';
6
+ }
7
+ /**
8
+ * Type-aware rules that require parser services (a TypeScript program). Enables
9
+ * `kj/no-weak-typeof-satisfies` with `parserOptions.projectService` pointed at
10
+ * `tsconfigRootDir`. Returns a fresh array on every call.
11
+ */
12
+ export declare function typed(options: TypedOptions): Linter.Config[];
13
+ //# sourceMappingURL=typed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../src/configs/typed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,MAAM,WAAW,YAAY;IAC3B,qEAAqE;IACrE,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,CAkB5D"}
@@ -0,0 +1,25 @@
1
+ import { plugin } from '../plugin.js';
2
+ /**
3
+ * Type-aware rules that require parser services (a TypeScript program). Enables
4
+ * `kj/no-weak-typeof-satisfies` with `parserOptions.projectService` pointed at
5
+ * `tsconfigRootDir`. Returns a fresh array on every call.
6
+ */
7
+ export function typed(options) {
8
+ const severity = options.severity ?? 'error';
9
+ return [
10
+ {
11
+ files: ['**/*.{ts,tsx}'],
12
+ plugins: { kj: plugin },
13
+ languageOptions: {
14
+ parserOptions: {
15
+ projectService: true,
16
+ tsconfigRootDir: options.tsconfigRootDir,
17
+ },
18
+ },
19
+ rules: {
20
+ 'kj/no-weak-typeof-satisfies': severity,
21
+ },
22
+ },
23
+ ];
24
+ }
25
+ //# sourceMappingURL=typed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typed.js","sourceRoot":"","sources":["../../src/configs/typed.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAQtC;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,OAAqB;IACzC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC;IAE7C,OAAO;QACL;YACE,KAAK,EAAE,CAAC,eAAe,CAAC;YACxB,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACvB,eAAe,EAAE;gBACf,aAAa,EAAE;oBACb,cAAc,EAAE,IAAI;oBACpB,eAAe,EAAE,OAAO,CAAC,eAAe;iBACzC;aACF;YACD,KAAK,EAAE;gBACL,6BAA6B,EAAE,QAAQ;aACxC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { plugin } from './plugin.js';
2
+ export default plugin;
3
+ export { plugin };
4
+ export * from './configs/recommended.js';
5
+ export * from './configs/typed.js';
6
+ export * from './configs/component-extraction.js';
7
+ export * from './selectors/object-literal-typing.js';
8
+ export * from './selectors/mock-body-satisfies.js';
9
+ export * from './selectors/restricted-syntax.js';
10
+ export * from './selectors/types.js';
11
+ export type { NoMultiCompOptions } from './rules/no-multi-comp.js';
12
+ export type { NoPureTypeAliasOptions } from './rules/no-pure-type-alias.js';
13
+ export type { NoSingleExportBarrelOptions } from './rules/no-single-export-barrel.js';
14
+ export type { NoWeakTypeofSatisfiesOptions } from './rules/no-weak-typeof-satisfies.js';
15
+ export type { JsxLeadingPropOrderOptions } from './rules/jsx-leading-prop-order.js';
16
+ export type { NoBarrelOptions } from './rules/no-barrel.js';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC;AAElD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,sBAAsB,CAAC;AAErC,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,YAAY,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACtF,YAAY,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACxF,YAAY,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AACpF,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ import { plugin } from './plugin.js';
2
+ export default plugin;
3
+ export { plugin };
4
+ export * from './configs/recommended.js';
5
+ export * from './configs/typed.js';
6
+ export * from './configs/component-extraction.js';
7
+ export * from './selectors/object-literal-typing.js';
8
+ export * from './selectors/mock-body-satisfies.js';
9
+ export * from './selectors/restricted-syntax.js';
10
+ export * from './selectors/types.js';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC;AAElD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ESLint } from 'eslint';
2
+ export declare const plugin: ESLint.Plugin;
3
+ export default plugin;
4
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAuBrC,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAS3B,CAAC;AAEF,eAAe,MAAM,CAAC"}
package/dist/plugin.js ADDED
@@ -0,0 +1,31 @@
1
+ import { jsxLeadingPropOrder } from './rules/jsx-leading-prop-order.js';
2
+ import { noBarrel } from './rules/no-barrel.js';
3
+ import { noMultiComp } from './rules/no-multi-comp.js';
4
+ import { noPureTypeAlias } from './rules/no-pure-type-alias.js';
5
+ import { noSingleExportBarrel } from './rules/no-single-export-barrel.js';
6
+ import { noWeakTypeofSatisfies } from './rules/no-weak-typeof-satisfies.js';
7
+ /**
8
+ * The `kj` plugin object. Kept in its own module (separate from `index.ts` and the
9
+ * config factories) so config factories can import it without creating a circular
10
+ * dependency with the package's public entry point.
11
+ */
12
+ const rules = {
13
+ 'no-multi-comp': noMultiComp,
14
+ 'no-pure-type-alias': noPureTypeAlias,
15
+ 'no-single-export-barrel': noSingleExportBarrel,
16
+ 'no-weak-typeof-satisfies': noWeakTypeofSatisfies,
17
+ 'jsx-leading-prop-order': jsxLeadingPropOrder,
18
+ 'no-barrel': noBarrel,
19
+ };
20
+ export const plugin = {
21
+ meta: {
22
+ name: '@kristijorgji/eslint-plugin',
23
+ version: '0.1.0',
24
+ },
25
+ // `@typescript-eslint/utils` rule modules are structurally richer than `eslint`'s
26
+ // `Rule.RuleModule` (typed context, typed options) but are runtime-compatible;
27
+ // ESLint only consumes the shared `meta`/`create` shape at plugin-load time.
28
+ rules: rules,
29
+ };
30
+ export default plugin;
31
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E;;;;GAIG;AACH,MAAM,KAAK,GAAG;IACZ,eAAe,EAAE,WAAW;IAC5B,oBAAoB,EAAE,eAAe;IACrC,yBAAyB,EAAE,oBAAoB;IAC/C,0BAA0B,EAAE,qBAAqB;IACjD,wBAAwB,EAAE,mBAAmB;IAC7C,WAAW,EAAE,QAAQ;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAkB;IACnC,IAAI,EAAE;QACJ,IAAI,EAAE,6BAA6B;QACnC,OAAO,EAAE,OAAO;KACjB;IACD,kFAAkF;IAClF,+EAA+E;IAC/E,6EAA6E;IAC7E,KAAK,EAAE,KAA0C;CAClD,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { TSESLint } from '@typescript-eslint/utils';
2
+ export interface JsxLeadingPropOrderOptions {
3
+ order?: string[];
4
+ }
5
+ type Options = [JsxLeadingPropOrderOptions];
6
+ export declare const DEFAULT_ORDER: string[];
7
+ /**
8
+ * Enforce a configurable leading order for specific JSX attributes.
9
+ * Other props stay unordered relative to each other (stable sort by rank).
10
+ * Never moves attributes across JSXSpreadAttribute boundaries.
11
+ */
12
+ export declare const jsxLeadingPropOrder: TSESLint.RuleModule<"outOfOrder", Options, unknown, TSESLint.RuleListener> & {
13
+ name: string;
14
+ };
15
+ export {};
16
+ //# sourceMappingURL=jsx-leading-prop-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-leading-prop-order.d.ts","sourceRoot":"","sources":["../../src/rules/jsx-leading-prop-order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAI9E,MAAM,WAAW,0BAA0B;IACzC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,KAAK,OAAO,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAG5C,eAAO,MAAM,aAAa,UAAwD,CAAC;AAgDnF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;CAsG9B,CAAC"}
@@ -0,0 +1,143 @@
1
+ import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
2
+ import { createRule } from '../utils/create-rule.js';
3
+ export const DEFAULT_ORDER = ['data-testid', 'testID', 'key', 'ref', 'id', 'name'];
4
+ function attrName(node) {
5
+ if (node.type !== AST_NODE_TYPES.JSXAttribute) {
6
+ return null;
7
+ }
8
+ const name = node.name;
9
+ if (name.type === AST_NODE_TYPES.JSXIdentifier) {
10
+ return name.name;
11
+ }
12
+ if (name.type === AST_NODE_TYPES.JSXNamespacedName) {
13
+ return `${name.namespace.name}:${name.name.name}`;
14
+ }
15
+ return null;
16
+ }
17
+ function stableSortByRank(segment, getRank) {
18
+ return segment
19
+ .map((attr, index) => ({ attr, index, rank: getRank(attr) }))
20
+ .sort((a, b) => a.rank - b.rank || a.index - b.index)
21
+ .map(({ attr }) => attr);
22
+ }
23
+ /** Split JSX attributes into segments separated by spreads. */
24
+ function attributeSegments(attrs) {
25
+ const segments = [];
26
+ let current = [];
27
+ for (const attr of attrs) {
28
+ if (attr.type === AST_NODE_TYPES.JSXSpreadAttribute) {
29
+ if (current.length > 0) {
30
+ segments.push(current);
31
+ current = [];
32
+ }
33
+ continue;
34
+ }
35
+ current.push(attr);
36
+ }
37
+ if (current.length > 0) {
38
+ segments.push(current);
39
+ }
40
+ return segments;
41
+ }
42
+ /**
43
+ * Enforce a configurable leading order for specific JSX attributes.
44
+ * Other props stay unordered relative to each other (stable sort by rank).
45
+ * Never moves attributes across JSXSpreadAttribute boundaries.
46
+ */
47
+ export const jsxLeadingPropOrder = createRule({
48
+ name: 'jsx-leading-prop-order',
49
+ meta: {
50
+ type: 'layout',
51
+ docs: {
52
+ description: 'Require configured leading JSX attributes to appear in order; never reorder across spreads',
53
+ },
54
+ fixable: 'code',
55
+ schema: [
56
+ {
57
+ type: 'object',
58
+ properties: {
59
+ order: {
60
+ type: 'array',
61
+ items: { type: 'string' },
62
+ minItems: 1,
63
+ },
64
+ },
65
+ additionalProperties: false,
66
+ },
67
+ ],
68
+ messages: {
69
+ outOfOrder: 'JSX attributes must follow leading prop order ({{order}}).',
70
+ },
71
+ },
72
+ defaultOptions: [{ order: DEFAULT_ORDER }],
73
+ create(context, [options]) {
74
+ const order = options.order ?? DEFAULT_ORDER;
75
+ const rankByName = new Map(order.map((name, index) => [name, index]));
76
+ const sourceCode = context.sourceCode;
77
+ function getRank(attr) {
78
+ const name = attrName(attr);
79
+ if (name === null || !rankByName.has(name)) {
80
+ return Number.POSITIVE_INFINITY;
81
+ }
82
+ return rankByName.get(name);
83
+ }
84
+ function fixSegment(segment, sorted) {
85
+ return (fixer) => {
86
+ const separators = [];
87
+ for (let i = 0; i < segment.length - 1; i++) {
88
+ const left = segment[i];
89
+ const right = segment[i + 1];
90
+ if (!left || !right)
91
+ continue;
92
+ separators.push(sourceCode.text.slice(left.range[1], right.range[0]));
93
+ }
94
+ const firstSorted = sorted[0];
95
+ if (!firstSorted) {
96
+ return null;
97
+ }
98
+ const parts = [sourceCode.getText(firstSorted)];
99
+ for (let i = 0; i < separators.length; i++) {
100
+ const next = sorted[i + 1];
101
+ if (!next)
102
+ continue;
103
+ parts.push(separators[i] ?? '', sourceCode.getText(next));
104
+ }
105
+ const first = segment[0];
106
+ const last = segment[segment.length - 1];
107
+ if (!first || !last) {
108
+ return null;
109
+ }
110
+ return fixer.replaceTextRange([first.range[0], last.range[1]], parts.join(''));
111
+ };
112
+ }
113
+ return {
114
+ JSXOpeningElement(node) {
115
+ const attrs = node.attributes;
116
+ if (attrs.length < 2) {
117
+ return;
118
+ }
119
+ for (const segment of attributeSegments(attrs)) {
120
+ if (segment.length < 2) {
121
+ continue;
122
+ }
123
+ const sorted = stableSortByRank(segment, getRank);
124
+ const firstMismatch = segment.findIndex((attr, i) => attr !== sorted[i]);
125
+ if (firstMismatch === -1) {
126
+ continue;
127
+ }
128
+ const reportNode = segment[firstMismatch];
129
+ if (!reportNode) {
130
+ continue;
131
+ }
132
+ context.report({
133
+ node: reportNode,
134
+ messageId: 'outOfOrder',
135
+ data: { order: order.join(', ') },
136
+ fix: fixSegment(segment, sorted),
137
+ });
138
+ }
139
+ },
140
+ };
141
+ },
142
+ });
143
+ //# sourceMappingURL=jsx-leading-prop-order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-leading-prop-order.js","sourceRoot":"","sources":["../../src/rules/jsx-leading-prop-order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AASrD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAInF,SAAS,QAAQ,CAAC,IAAa;IAC7B,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,YAAY,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACvB,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,aAAa,EAAE,CAAC;QAC/C,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,iBAAiB,EAAE,CAAC;QACnD,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACpD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,gBAAgB,CAAI,OAAY,EAAE,OAA4B;IACrE,OAAO,OAAO;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,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