@app-compose/eslint-plugin 3.0.0-beta.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.
- package/LICENSE +21 -0
- package/README.md +52 -0
- package/dist/index.cjs +283 -0
- package/dist/index.d.cts +42 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +43 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +262 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +77 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 The grlt-hub Authors
|
|
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,52 @@
|
|
|
1
|
+
# @app-compose/eslint-plugin
|
|
2
|
+
|
|
3
|
+
ESLint plugin that enforces [App-Compose](https://app-compose.dev) conventions in TypeScript code.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@app-compose/eslint-plugin)
|
|
6
|
+

|
|
7
|
+
[](https://www.npmjs.com/package/@app-compose/eslint-plugin)
|
|
8
|
+
|
|
9
|
+
[Docs](https://app-compose.dev/learn/linting/) | [App-Compose](https://app-compose.dev)
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install --save-dev --save-exact @app-compose/eslint-plugin
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Requires ESLint 9+ and TypeScript 5+.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Add the recommended preset to your flat config:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import appCompose from "@app-compose/eslint-plugin"
|
|
25
|
+
import tseslint from "typescript-eslint"
|
|
26
|
+
|
|
27
|
+
export default tseslint.config(appCompose.configs.recommended)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or wire the plugin manually:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
{
|
|
34
|
+
plugins: { "app-compose": appCompose },
|
|
35
|
+
rules: {
|
|
36
|
+
"app-compose/task-options-order": "warn",
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Rules
|
|
42
|
+
|
|
43
|
+
- ⚠️ — set to `warn` in the `recommended` config
|
|
44
|
+
- ❗ — set to `error` in the `recommended` config
|
|
45
|
+
- 🔧 — auto-fixable
|
|
46
|
+
|
|
47
|
+
| Name | Description | ⚠️ | ❗ | 🔧 |
|
|
48
|
+
| ----------------------------------------------------------------------------------------- | ------------------------------------------------- | --- | --- | --- |
|
|
49
|
+
| [no-async-shape-callback](https://app-compose.dev/learn/linting/#no-async-shape-callback) | Disallow async callbacks in `shape()` | | ❗ | |
|
|
50
|
+
| [no-coda-debug](https://app-compose.dev/learn/linting/#no-coda-debug) | Disallow `debug()` calls from `@app-compose/coda` | | ❗ | |
|
|
51
|
+
| [task-options-order](https://app-compose.dev/learn/linting/#task-options-order) | Enforce options order for `createTask` | ⚠️ | | 🔧 |
|
|
52
|
+
| [wire-options-order](https://app-compose.dev/learn/linting/#wire-options-order) | Enforce options order for `createWire` | ⚠️ | | 🔧 |
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
let _typescript_eslint_type_utils = require("@typescript-eslint/type-utils");
|
|
24
|
+
let _typescript_eslint_utils = require("@typescript-eslint/utils");
|
|
25
|
+
let esquery = require("esquery");
|
|
26
|
+
esquery = __toESM(esquery, 1);
|
|
27
|
+
//#region package.json
|
|
28
|
+
var name = "@app-compose/eslint-plugin";
|
|
29
|
+
var version = "3.0.0-beta.7";
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/shared/constants.ts
|
|
32
|
+
const PACKAGE_NAME = {
|
|
33
|
+
CORE: "@app-compose/core",
|
|
34
|
+
CODA: "@app-compose/coda"
|
|
35
|
+
};
|
|
36
|
+
const UNITS = {
|
|
37
|
+
CREATE_TASK: "createTask",
|
|
38
|
+
CREATE_WIRE: "createWire",
|
|
39
|
+
DEBUG: "debug",
|
|
40
|
+
SHAPE: "shape"
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/shared/create.ts
|
|
44
|
+
const createRule = _typescript_eslint_utils.ESLintUtils.RuleCreator(() => "");
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/rules/no-async-shape-callback/no-async-shape-callback.ts
|
|
47
|
+
const importSelector$3 = `ImportDeclaration[source.value=${PACKAGE_NAME.CORE}]`;
|
|
48
|
+
const specifierSelector$1 = `ImportSpecifier[imported.name=${UNITS.SHAPE}]`;
|
|
49
|
+
const callSelector$3 = `[callee.type="Identifier"][arguments.length=2]`;
|
|
50
|
+
var no_async_shape_callback_default = createRule({
|
|
51
|
+
name: "no-async-shape-callback",
|
|
52
|
+
meta: {
|
|
53
|
+
type: "problem",
|
|
54
|
+
docs: { description: `Disallow async callbacks in \`${UNITS.SHAPE}()\`` },
|
|
55
|
+
messages: { asyncCallback: `Unexpected async callback in \`${UNITS.SHAPE}()\` — async work runs outside the chain, and App-Compose cannot order it.` },
|
|
56
|
+
schema: [],
|
|
57
|
+
hasSuggestions: false
|
|
58
|
+
},
|
|
59
|
+
defaultOptions: [],
|
|
60
|
+
create: (context) => {
|
|
61
|
+
const services = _typescript_eslint_utils.ESLintUtils.getParserServices(context);
|
|
62
|
+
const imports = /* @__PURE__ */ new Set();
|
|
63
|
+
return {
|
|
64
|
+
[`${importSelector$3} > ${specifierSelector$1}`]: (node) => void imports.add(node.local.name),
|
|
65
|
+
[`CallExpression${callSelector$3}`]: (node) => {
|
|
66
|
+
if (!imports.has(node.callee.name)) return;
|
|
67
|
+
const [, fn] = node.arguments;
|
|
68
|
+
if (!services.getTypeAtLocation(fn).getCallSignatures().map((signature) => signature.getReturnType()).flatMap((returned) => returned.isUnion() ? returned.types : [returned]).some((type) => (0, _typescript_eslint_type_utils.isPromiseLike)(services.program, type))) return;
|
|
69
|
+
context.report({
|
|
70
|
+
node: fn,
|
|
71
|
+
messageId: "asyncCallback"
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/rules/no-coda-debug/no-coda-debug.ts
|
|
79
|
+
const importSelector$2 = `ImportDeclaration[source.value=${PACKAGE_NAME.CODA}]`;
|
|
80
|
+
const specifierSelector = `ImportSpecifier[imported.name=${UNITS.DEBUG}]`;
|
|
81
|
+
const callSelector$2 = `[callee.type="Identifier"]`;
|
|
82
|
+
var no_coda_debug_default = createRule({
|
|
83
|
+
name: "no-coda-debug",
|
|
84
|
+
meta: {
|
|
85
|
+
type: "problem",
|
|
86
|
+
docs: { description: `Disallow \`${UNITS.DEBUG}()\` calls from ${PACKAGE_NAME.CODA} in committed code` },
|
|
87
|
+
messages: { unexpectedDebug: `Unexpected \`${UNITS.DEBUG}()\` call from ${PACKAGE_NAME.CODA}.` },
|
|
88
|
+
schema: [],
|
|
89
|
+
hasSuggestions: false
|
|
90
|
+
},
|
|
91
|
+
defaultOptions: [],
|
|
92
|
+
create: (context) => {
|
|
93
|
+
const imports = /* @__PURE__ */ new Set();
|
|
94
|
+
return {
|
|
95
|
+
[`${importSelector$2} > ${specifierSelector}`]: (node) => void imports.add(node.local.name),
|
|
96
|
+
[`CallExpression${callSelector$2}`]: (node) => {
|
|
97
|
+
if (!imports.has(node.callee.name)) return;
|
|
98
|
+
context.report({
|
|
99
|
+
node,
|
|
100
|
+
messageId: "unexpectedDebug"
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/shared/ast.ts
|
|
108
|
+
const PLAIN_PROP = esquery.default.parse(`Property[kind="init"][method=false][computed=false][key.type="Identifier"]`);
|
|
109
|
+
const isPlainProp = (prop) => esquery.default.matches(prop, PLAIN_PROP);
|
|
110
|
+
const isSpread = _typescript_eslint_utils.ASTUtils.isNodeOfType(_typescript_eslint_utils.AST_NODE_TYPES.SpreadElement);
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/rules/task-options-order/task-options-order.ts
|
|
113
|
+
const ORDER = [
|
|
114
|
+
"name",
|
|
115
|
+
"run",
|
|
116
|
+
"run.context",
|
|
117
|
+
"run.fn",
|
|
118
|
+
"enabled",
|
|
119
|
+
"enabled.context",
|
|
120
|
+
"enabled.fn"
|
|
121
|
+
];
|
|
122
|
+
const rankOf = (key) => {
|
|
123
|
+
const index = ORDER.indexOf(key);
|
|
124
|
+
return index === -1 ? Infinity : index;
|
|
125
|
+
};
|
|
126
|
+
const hasNested = (key) => ORDER.some((entry) => entry.startsWith(`${key}.`));
|
|
127
|
+
const importSelector$1 = `ImportDeclaration[source.value=${PACKAGE_NAME.CORE}]`;
|
|
128
|
+
const methodSelector$1 = `ImportSpecifier[imported.name=${UNITS.CREATE_TASK}]`;
|
|
129
|
+
const callSelector$1 = `[callee.type="Identifier"][arguments.length=1]`;
|
|
130
|
+
const argumentSelector$1 = `ObjectExpression.arguments`;
|
|
131
|
+
var task_options_order_default = createRule({
|
|
132
|
+
name: "task-options-order",
|
|
133
|
+
meta: {
|
|
134
|
+
type: "problem",
|
|
135
|
+
docs: { description: `Enforce options order for ${UNITS.CREATE_TASK}` },
|
|
136
|
+
messages: { invalidOrder: `Order of options should be \`{{ correctOrder }}\`, but found \`{{ currentOrder }}\`.` },
|
|
137
|
+
schema: [],
|
|
138
|
+
hasSuggestions: false,
|
|
139
|
+
fixable: "code"
|
|
140
|
+
},
|
|
141
|
+
defaultOptions: [],
|
|
142
|
+
create: (context) => {
|
|
143
|
+
const source = context.sourceCode;
|
|
144
|
+
const imports = /* @__PURE__ */ new Set();
|
|
145
|
+
return {
|
|
146
|
+
[`${importSelector$1} > ${methodSelector$1}`]: (node) => void imports.add(node.local.name),
|
|
147
|
+
[`CallExpression${callSelector$1}:has(> ${argumentSelector$1})`]: (node) => {
|
|
148
|
+
if (!imports.has(node.callee.name)) return;
|
|
149
|
+
const [config] = node.arguments;
|
|
150
|
+
if (!isReorderable(config)) return;
|
|
151
|
+
const keys = orderKeys(config);
|
|
152
|
+
if (isOrdered(keys)) return;
|
|
153
|
+
const data = {
|
|
154
|
+
correctOrder: keys.toSorted((a, b) => rankOf(a) - rankOf(b)).join(" -> "),
|
|
155
|
+
currentOrder: keys.join(" -> ")
|
|
156
|
+
};
|
|
157
|
+
const fixed = rebuild(config, null, source);
|
|
158
|
+
context.report({
|
|
159
|
+
node: config,
|
|
160
|
+
messageId: "invalidOrder",
|
|
161
|
+
data,
|
|
162
|
+
fix: fixed === null ? void 0 : (fixer) => fixer.replaceText(config, fixed)
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
const isLeadingSpread = (props, index) => props.slice(0, index).every(isSpread);
|
|
169
|
+
const isTrailingSpread = (props, index) => props.slice(index + 1).every(isSpread);
|
|
170
|
+
const isReorderable = (config) => config.properties.every((prop, index, props) => isSpread(prop) ? isLeadingSpread(props, index) || isTrailingSpread(props, index) : isPlainProp(prop));
|
|
171
|
+
const orderKeys = (config) => config.properties.flatMap((prop) => !isPlainProp(prop) ? [] : prop.value.type === _typescript_eslint_utils.AST_NODE_TYPES.ObjectExpression ? prop.value.properties.filter(isPlainProp).map((nested) => `${prop.key.name}.${nested.key.name}`) : [prop.key.name]);
|
|
172
|
+
const isOrdered = (keys) => {
|
|
173
|
+
const sorted = keys.toSorted((a, b) => rankOf(a) - rankOf(b));
|
|
174
|
+
return keys.every((key, index) => key === sorted[index]);
|
|
175
|
+
};
|
|
176
|
+
const entryOf = ({ prop, index, props, group, source }) => {
|
|
177
|
+
if (isSpread(prop)) {
|
|
178
|
+
if (isTrailingSpread(props, index)) return {
|
|
179
|
+
rank: Infinity,
|
|
180
|
+
text: source.getText(prop)
|
|
181
|
+
};
|
|
182
|
+
if (isLeadingSpread(props, index)) return {
|
|
183
|
+
rank: -Infinity,
|
|
184
|
+
text: source.getText(prop)
|
|
185
|
+
};
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
if (!isPlainProp(prop)) return null;
|
|
189
|
+
const key = group === null ? prop.key.name : `${group}.${prop.key.name}`;
|
|
190
|
+
if (group === null && hasNested(prop.key.name) && prop.value.type === _typescript_eslint_utils.AST_NODE_TYPES.ObjectExpression) {
|
|
191
|
+
const inner = rebuild(prop.value, prop.key.name, source);
|
|
192
|
+
return inner === null ? null : {
|
|
193
|
+
rank: rankOf(key),
|
|
194
|
+
text: `${prop.key.name}: ${inner}`
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
rank: rankOf(key),
|
|
199
|
+
text: source.getText(prop)
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
const rebuild = (obj, group, source) => {
|
|
203
|
+
const entries = [];
|
|
204
|
+
for (const [index, prop] of obj.properties.entries()) {
|
|
205
|
+
const entry = entryOf({
|
|
206
|
+
prop,
|
|
207
|
+
index,
|
|
208
|
+
props: obj.properties,
|
|
209
|
+
group,
|
|
210
|
+
source
|
|
211
|
+
});
|
|
212
|
+
if (entry === null) return null;
|
|
213
|
+
entries.push(entry);
|
|
214
|
+
}
|
|
215
|
+
const texts = entries.toSorted((a, b) => a.rank - b.rank).map((entry) => entry.text);
|
|
216
|
+
return group === null ? `{\n${texts.join(",\n")}\n}` : `{ ${texts.join(", ")} }`;
|
|
217
|
+
};
|
|
218
|
+
//#endregion
|
|
219
|
+
//#region src/rules/wire-options-order/wire-options-order.ts
|
|
220
|
+
const importSelector = `ImportDeclaration[source.value=${PACKAGE_NAME.CORE}]`;
|
|
221
|
+
const methodSelector = `ImportSpecifier[imported.name=${UNITS.CREATE_WIRE}]`;
|
|
222
|
+
const callSelector = `[callee.type="Identifier"][arguments.length=1]`;
|
|
223
|
+
const argumentSelector = `ObjectExpression.arguments[properties.length=2]`;
|
|
224
|
+
var wire_options_order_default = createRule({
|
|
225
|
+
name: "wire-options-order",
|
|
226
|
+
meta: {
|
|
227
|
+
type: "problem",
|
|
228
|
+
docs: { description: `Enforce options order for ${UNITS.CREATE_WIRE}` },
|
|
229
|
+
messages: { invalidOrder: `Order of options should be \`from -> to\`, but found \`to -> from\`.` },
|
|
230
|
+
schema: [],
|
|
231
|
+
hasSuggestions: false,
|
|
232
|
+
fixable: "code"
|
|
233
|
+
},
|
|
234
|
+
defaultOptions: [],
|
|
235
|
+
create: (context) => {
|
|
236
|
+
const source = context.sourceCode;
|
|
237
|
+
const imports = /* @__PURE__ */ new Set();
|
|
238
|
+
return {
|
|
239
|
+
[`${importSelector} > ${methodSelector}`]: (node) => void imports.add(node.local.name),
|
|
240
|
+
[`CallExpression${callSelector}:has(> ${argumentSelector})`]: (node) => {
|
|
241
|
+
if (!imports.has(node.callee.name)) return;
|
|
242
|
+
const [config] = node.arguments;
|
|
243
|
+
const [first, second] = config.properties;
|
|
244
|
+
if (!first || !second || !isPlainProp(first) || !isPlainProp(second)) return;
|
|
245
|
+
if (first.key.name === "from") return;
|
|
246
|
+
context.report({
|
|
247
|
+
node: config,
|
|
248
|
+
messageId: "invalidOrder",
|
|
249
|
+
fix: (fixer) => fixer.replaceText(config, `{\nfrom: ${source.getText(second.value)},\nto: ${source.getText(first.value)}\n}`)
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
const ruleset = { recommended: {
|
|
256
|
+
"app-compose/no-async-shape-callback": "error",
|
|
257
|
+
"app-compose/no-coda-debug": "error",
|
|
258
|
+
"app-compose/task-options-order": "warn",
|
|
259
|
+
"app-compose/wire-options-order": "warn"
|
|
260
|
+
} };
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region src/index.ts
|
|
263
|
+
const base = {
|
|
264
|
+
meta: {
|
|
265
|
+
name,
|
|
266
|
+
version,
|
|
267
|
+
namespace: "app-compose"
|
|
268
|
+
},
|
|
269
|
+
rules: {
|
|
270
|
+
"no-async-shape-callback": no_async_shape_callback_default,
|
|
271
|
+
"no-coda-debug": no_coda_debug_default,
|
|
272
|
+
"task-options-order": task_options_order_default,
|
|
273
|
+
"wire-options-order": wire_options_order_default
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
const configs = { recommended: {
|
|
277
|
+
plugins: { "app-compose": base },
|
|
278
|
+
rules: ruleset.recommended
|
|
279
|
+
} };
|
|
280
|
+
const plugin = base;
|
|
281
|
+
plugin.configs = configs;
|
|
282
|
+
//#endregion
|
|
283
|
+
module.exports = plugin;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { TSESLint } from "@typescript-eslint/utils";
|
|
2
|
+
|
|
3
|
+
//#region src/index.d.ts
|
|
4
|
+
declare const base: {
|
|
5
|
+
meta: {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
namespace: string;
|
|
9
|
+
};
|
|
10
|
+
rules: {
|
|
11
|
+
"no-async-shape-callback": TSESLint.RuleModule<"asyncCallback", [], unknown, TSESLint.RuleListener> & {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
"no-coda-debug": TSESLint.RuleModule<"unexpectedDebug", [], unknown, TSESLint.RuleListener> & {
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
"task-options-order": TSESLint.RuleModule<"invalidOrder", [], unknown, TSESLint.RuleListener> & {
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
"wire-options-order": TSESLint.RuleModule<"invalidOrder", [], unknown, TSESLint.RuleListener> & {
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
declare const configs: {
|
|
26
|
+
recommended: {
|
|
27
|
+
plugins: {
|
|
28
|
+
"app-compose": TSESLint.FlatConfig.Plugin;
|
|
29
|
+
};
|
|
30
|
+
rules: {
|
|
31
|
+
"app-compose/no-async-shape-callback": "error";
|
|
32
|
+
"app-compose/no-coda-debug": "error";
|
|
33
|
+
"app-compose/task-options-order": "warn";
|
|
34
|
+
"app-compose/wire-options-order": "warn";
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
declare const plugin: typeof base & {
|
|
39
|
+
configs: typeof configs;
|
|
40
|
+
};
|
|
41
|
+
export = plugin;
|
|
42
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;cAQM,IAAA;;;;;;;IAGF,yBAAA,EAAyB,QAAA,CAAA,UAAA,+BAAA,QAAA,CAAA,YAAA;;;IACzB,eAAA,EAAe,QAAA,CAAA,UAAA,iCAAA,QAAA,CAAA,YAAA;;;IACf,oBAAA,EAAoB,QAAA,CAAA,UAAA,8BAAA,QAAA,CAAA,YAAA;;;IACpB,oBAAA,EAAoB,QAAA,CAAA,UAAA,8BAAA,QAAA,CAAA,YAAA;;;;;cAIlB,OAAA;EACJ,WAAA;IAAe,OAAA;MAAW,aAAA,EAAuB,QAAA,CAAS,UAAA,CAAW,MAAM;IAAA;IAAI,KAAA;;;;;;;;cAG3E,MAAA,SAAwB,IAAA;EAAS,OAAA,SAAgB,OAAO;AAAA;AAAA"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TSESLint } from "@typescript-eslint/utils";
|
|
2
|
+
|
|
3
|
+
//#region src/index.d.ts
|
|
4
|
+
declare const base: {
|
|
5
|
+
meta: {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
namespace: string;
|
|
9
|
+
};
|
|
10
|
+
rules: {
|
|
11
|
+
"no-async-shape-callback": TSESLint.RuleModule<"asyncCallback", [], unknown, TSESLint.RuleListener> & {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
"no-coda-debug": TSESLint.RuleModule<"unexpectedDebug", [], unknown, TSESLint.RuleListener> & {
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
"task-options-order": TSESLint.RuleModule<"invalidOrder", [], unknown, TSESLint.RuleListener> & {
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
"wire-options-order": TSESLint.RuleModule<"invalidOrder", [], unknown, TSESLint.RuleListener> & {
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
declare const configs: {
|
|
26
|
+
recommended: {
|
|
27
|
+
plugins: {
|
|
28
|
+
"app-compose": TSESLint.FlatConfig.Plugin;
|
|
29
|
+
};
|
|
30
|
+
rules: {
|
|
31
|
+
"app-compose/no-async-shape-callback": "error";
|
|
32
|
+
"app-compose/no-coda-debug": "error";
|
|
33
|
+
"app-compose/task-options-order": "warn";
|
|
34
|
+
"app-compose/wire-options-order": "warn";
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
declare const plugin: typeof base & {
|
|
39
|
+
configs: typeof configs;
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { plugin as default };
|
|
43
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;cAQM,IAAA;;;;;;;IAGF,yBAAA,EAAyB,QAAA,CAAA,UAAA,+BAAA,QAAA,CAAA,YAAA;;;IACzB,eAAA,EAAe,QAAA,CAAA,UAAA,iCAAA,QAAA,CAAA,YAAA;;;IACf,oBAAA,EAAoB,QAAA,CAAA,UAAA,8BAAA,QAAA,CAAA,YAAA;;;IACpB,oBAAA,EAAoB,QAAA,CAAA,UAAA,8BAAA,QAAA,CAAA,YAAA;;;;;cAIlB,OAAA;EACJ,WAAA;IAAe,OAAA;MAAW,aAAA,EAAuB,QAAA,CAAS,UAAA,CAAW,MAAM;IAAA;IAAI,KAAA;;;;;;;;cAG3E,MAAA,SAAwB,IAAA;EAAS,OAAA,SAAgB,OAAO;AAAA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { isPromiseLike } from "@typescript-eslint/type-utils";
|
|
2
|
+
import { ASTUtils, AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
|
|
3
|
+
import esquery from "esquery";
|
|
4
|
+
//#region package.json
|
|
5
|
+
var name = "@app-compose/eslint-plugin";
|
|
6
|
+
var version = "3.0.0-beta.7";
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/shared/constants.ts
|
|
9
|
+
const PACKAGE_NAME = {
|
|
10
|
+
CORE: "@app-compose/core",
|
|
11
|
+
CODA: "@app-compose/coda"
|
|
12
|
+
};
|
|
13
|
+
const UNITS = {
|
|
14
|
+
CREATE_TASK: "createTask",
|
|
15
|
+
CREATE_WIRE: "createWire",
|
|
16
|
+
DEBUG: "debug",
|
|
17
|
+
SHAPE: "shape"
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/shared/create.ts
|
|
21
|
+
const createRule = ESLintUtils.RuleCreator(() => "");
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/rules/no-async-shape-callback/no-async-shape-callback.ts
|
|
24
|
+
const importSelector$3 = `ImportDeclaration[source.value=${PACKAGE_NAME.CORE}]`;
|
|
25
|
+
const specifierSelector$1 = `ImportSpecifier[imported.name=${UNITS.SHAPE}]`;
|
|
26
|
+
const callSelector$3 = `[callee.type="Identifier"][arguments.length=2]`;
|
|
27
|
+
var no_async_shape_callback_default = createRule({
|
|
28
|
+
name: "no-async-shape-callback",
|
|
29
|
+
meta: {
|
|
30
|
+
type: "problem",
|
|
31
|
+
docs: { description: `Disallow async callbacks in \`${UNITS.SHAPE}()\`` },
|
|
32
|
+
messages: { asyncCallback: `Unexpected async callback in \`${UNITS.SHAPE}()\` — async work runs outside the chain, and App-Compose cannot order it.` },
|
|
33
|
+
schema: [],
|
|
34
|
+
hasSuggestions: false
|
|
35
|
+
},
|
|
36
|
+
defaultOptions: [],
|
|
37
|
+
create: (context) => {
|
|
38
|
+
const services = ESLintUtils.getParserServices(context);
|
|
39
|
+
const imports = /* @__PURE__ */ new Set();
|
|
40
|
+
return {
|
|
41
|
+
[`${importSelector$3} > ${specifierSelector$1}`]: (node) => void imports.add(node.local.name),
|
|
42
|
+
[`CallExpression${callSelector$3}`]: (node) => {
|
|
43
|
+
if (!imports.has(node.callee.name)) return;
|
|
44
|
+
const [, fn] = node.arguments;
|
|
45
|
+
if (!services.getTypeAtLocation(fn).getCallSignatures().map((signature) => signature.getReturnType()).flatMap((returned) => returned.isUnion() ? returned.types : [returned]).some((type) => isPromiseLike(services.program, type))) return;
|
|
46
|
+
context.report({
|
|
47
|
+
node: fn,
|
|
48
|
+
messageId: "asyncCallback"
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/rules/no-coda-debug/no-coda-debug.ts
|
|
56
|
+
const importSelector$2 = `ImportDeclaration[source.value=${PACKAGE_NAME.CODA}]`;
|
|
57
|
+
const specifierSelector = `ImportSpecifier[imported.name=${UNITS.DEBUG}]`;
|
|
58
|
+
const callSelector$2 = `[callee.type="Identifier"]`;
|
|
59
|
+
var no_coda_debug_default = createRule({
|
|
60
|
+
name: "no-coda-debug",
|
|
61
|
+
meta: {
|
|
62
|
+
type: "problem",
|
|
63
|
+
docs: { description: `Disallow \`${UNITS.DEBUG}()\` calls from ${PACKAGE_NAME.CODA} in committed code` },
|
|
64
|
+
messages: { unexpectedDebug: `Unexpected \`${UNITS.DEBUG}()\` call from ${PACKAGE_NAME.CODA}.` },
|
|
65
|
+
schema: [],
|
|
66
|
+
hasSuggestions: false
|
|
67
|
+
},
|
|
68
|
+
defaultOptions: [],
|
|
69
|
+
create: (context) => {
|
|
70
|
+
const imports = /* @__PURE__ */ new Set();
|
|
71
|
+
return {
|
|
72
|
+
[`${importSelector$2} > ${specifierSelector}`]: (node) => void imports.add(node.local.name),
|
|
73
|
+
[`CallExpression${callSelector$2}`]: (node) => {
|
|
74
|
+
if (!imports.has(node.callee.name)) return;
|
|
75
|
+
context.report({
|
|
76
|
+
node,
|
|
77
|
+
messageId: "unexpectedDebug"
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/shared/ast.ts
|
|
85
|
+
const PLAIN_PROP = esquery.parse(`Property[kind="init"][method=false][computed=false][key.type="Identifier"]`);
|
|
86
|
+
const isPlainProp = (prop) => esquery.matches(prop, PLAIN_PROP);
|
|
87
|
+
const isSpread = ASTUtils.isNodeOfType(AST_NODE_TYPES.SpreadElement);
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/rules/task-options-order/task-options-order.ts
|
|
90
|
+
const ORDER = [
|
|
91
|
+
"name",
|
|
92
|
+
"run",
|
|
93
|
+
"run.context",
|
|
94
|
+
"run.fn",
|
|
95
|
+
"enabled",
|
|
96
|
+
"enabled.context",
|
|
97
|
+
"enabled.fn"
|
|
98
|
+
];
|
|
99
|
+
const rankOf = (key) => {
|
|
100
|
+
const index = ORDER.indexOf(key);
|
|
101
|
+
return index === -1 ? Infinity : index;
|
|
102
|
+
};
|
|
103
|
+
const hasNested = (key) => ORDER.some((entry) => entry.startsWith(`${key}.`));
|
|
104
|
+
const importSelector$1 = `ImportDeclaration[source.value=${PACKAGE_NAME.CORE}]`;
|
|
105
|
+
const methodSelector$1 = `ImportSpecifier[imported.name=${UNITS.CREATE_TASK}]`;
|
|
106
|
+
const callSelector$1 = `[callee.type="Identifier"][arguments.length=1]`;
|
|
107
|
+
const argumentSelector$1 = `ObjectExpression.arguments`;
|
|
108
|
+
var task_options_order_default = createRule({
|
|
109
|
+
name: "task-options-order",
|
|
110
|
+
meta: {
|
|
111
|
+
type: "problem",
|
|
112
|
+
docs: { description: `Enforce options order for ${UNITS.CREATE_TASK}` },
|
|
113
|
+
messages: { invalidOrder: `Order of options should be \`{{ correctOrder }}\`, but found \`{{ currentOrder }}\`.` },
|
|
114
|
+
schema: [],
|
|
115
|
+
hasSuggestions: false,
|
|
116
|
+
fixable: "code"
|
|
117
|
+
},
|
|
118
|
+
defaultOptions: [],
|
|
119
|
+
create: (context) => {
|
|
120
|
+
const source = context.sourceCode;
|
|
121
|
+
const imports = /* @__PURE__ */ new Set();
|
|
122
|
+
return {
|
|
123
|
+
[`${importSelector$1} > ${methodSelector$1}`]: (node) => void imports.add(node.local.name),
|
|
124
|
+
[`CallExpression${callSelector$1}:has(> ${argumentSelector$1})`]: (node) => {
|
|
125
|
+
if (!imports.has(node.callee.name)) return;
|
|
126
|
+
const [config] = node.arguments;
|
|
127
|
+
if (!isReorderable(config)) return;
|
|
128
|
+
const keys = orderKeys(config);
|
|
129
|
+
if (isOrdered(keys)) return;
|
|
130
|
+
const data = {
|
|
131
|
+
correctOrder: keys.toSorted((a, b) => rankOf(a) - rankOf(b)).join(" -> "),
|
|
132
|
+
currentOrder: keys.join(" -> ")
|
|
133
|
+
};
|
|
134
|
+
const fixed = rebuild(config, null, source);
|
|
135
|
+
context.report({
|
|
136
|
+
node: config,
|
|
137
|
+
messageId: "invalidOrder",
|
|
138
|
+
data,
|
|
139
|
+
fix: fixed === null ? void 0 : (fixer) => fixer.replaceText(config, fixed)
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
const isLeadingSpread = (props, index) => props.slice(0, index).every(isSpread);
|
|
146
|
+
const isTrailingSpread = (props, index) => props.slice(index + 1).every(isSpread);
|
|
147
|
+
const isReorderable = (config) => config.properties.every((prop, index, props) => isSpread(prop) ? isLeadingSpread(props, index) || isTrailingSpread(props, index) : isPlainProp(prop));
|
|
148
|
+
const orderKeys = (config) => config.properties.flatMap((prop) => !isPlainProp(prop) ? [] : prop.value.type === AST_NODE_TYPES.ObjectExpression ? prop.value.properties.filter(isPlainProp).map((nested) => `${prop.key.name}.${nested.key.name}`) : [prop.key.name]);
|
|
149
|
+
const isOrdered = (keys) => {
|
|
150
|
+
const sorted = keys.toSorted((a, b) => rankOf(a) - rankOf(b));
|
|
151
|
+
return keys.every((key, index) => key === sorted[index]);
|
|
152
|
+
};
|
|
153
|
+
const entryOf = ({ prop, index, props, group, source }) => {
|
|
154
|
+
if (isSpread(prop)) {
|
|
155
|
+
if (isTrailingSpread(props, index)) return {
|
|
156
|
+
rank: Infinity,
|
|
157
|
+
text: source.getText(prop)
|
|
158
|
+
};
|
|
159
|
+
if (isLeadingSpread(props, index)) return {
|
|
160
|
+
rank: -Infinity,
|
|
161
|
+
text: source.getText(prop)
|
|
162
|
+
};
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
if (!isPlainProp(prop)) return null;
|
|
166
|
+
const key = group === null ? prop.key.name : `${group}.${prop.key.name}`;
|
|
167
|
+
if (group === null && hasNested(prop.key.name) && prop.value.type === AST_NODE_TYPES.ObjectExpression) {
|
|
168
|
+
const inner = rebuild(prop.value, prop.key.name, source);
|
|
169
|
+
return inner === null ? null : {
|
|
170
|
+
rank: rankOf(key),
|
|
171
|
+
text: `${prop.key.name}: ${inner}`
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
rank: rankOf(key),
|
|
176
|
+
text: source.getText(prop)
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
const rebuild = (obj, group, source) => {
|
|
180
|
+
const entries = [];
|
|
181
|
+
for (const [index, prop] of obj.properties.entries()) {
|
|
182
|
+
const entry = entryOf({
|
|
183
|
+
prop,
|
|
184
|
+
index,
|
|
185
|
+
props: obj.properties,
|
|
186
|
+
group,
|
|
187
|
+
source
|
|
188
|
+
});
|
|
189
|
+
if (entry === null) return null;
|
|
190
|
+
entries.push(entry);
|
|
191
|
+
}
|
|
192
|
+
const texts = entries.toSorted((a, b) => a.rank - b.rank).map((entry) => entry.text);
|
|
193
|
+
return group === null ? `{\n${texts.join(",\n")}\n}` : `{ ${texts.join(", ")} }`;
|
|
194
|
+
};
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/rules/wire-options-order/wire-options-order.ts
|
|
197
|
+
const importSelector = `ImportDeclaration[source.value=${PACKAGE_NAME.CORE}]`;
|
|
198
|
+
const methodSelector = `ImportSpecifier[imported.name=${UNITS.CREATE_WIRE}]`;
|
|
199
|
+
const callSelector = `[callee.type="Identifier"][arguments.length=1]`;
|
|
200
|
+
const argumentSelector = `ObjectExpression.arguments[properties.length=2]`;
|
|
201
|
+
var wire_options_order_default = createRule({
|
|
202
|
+
name: "wire-options-order",
|
|
203
|
+
meta: {
|
|
204
|
+
type: "problem",
|
|
205
|
+
docs: { description: `Enforce options order for ${UNITS.CREATE_WIRE}` },
|
|
206
|
+
messages: { invalidOrder: `Order of options should be \`from -> to\`, but found \`to -> from\`.` },
|
|
207
|
+
schema: [],
|
|
208
|
+
hasSuggestions: false,
|
|
209
|
+
fixable: "code"
|
|
210
|
+
},
|
|
211
|
+
defaultOptions: [],
|
|
212
|
+
create: (context) => {
|
|
213
|
+
const source = context.sourceCode;
|
|
214
|
+
const imports = /* @__PURE__ */ new Set();
|
|
215
|
+
return {
|
|
216
|
+
[`${importSelector} > ${methodSelector}`]: (node) => void imports.add(node.local.name),
|
|
217
|
+
[`CallExpression${callSelector}:has(> ${argumentSelector})`]: (node) => {
|
|
218
|
+
if (!imports.has(node.callee.name)) return;
|
|
219
|
+
const [config] = node.arguments;
|
|
220
|
+
const [first, second] = config.properties;
|
|
221
|
+
if (!first || !second || !isPlainProp(first) || !isPlainProp(second)) return;
|
|
222
|
+
if (first.key.name === "from") return;
|
|
223
|
+
context.report({
|
|
224
|
+
node: config,
|
|
225
|
+
messageId: "invalidOrder",
|
|
226
|
+
fix: (fixer) => fixer.replaceText(config, `{\nfrom: ${source.getText(second.value)},\nto: ${source.getText(first.value)}\n}`)
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
const ruleset = { recommended: {
|
|
233
|
+
"app-compose/no-async-shape-callback": "error",
|
|
234
|
+
"app-compose/no-coda-debug": "error",
|
|
235
|
+
"app-compose/task-options-order": "warn",
|
|
236
|
+
"app-compose/wire-options-order": "warn"
|
|
237
|
+
} };
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/index.ts
|
|
240
|
+
const base = {
|
|
241
|
+
meta: {
|
|
242
|
+
name,
|
|
243
|
+
version,
|
|
244
|
+
namespace: "app-compose"
|
|
245
|
+
},
|
|
246
|
+
rules: {
|
|
247
|
+
"no-async-shape-callback": no_async_shape_callback_default,
|
|
248
|
+
"no-coda-debug": no_coda_debug_default,
|
|
249
|
+
"task-options-order": task_options_order_default,
|
|
250
|
+
"wire-options-order": wire_options_order_default
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
const configs = { recommended: {
|
|
254
|
+
plugins: { "app-compose": base },
|
|
255
|
+
rules: ruleset.recommended
|
|
256
|
+
} };
|
|
257
|
+
const plugin = base;
|
|
258
|
+
plugin.configs = configs;
|
|
259
|
+
//#endregion
|
|
260
|
+
export { plugin as default };
|
|
261
|
+
|
|
262
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["importSelector","specifierSelector","callSelector","importSelector","callSelector","NodeType","importSelector","methodSelector","callSelector","argumentSelector","NodeType","noAsyncShapeCallback","noCodaDebug","taskOptionsOrder","wireOptionsOrder"],"sources":["../package.json","../src/shared/constants.ts","../src/shared/create.ts","../src/rules/no-async-shape-callback/no-async-shape-callback.ts","../src/rules/no-coda-debug/no-coda-debug.ts","../src/shared/ast.ts","../src/rules/task-options-order/task-options-order.ts","../src/rules/wire-options-order/wire-options-order.ts","../src/ruleset.ts","../src/index.ts"],"sourcesContent":["","const PACKAGE_NAME = {\n CORE: \"@app-compose/core\",\n CODA: \"@app-compose/coda\",\n}\n\nconst UNITS = {\n CREATE_TASK: \"createTask\",\n CREATE_WIRE: \"createWire\",\n DEBUG: \"debug\",\n SHAPE: \"shape\",\n}\n\nexport { PACKAGE_NAME, UNITS }\n","import { ESLintUtils } from \"@typescript-eslint/utils\"\n\nexport const createRule = ESLintUtils.RuleCreator(() => \"\")\n","import { isPromiseLike } from \"@typescript-eslint/type-utils\"\nimport { ESLintUtils, type TSESTree as Node } from \"@typescript-eslint/utils\"\nimport { PACKAGE_NAME, UNITS } from \"@/shared/constants\"\nimport { createRule } from \"@/shared/create\"\n\nconst importSelector = `ImportDeclaration[source.value=${PACKAGE_NAME.CORE}]`\nconst specifierSelector = `ImportSpecifier[imported.name=${UNITS.SHAPE}]`\nconst callSelector = `[callee.type=\"Identifier\"][arguments.length=2]`\n\nexport default createRule({\n name: \"no-async-shape-callback\",\n meta: {\n type: \"problem\",\n docs: {\n description: `Disallow async callbacks in \\`${UNITS.SHAPE}()\\``,\n },\n messages: {\n asyncCallback: `Unexpected async callback in \\`${UNITS.SHAPE}()\\` — async work runs outside the chain, and App-Compose cannot order it.`,\n },\n schema: [],\n hasSuggestions: false,\n },\n defaultOptions: [],\n create: (context) => {\n const services = ESLintUtils.getParserServices(context)\n const imports = new Set<string>()\n\n type ShapeCall = Node.CallExpression & {\n callee: Node.Identifier\n arguments: [Node.CallExpressionArgument, Node.CallExpressionArgument]\n }\n\n return {\n [`${importSelector} > ${specifierSelector}`]: (node: Node.ImportSpecifier) => void imports.add(node.local.name),\n\n [`CallExpression${callSelector}`]: (node: ShapeCall) => {\n if (!imports.has(node.callee.name)) return\n\n const [, fn] = node.arguments\n const returnsPromise = services\n .getTypeAtLocation(fn)\n .getCallSignatures()\n .map((signature) => signature.getReturnType())\n .flatMap((returned) => (returned.isUnion() ? returned.types : [returned]))\n .some((type) => isPromiseLike(services.program, type))\n\n if (!returnsPromise) return\n\n context.report({ node: fn, messageId: \"asyncCallback\" })\n },\n }\n },\n})\n","import type { TSESTree as Node } from \"@typescript-eslint/utils\"\nimport { PACKAGE_NAME, UNITS } from \"@/shared/constants\"\nimport { createRule } from \"@/shared/create\"\n\nconst importSelector = `ImportDeclaration[source.value=${PACKAGE_NAME.CODA}]`\nconst specifierSelector = `ImportSpecifier[imported.name=${UNITS.DEBUG}]`\nconst callSelector = `[callee.type=\"Identifier\"]`\n\nexport default createRule({\n name: \"no-coda-debug\",\n meta: {\n type: \"problem\",\n docs: {\n description: `Disallow \\`${UNITS.DEBUG}()\\` calls from ${PACKAGE_NAME.CODA} in committed code`,\n },\n messages: {\n unexpectedDebug: `Unexpected \\`${UNITS.DEBUG}()\\` call from ${PACKAGE_NAME.CODA}.`,\n },\n schema: [],\n hasSuggestions: false,\n },\n defaultOptions: [],\n create: (context) => {\n const imports = new Set<string>()\n\n type DebugCall = Node.CallExpression & { callee: Node.Identifier }\n\n return {\n [`${importSelector} > ${specifierSelector}`]: (node: Node.ImportSpecifier) => void imports.add(node.local.name),\n\n [`CallExpression${callSelector}`]: (node: DebugCall) => {\n if (!imports.has(node.callee.name)) return\n context.report({ node, messageId: \"unexpectedDebug\" })\n },\n }\n },\n})\n","import { AST_NODE_TYPES as NodeType, ASTUtils, type TSESTree as Node } from \"@typescript-eslint/utils\"\nimport esquery from \"esquery\"\n\ntype KeyedProp = Node.Property & { key: Node.Identifier }\n\n// A plain `key: value` (or shorthand) property — the shape the options-order rules relocate by name.\n// Matched with an esquery selector, like the rules' node matches; the `prop is KeyedProp` annotation\n// keeps `.filter`/`.find` callers narrowed. Spreads, getters/setters, methods and computed keys miss.\nconst PLAIN_PROP = esquery.parse(`Property[kind=\"init\"][method=false][computed=false][key.type=\"Identifier\"]`)\nconst isPlainProp = (prop: Node.ObjectLiteralElement): prop is KeyedProp =>\n esquery.matches(prop as unknown as Parameters<typeof esquery.matches>[0], PLAIN_PROP)\n\n// A spread element (`...rest`) inside an object literal. It carries no key of its own, so it anchors a\n// position rather than taking part in key ordering.\nconst isSpread = ASTUtils.isNodeOfType(NodeType.SpreadElement)\n\nexport { isPlainProp, isSpread }\n","import { type TSESTree as Node, AST_NODE_TYPES as NodeType, type TSESLint } from \"@typescript-eslint/utils\"\nimport { isPlainProp, isSpread } from \"@/shared/ast\"\nimport { PACKAGE_NAME, UNITS } from \"@/shared/constants\"\nimport { createRule } from \"@/shared/create\"\n\n// Canonical key order, flat: every option, top-level groups and their nested keys, in one list. A\n// `run`/`enabled` ranks at its group slot when opaque (shorthand, variable, …) and at its leaf slots\n// when inline; a config holds one form or the other, so the two never collide.\nconst ORDER = [\"name\", \"run\", \"run.context\", \"run.fn\", \"enabled\", \"enabled.context\", \"enabled.fn\"]\nconst rankOf = (key: string) => {\n const index = ORDER.indexOf(key)\n return index === -1 ? Infinity : index\n}\n// `run`/`enabled` carry nested keys; `name` does not. An inline group is rebuilt from its leaves, an\n// opaque one (shorthand, variable) ranks at its group slot and stays whole.\nconst hasNested = (key: string) => ORDER.some((entry) => entry.startsWith(`${key}.`))\n\nconst importSelector = `ImportDeclaration[source.value=${PACKAGE_NAME.CORE}]`\nconst methodSelector = `ImportSpecifier[imported.name=${UNITS.CREATE_TASK}]`\n\nconst callSelector = `[callee.type=\"Identifier\"][arguments.length=1]`\n// Direct child, not a descendant: matches `createTask({ … })` but not `createTask(factory({ … }))`,\n// where the object literal sits inside a nested call's arguments rather than createTask's own.\nconst argumentSelector = `ObjectExpression.arguments`\n\nexport default createRule({\n name: \"task-options-order\",\n meta: {\n type: \"problem\",\n docs: {\n description: `Enforce options order for ${UNITS.CREATE_TASK}`,\n },\n messages: {\n invalidOrder: `Order of options should be \\`{{ correctOrder }}\\`, but found \\`{{ currentOrder }}\\`.`,\n },\n schema: [],\n hasSuggestions: false,\n fixable: \"code\",\n },\n defaultOptions: [],\n create: (context) => {\n const source = context.sourceCode\n const imports = new Set<string>()\n\n // The selector guarantees a single object-literal argument, so `config` is an ObjectExpression.\n type MethodCall = Node.CallExpression & { callee: Node.Identifier; arguments: [Node.ObjectExpression] }\n\n return {\n [`${importSelector} > ${methodSelector}`]: (node: Node.ImportSpecifier) => void imports.add(node.local.name),\n\n [`CallExpression${callSelector}:has(> ${argumentSelector})`]: (node: MethodCall) => {\n if (!imports.has(node.callee.name)) return\n\n const [config] = node.arguments\n // The order is undeterminable when a spread sits between options (it could inject any key) or\n // an exotic entry (computed key, getter, method) hides a name — so we don't report. Unknown\n // plain keys are fine: they just sort to the end.\n if (!isReorderable(config)) return\n\n const keys = orderKeys(config)\n if (isOrdered(keys)) return\n\n const data = {\n correctOrder: keys.toSorted((a, b) => rankOf(a) - rankOf(b)).join(\" -> \"),\n currentOrder: keys.join(\" -> \"),\n }\n\n // One pass relocates the real nodes, so shorthand/spread/comments survive. `rebuild` returns\n // null when a nested key would have to cross a spread (position is load-bearing there): we\n // report the violation but leave the fix to a human.\n const fixed = rebuild(config, null, source)\n context.report({\n node: config,\n messageId: \"invalidOrder\",\n data,\n fix: fixed === null ? undefined : (fixer) => fixer.replaceText(config, fixed),\n })\n },\n }\n },\n})\n\ntype Element = Node.ObjectExpression[\"properties\"][number]\ntype Entry = { rank: number; text: string }\n\n// A spread anchors a boundary — keys never cross it — so it only fits at the head or tail of a config.\nconst isLeadingSpread = (props: Element[], index: number) => props.slice(0, index).every(isSpread)\nconst isTrailingSpread = (props: Element[], index: number) => props.slice(index + 1).every(isSpread)\n\n// Can we reason about the top-level order? Every entry must be a plain key (known or unknown) or a\n// spread anchored at the head/tail. An interior spread or an exotic entry hides where options sit.\nconst isReorderable = (config: Node.ObjectExpression) =>\n config.properties.every((prop, index, props) =>\n isSpread(prop) ? isLeadingSpread(props, index) || isTrailingSpread(props, index) : isPlainProp(prop),\n )\n\n// The visible dotted keys in source order, for the message and the ordered check. A `run`/`enabled`\n// object expands into its nested keys; every other plain key contributes its own; spreads carry none.\nconst orderKeys = (config: Node.ObjectExpression): string[] =>\n config.properties.flatMap((prop) =>\n !isPlainProp(prop)\n ? []\n : prop.value.type === NodeType.ObjectExpression\n ? prop.value.properties.filter(isPlainProp).map((nested) => `${prop.key.name}.${nested.key.name}`)\n : [prop.key.name],\n )\n\n// Already canonical? A stable sort leaves equal ranks (unknown keys, multiple spreads) in place, so an\n// ordered config sorts to itself.\nconst isOrdered = (keys: string[]) => {\n const sorted = keys.toSorted((a, b) => rankOf(a) - rankOf(b))\n return keys.every((key, index) => key === sorted[index])\n}\n\n// Sort rank and source text for one entry, or null when it can't be reordered safely. A spread anchors\n// at the head (-Infinity) or tail (Infinity); an unknown key sorts to the end (Infinity); an inline\n// `run`/`enabled` is rebuilt recursively (null if its own keys would cross a spread); the rest is\n// emitted verbatim, so shorthand and comments survive.\ntype EntryOfParams = {\n prop: Element\n index: number\n props: Element[]\n group: string | null\n source: Readonly<TSESLint.SourceCode>\n}\n\nconst entryOf = ({ prop, index, props, group, source }: EntryOfParams): Entry | null => {\n if (isSpread(prop)) {\n if (isTrailingSpread(props, index)) return { rank: Infinity, text: source.getText(prop) }\n if (isLeadingSpread(props, index)) return { rank: -Infinity, text: source.getText(prop) }\n return null\n }\n if (!isPlainProp(prop)) return null\n\n const key = group === null ? prop.key.name : `${group}.${prop.key.name}`\n\n if (group === null && hasNested(prop.key.name) && prop.value.type === NodeType.ObjectExpression) {\n const inner = rebuild(prop.value, prop.key.name, source)\n return inner === null ? null : { rank: rankOf(key), text: `${prop.key.name}: ${inner}` }\n }\n\n return { rank: rankOf(key), text: source.getText(prop) }\n}\n\n// Canonical source text for an object literal, or null when an entry can't be reordered safely. The top\n// level (group null) prints one entry per line; a nested `run`/`enabled` stays inline.\nconst rebuild = (\n obj: Node.ObjectExpression,\n group: string | null,\n source: Readonly<TSESLint.SourceCode>,\n): string | null => {\n const entries: Entry[] = []\n for (const [index, prop] of obj.properties.entries()) {\n const entry = entryOf({ prop, index, props: obj.properties, group, source })\n if (entry === null) return null\n entries.push(entry)\n }\n\n const texts = entries.toSorted((a, b) => a.rank - b.rank).map((entry) => entry.text)\n return group === null ? `{\\n${texts.join(\",\\n\")}\\n}` : `{ ${texts.join(\", \")} }`\n}\n","import type { TSESTree as Node } from \"@typescript-eslint/utils\"\nimport { isPlainProp } from \"@/shared/ast\"\nimport { PACKAGE_NAME, UNITS } from \"@/shared/constants\"\nimport { createRule } from \"@/shared/create\"\n\nconst importSelector = `ImportDeclaration[source.value=${PACKAGE_NAME.CORE}]`\nconst methodSelector = `ImportSpecifier[imported.name=${UNITS.CREATE_WIRE}]`\nconst callSelector = `[callee.type=\"Identifier\"][arguments.length=1]`\n// Direct child, not a descendant: matches `createWire({ … })` but not `createWire(buildWire({ … }))`,\n// where the object literal sits inside a nested call. The two-property count is a cheap structural\n// predicate, so it rides along in the selector; the shape of those two entries is narrowed in the body.\nconst argumentSelector = `ObjectExpression.arguments[properties.length=2]`\n\nexport default createRule({\n name: \"wire-options-order\",\n meta: {\n type: \"problem\",\n docs: {\n description: `Enforce options order for ${UNITS.CREATE_WIRE}`,\n },\n messages: {\n invalidOrder: `Order of options should be \\`from -> to\\`, but found \\`to -> from\\`.`,\n },\n schema: [],\n hasSuggestions: false,\n fixable: \"code\",\n },\n defaultOptions: [],\n create: (context) => {\n const source = context.sourceCode\n const imports = new Set<string>()\n\n // The selector guarantees a single object-literal argument with exactly two properties, so\n // `config` is an ObjectExpression; the shape of those two entries is still narrowed in the body.\n type MethodCall = Node.CallExpression & { callee: Node.Identifier; arguments: [Node.ObjectExpression] }\n\n return {\n [`${importSelector} > ${methodSelector}`]: (node: Node.ImportSpecifier) => void imports.add(node.local.name),\n\n [`CallExpression${callSelector}:has(> ${argumentSelector})`]: (node: MethodCall) => {\n if (!imports.has(node.callee.name)) return\n\n const [config] = node.arguments\n const [first, second] = config.properties\n\n if (!first || !second || !isPlainProp(first) || !isPlainProp(second)) return\n\n if (first.key.name === \"from\") return\n\n context.report({\n node: config,\n messageId: \"invalidOrder\",\n fix: (fixer) =>\n fixer.replaceText(\n config,\n `{\\nfrom: ${source.getText(second.value)},\\nto: ${source.getText(first.value)}\\n}`,\n ),\n })\n },\n }\n },\n})\n","import type { TSESLint } from \"@typescript-eslint/utils\"\n\nconst recommended = {\n \"app-compose/no-async-shape-callback\": \"error\",\n \"app-compose/no-coda-debug\": \"error\",\n \"app-compose/task-options-order\": \"warn\",\n \"app-compose/wire-options-order\": \"warn\",\n} satisfies TSESLint.Linter.RulesRecord\n\nexport const ruleset = { recommended }\n","import type { TSESLint } from \"@typescript-eslint/utils\"\nimport { name, version } from \"../package.json\"\nimport noAsyncShapeCallback from \"./rules/no-async-shape-callback/no-async-shape-callback\"\nimport noCodaDebug from \"./rules/no-coda-debug/no-coda-debug\"\nimport taskOptionsOrder from \"./rules/task-options-order/task-options-order\"\nimport wireOptionsOrder from \"./rules/wire-options-order/wire-options-order\"\nimport { ruleset } from \"./ruleset\"\n\nconst base = {\n meta: { name, version, namespace: \"app-compose\" },\n rules: {\n \"no-async-shape-callback\": noAsyncShapeCallback,\n \"no-coda-debug\": noCodaDebug,\n \"task-options-order\": taskOptionsOrder,\n \"wire-options-order\": wireOptionsOrder,\n },\n}\n\nconst configs = {\n recommended: { plugins: { \"app-compose\": base as TSESLint.FlatConfig.Plugin }, rules: ruleset.recommended },\n}\n\nconst plugin = base as typeof base & { configs: typeof configs }\n\nplugin.configs = configs\n\nexport default plugin\n"],"mappings":";;;;;;;;ACAA,MAAM,eAAe;CACnB,MAAM;CACN,MAAM;AAC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DD,MAAa,UAAU,EAAE;CANvB,uCAAuC;CACvC,6BAA6B;CAC7B,kCAAkC;CAClC,kCAAkC;AAGX,EAAY;;;ACDrC,MAAM,OAAO;CACX,MAAM;EAAE;EAAM;EAAS,WAAW;CAAc;CAChD,OAAO;EACL,2BAA2BC;EAC3B,iBAAiBC;EACjB,sBAAsBC;EACtB,sBAAsBC;CACxB;AACF;AAEA,MAAM,UAAU,EACd,aAAa;CAAE,SAAS,EAAE,eAAe,KAAmC;CAAG,OAAO,QAAQ;AAAY,EAC5G;AAEA,MAAM,SAAS;AAEf,OAAO,UAAU"}
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@app-compose/eslint-plugin",
|
|
3
|
+
"version": "3.0.0-beta.7",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Enforcing best practices for @app-compose/core",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"app-compose",
|
|
8
|
+
"eslint",
|
|
9
|
+
"eslint-plugin",
|
|
10
|
+
"eslintplugin",
|
|
11
|
+
"grlt",
|
|
12
|
+
"grlt-hub"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://app-compose.dev",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"contributors": [
|
|
17
|
+
{
|
|
18
|
+
"name": "Mikhail Kireev",
|
|
19
|
+
"url": "https://github.com/kireevmp"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "Viktor Pasynok",
|
|
23
|
+
"url": "https://github.com/binjospookie"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/grlt-hub/app-compose.git"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"type": "module",
|
|
34
|
+
"main": "dist/index.cjs",
|
|
35
|
+
"module": "./dist/index.mjs",
|
|
36
|
+
"types": "./dist/index.d.cts",
|
|
37
|
+
"exports": {
|
|
38
|
+
".": {
|
|
39
|
+
"import": {
|
|
40
|
+
"types": "./dist/index.d.mts",
|
|
41
|
+
"default": "./dist/index.mjs"
|
|
42
|
+
},
|
|
43
|
+
"require": {
|
|
44
|
+
"types": "./dist/index.d.cts",
|
|
45
|
+
"default": "./dist/index.cjs"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"./package.json": "./package.json"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "tsc --noEmit -p tsconfig.json && tsdown",
|
|
55
|
+
"dev": "tsdown --watch",
|
|
56
|
+
"prepack": "pnpm build",
|
|
57
|
+
"test": "vitest run",
|
|
58
|
+
"lint": "knip && oxlint ./src"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@typescript-eslint/type-utils": "^8.58.0",
|
|
62
|
+
"@typescript-eslint/utils": "^8.58.0",
|
|
63
|
+
"esquery": "^1"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@app-compose/coda": "workspace:*",
|
|
67
|
+
"@app-compose/core": "workspace:*",
|
|
68
|
+
"@types/esquery": "^1.5.4",
|
|
69
|
+
"@typescript-eslint/rule-tester": "8.61.0",
|
|
70
|
+
"eslint": "^10.4.1"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"eslint": "^9.0.0 || ^10.0.0",
|
|
74
|
+
"typescript": "^5.0.0 || ^6.0.0"
|
|
75
|
+
},
|
|
76
|
+
"packageManager": "pnpm@11.5.3+sha512.7ac1c919341c213a34dc0d02afb7143c5c26ac26ee8c4782deea821b8ac64d2134a081fd8941dae6e29bbb48f58dfc2b7fbceeccc07cb2f09d219d342a4969ed"
|
|
77
|
+
}
|