@stardeck-customer-apps/eslint-plugin 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +192 -2
- package/dist/index.d.cts +5 -11
- package/dist/index.d.ts +5 -11
- package/dist/index.js +182 -2
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/index.ts
|
|
@@ -65,9 +75,187 @@ var rule = {
|
|
|
65
75
|
};
|
|
66
76
|
var no_template_literal_classname_default = rule;
|
|
67
77
|
|
|
78
|
+
// src/rules/no-kysely-interactive-transaction.ts
|
|
79
|
+
var rule2 = {
|
|
80
|
+
meta: {
|
|
81
|
+
type: "problem",
|
|
82
|
+
docs: {
|
|
83
|
+
description: "Disallow Kysely interactive transactions, which throw at runtime on the Neon HTTP driver used by data stores",
|
|
84
|
+
recommended: true
|
|
85
|
+
},
|
|
86
|
+
messages: {
|
|
87
|
+
noInteractiveTransaction: "The Neon HTTP driver used by data stores doesn't support interactive transactions, so `.transaction().execute(...)` throws at runtime. Combine the statements into a single query (e.g. a CTE via `db.with(...)`) or run them sequentially instead.",
|
|
88
|
+
noControlledTransaction: "The Neon HTTP driver used by data stores doesn't support controlled transactions, so `.startTransaction().execute()` throws at runtime. Combine the statements into a single query (e.g. a CTE via `db.with(...)`) or run them sequentially instead."
|
|
89
|
+
},
|
|
90
|
+
schema: []
|
|
91
|
+
},
|
|
92
|
+
create(context) {
|
|
93
|
+
return {
|
|
94
|
+
CallExpression(node) {
|
|
95
|
+
const callee = node.callee;
|
|
96
|
+
if (callee.type !== "MemberExpression") {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const property = callee.property;
|
|
100
|
+
if (property.type !== "Identifier") {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (property.name !== "transaction" && property.name !== "startTransaction") {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (property.name === "startTransaction" && node.arguments.length === 0) {
|
|
107
|
+
context.report({
|
|
108
|
+
node,
|
|
109
|
+
messageId: "noControlledTransaction"
|
|
110
|
+
});
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (property.name === "transaction" && node.arguments.length === 0) {
|
|
114
|
+
context.report({
|
|
115
|
+
node,
|
|
116
|
+
messageId: "noInteractiveTransaction"
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
var no_kysely_interactive_transaction_default = rule2;
|
|
124
|
+
|
|
125
|
+
// src/rules/no-module-internal-import.ts
|
|
126
|
+
var import_node_path = __toESM(require("path"), 1);
|
|
127
|
+
var ALIAS_PREFIX = "@/";
|
|
128
|
+
function toPosix(filePath) {
|
|
129
|
+
return filePath.split(import_node_path.default.sep).join("/");
|
|
130
|
+
}
|
|
131
|
+
function findSrcRoot(filename) {
|
|
132
|
+
const parts = toPosix(filename).split("/");
|
|
133
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
134
|
+
if (parts[i] === "src" && parts[i + 1] === "modules") {
|
|
135
|
+
return parts.slice(0, i + 1).join("/");
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
let lastSrcIdx = -1;
|
|
139
|
+
for (let i = 0; i < parts.length; i++) {
|
|
140
|
+
if (parts[i] === "src") lastSrcIdx = i;
|
|
141
|
+
}
|
|
142
|
+
if (lastSrcIdx === -1) return null;
|
|
143
|
+
return parts.slice(0, lastSrcIdx + 1).join("/");
|
|
144
|
+
}
|
|
145
|
+
function normalizePosixPath(raw) {
|
|
146
|
+
const absolute = raw.startsWith("/");
|
|
147
|
+
const parts = raw.split("/");
|
|
148
|
+
const stack = [];
|
|
149
|
+
for (const part of parts) {
|
|
150
|
+
if (part === "" || part === ".") continue;
|
|
151
|
+
if (part === "..") {
|
|
152
|
+
if (stack.length === 0) return null;
|
|
153
|
+
stack.pop();
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
stack.push(part);
|
|
157
|
+
}
|
|
158
|
+
const joined = stack.join("/");
|
|
159
|
+
return absolute ? `/${joined}` : joined;
|
|
160
|
+
}
|
|
161
|
+
function dirnamePosix(filePath) {
|
|
162
|
+
const idx = filePath.lastIndexOf("/");
|
|
163
|
+
if (idx <= 0) return "/";
|
|
164
|
+
return filePath.slice(0, idx);
|
|
165
|
+
}
|
|
166
|
+
function resolveImportPath(filename, srcRoot, specifier) {
|
|
167
|
+
let candidate;
|
|
168
|
+
if (specifier.startsWith(ALIAS_PREFIX)) {
|
|
169
|
+
candidate = `${srcRoot}/${specifier.slice(ALIAS_PREFIX.length)}`;
|
|
170
|
+
} else if (specifier.startsWith("./") || specifier.startsWith("../")) {
|
|
171
|
+
candidate = `${dirnamePosix(toPosix(filename))}/${specifier}`;
|
|
172
|
+
} else {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
const normalized = normalizePosixPath(candidate);
|
|
176
|
+
if (!normalized) return null;
|
|
177
|
+
if (normalized !== srcRoot && !normalized.startsWith(`${srcRoot}/`)) {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
return normalized;
|
|
181
|
+
}
|
|
182
|
+
function getModuleName(filePath, srcRoot) {
|
|
183
|
+
if (!filePath.startsWith(`${srcRoot}/`)) return null;
|
|
184
|
+
const rel = filePath.slice(srcRoot.length + 1);
|
|
185
|
+
const match = /^modules\/([^/]+)/.exec(rel);
|
|
186
|
+
return match ? match[1] : null;
|
|
187
|
+
}
|
|
188
|
+
function isPublicSurface(resolvedPath, srcRoot, moduleName) {
|
|
189
|
+
const base = `${srcRoot}/modules/${moduleName}`;
|
|
190
|
+
if (resolvedPath === base) return true;
|
|
191
|
+
if (resolvedPath === `${base}/index`) return true;
|
|
192
|
+
if (resolvedPath === `${base}/index.ts`) return true;
|
|
193
|
+
if (resolvedPath === `${base}/index.tsx`) return true;
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
var rule3 = {
|
|
197
|
+
meta: {
|
|
198
|
+
type: "problem",
|
|
199
|
+
docs: {
|
|
200
|
+
description: "Disallow imports that reach into a vendored module's internals; import only through `@/modules/<name>` (its index)",
|
|
201
|
+
recommended: true
|
|
202
|
+
},
|
|
203
|
+
messages: {
|
|
204
|
+
noInternalImport: "Import '{{module}}' through its public surface ('@/modules/{{module}}') \u2014 '{{source}}' reaches into module internals, which breaks module install/update isolation."
|
|
205
|
+
},
|
|
206
|
+
schema: []
|
|
207
|
+
},
|
|
208
|
+
create(context) {
|
|
209
|
+
const filename = context.filename;
|
|
210
|
+
if (!filename || filename === "<input>" || filename === "<text>") {
|
|
211
|
+
return {};
|
|
212
|
+
}
|
|
213
|
+
const srcRoot = findSrcRoot(filename);
|
|
214
|
+
if (!srcRoot) {
|
|
215
|
+
return {};
|
|
216
|
+
}
|
|
217
|
+
const root = srcRoot;
|
|
218
|
+
const importerModule = getModuleName(toPosix(filename), root);
|
|
219
|
+
function check(node, sourceNode) {
|
|
220
|
+
if (!sourceNode || sourceNode.type !== "Literal") return;
|
|
221
|
+
const value = sourceNode.value;
|
|
222
|
+
if (typeof value !== "string") return;
|
|
223
|
+
const resolved = resolveImportPath(filename, root, value);
|
|
224
|
+
if (!resolved) return;
|
|
225
|
+
const targetModule = getModuleName(resolved, root);
|
|
226
|
+
if (!targetModule) return;
|
|
227
|
+
if (isPublicSurface(resolved, root, targetModule)) return;
|
|
228
|
+
if (importerModule === targetModule) return;
|
|
229
|
+
context.report({
|
|
230
|
+
node,
|
|
231
|
+
messageId: "noInternalImport",
|
|
232
|
+
data: { module: targetModule, source: value }
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
ImportDeclaration(node) {
|
|
237
|
+
check(node, node.source);
|
|
238
|
+
},
|
|
239
|
+
ImportExpression(node) {
|
|
240
|
+
const src = node.source;
|
|
241
|
+
check(node, src);
|
|
242
|
+
},
|
|
243
|
+
ExportNamedDeclaration(node) {
|
|
244
|
+
check(node, node.source);
|
|
245
|
+
},
|
|
246
|
+
ExportAllDeclaration(node) {
|
|
247
|
+
check(node, node.source);
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
var no_module_internal_import_default = rule3;
|
|
253
|
+
|
|
68
254
|
// src/rules/index.ts
|
|
69
255
|
var rules = {
|
|
70
|
-
"no-template-literal-classname": no_template_literal_classname_default
|
|
256
|
+
"no-template-literal-classname": no_template_literal_classname_default,
|
|
257
|
+
"no-kysely-interactive-transaction": no_kysely_interactive_transaction_default,
|
|
258
|
+
"no-module-internal-import": no_module_internal_import_default
|
|
71
259
|
};
|
|
72
260
|
|
|
73
261
|
// src/configs/recommended.ts
|
|
@@ -79,7 +267,9 @@ var recommended = {
|
|
|
79
267
|
}
|
|
80
268
|
},
|
|
81
269
|
rules: {
|
|
82
|
-
[`${pluginName}/no-template-literal-classname`]: "error"
|
|
270
|
+
[`${pluginName}/no-template-literal-classname`]: "error",
|
|
271
|
+
[`${pluginName}/no-kysely-interactive-transaction`]: "error",
|
|
272
|
+
[`${pluginName}/no-module-internal-import`]: "error"
|
|
83
273
|
}
|
|
84
274
|
};
|
|
85
275
|
|
package/dist/index.d.cts
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import * as eslint from 'eslint';
|
|
2
|
+
import { Linter, ESLint } from 'eslint';
|
|
2
3
|
|
|
3
4
|
declare const rules: {
|
|
4
5
|
"no-template-literal-classname": eslint.Rule.RuleModule;
|
|
6
|
+
"no-kysely-interactive-transaction": eslint.Rule.RuleModule;
|
|
7
|
+
"no-module-internal-import": eslint.Rule.RuleModule;
|
|
5
8
|
};
|
|
6
9
|
|
|
7
|
-
declare const configs:
|
|
8
|
-
recommended: eslint.Linter.Config<eslint.Linter.RulesRecord>;
|
|
9
|
-
};
|
|
10
|
+
declare const configs: Record<string, Linter.Config>;
|
|
10
11
|
|
|
11
|
-
declare const plugin:
|
|
12
|
-
rules: {
|
|
13
|
-
"no-template-literal-classname": eslint.Rule.RuleModule;
|
|
14
|
-
};
|
|
15
|
-
configs: {
|
|
16
|
-
recommended: eslint.Linter.Config<eslint.Linter.RulesRecord>;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
12
|
+
declare const plugin: ESLint.Plugin;
|
|
19
13
|
|
|
20
14
|
export { configs, plugin as default, rules };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import * as eslint from 'eslint';
|
|
2
|
+
import { Linter, ESLint } from 'eslint';
|
|
2
3
|
|
|
3
4
|
declare const rules: {
|
|
4
5
|
"no-template-literal-classname": eslint.Rule.RuleModule;
|
|
6
|
+
"no-kysely-interactive-transaction": eslint.Rule.RuleModule;
|
|
7
|
+
"no-module-internal-import": eslint.Rule.RuleModule;
|
|
5
8
|
};
|
|
6
9
|
|
|
7
|
-
declare const configs:
|
|
8
|
-
recommended: eslint.Linter.Config<eslint.Linter.RulesRecord>;
|
|
9
|
-
};
|
|
10
|
+
declare const configs: Record<string, Linter.Config>;
|
|
10
11
|
|
|
11
|
-
declare const plugin:
|
|
12
|
-
rules: {
|
|
13
|
-
"no-template-literal-classname": eslint.Rule.RuleModule;
|
|
14
|
-
};
|
|
15
|
-
configs: {
|
|
16
|
-
recommended: eslint.Linter.Config<eslint.Linter.RulesRecord>;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
12
|
+
declare const plugin: ESLint.Plugin;
|
|
19
13
|
|
|
20
14
|
export { configs, plugin as default, rules };
|
package/dist/index.js
CHANGED
|
@@ -37,9 +37,187 @@ var rule = {
|
|
|
37
37
|
};
|
|
38
38
|
var no_template_literal_classname_default = rule;
|
|
39
39
|
|
|
40
|
+
// src/rules/no-kysely-interactive-transaction.ts
|
|
41
|
+
var rule2 = {
|
|
42
|
+
meta: {
|
|
43
|
+
type: "problem",
|
|
44
|
+
docs: {
|
|
45
|
+
description: "Disallow Kysely interactive transactions, which throw at runtime on the Neon HTTP driver used by data stores",
|
|
46
|
+
recommended: true
|
|
47
|
+
},
|
|
48
|
+
messages: {
|
|
49
|
+
noInteractiveTransaction: "The Neon HTTP driver used by data stores doesn't support interactive transactions, so `.transaction().execute(...)` throws at runtime. Combine the statements into a single query (e.g. a CTE via `db.with(...)`) or run them sequentially instead.",
|
|
50
|
+
noControlledTransaction: "The Neon HTTP driver used by data stores doesn't support controlled transactions, so `.startTransaction().execute()` throws at runtime. Combine the statements into a single query (e.g. a CTE via `db.with(...)`) or run them sequentially instead."
|
|
51
|
+
},
|
|
52
|
+
schema: []
|
|
53
|
+
},
|
|
54
|
+
create(context) {
|
|
55
|
+
return {
|
|
56
|
+
CallExpression(node) {
|
|
57
|
+
const callee = node.callee;
|
|
58
|
+
if (callee.type !== "MemberExpression") {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const property = callee.property;
|
|
62
|
+
if (property.type !== "Identifier") {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (property.name !== "transaction" && property.name !== "startTransaction") {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (property.name === "startTransaction" && node.arguments.length === 0) {
|
|
69
|
+
context.report({
|
|
70
|
+
node,
|
|
71
|
+
messageId: "noControlledTransaction"
|
|
72
|
+
});
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (property.name === "transaction" && node.arguments.length === 0) {
|
|
76
|
+
context.report({
|
|
77
|
+
node,
|
|
78
|
+
messageId: "noInteractiveTransaction"
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
var no_kysely_interactive_transaction_default = rule2;
|
|
86
|
+
|
|
87
|
+
// src/rules/no-module-internal-import.ts
|
|
88
|
+
import path from "path";
|
|
89
|
+
var ALIAS_PREFIX = "@/";
|
|
90
|
+
function toPosix(filePath) {
|
|
91
|
+
return filePath.split(path.sep).join("/");
|
|
92
|
+
}
|
|
93
|
+
function findSrcRoot(filename) {
|
|
94
|
+
const parts = toPosix(filename).split("/");
|
|
95
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
96
|
+
if (parts[i] === "src" && parts[i + 1] === "modules") {
|
|
97
|
+
return parts.slice(0, i + 1).join("/");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
let lastSrcIdx = -1;
|
|
101
|
+
for (let i = 0; i < parts.length; i++) {
|
|
102
|
+
if (parts[i] === "src") lastSrcIdx = i;
|
|
103
|
+
}
|
|
104
|
+
if (lastSrcIdx === -1) return null;
|
|
105
|
+
return parts.slice(0, lastSrcIdx + 1).join("/");
|
|
106
|
+
}
|
|
107
|
+
function normalizePosixPath(raw) {
|
|
108
|
+
const absolute = raw.startsWith("/");
|
|
109
|
+
const parts = raw.split("/");
|
|
110
|
+
const stack = [];
|
|
111
|
+
for (const part of parts) {
|
|
112
|
+
if (part === "" || part === ".") continue;
|
|
113
|
+
if (part === "..") {
|
|
114
|
+
if (stack.length === 0) return null;
|
|
115
|
+
stack.pop();
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
stack.push(part);
|
|
119
|
+
}
|
|
120
|
+
const joined = stack.join("/");
|
|
121
|
+
return absolute ? `/${joined}` : joined;
|
|
122
|
+
}
|
|
123
|
+
function dirnamePosix(filePath) {
|
|
124
|
+
const idx = filePath.lastIndexOf("/");
|
|
125
|
+
if (idx <= 0) return "/";
|
|
126
|
+
return filePath.slice(0, idx);
|
|
127
|
+
}
|
|
128
|
+
function resolveImportPath(filename, srcRoot, specifier) {
|
|
129
|
+
let candidate;
|
|
130
|
+
if (specifier.startsWith(ALIAS_PREFIX)) {
|
|
131
|
+
candidate = `${srcRoot}/${specifier.slice(ALIAS_PREFIX.length)}`;
|
|
132
|
+
} else if (specifier.startsWith("./") || specifier.startsWith("../")) {
|
|
133
|
+
candidate = `${dirnamePosix(toPosix(filename))}/${specifier}`;
|
|
134
|
+
} else {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
const normalized = normalizePosixPath(candidate);
|
|
138
|
+
if (!normalized) return null;
|
|
139
|
+
if (normalized !== srcRoot && !normalized.startsWith(`${srcRoot}/`)) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
return normalized;
|
|
143
|
+
}
|
|
144
|
+
function getModuleName(filePath, srcRoot) {
|
|
145
|
+
if (!filePath.startsWith(`${srcRoot}/`)) return null;
|
|
146
|
+
const rel = filePath.slice(srcRoot.length + 1);
|
|
147
|
+
const match = /^modules\/([^/]+)/.exec(rel);
|
|
148
|
+
return match ? match[1] : null;
|
|
149
|
+
}
|
|
150
|
+
function isPublicSurface(resolvedPath, srcRoot, moduleName) {
|
|
151
|
+
const base = `${srcRoot}/modules/${moduleName}`;
|
|
152
|
+
if (resolvedPath === base) return true;
|
|
153
|
+
if (resolvedPath === `${base}/index`) return true;
|
|
154
|
+
if (resolvedPath === `${base}/index.ts`) return true;
|
|
155
|
+
if (resolvedPath === `${base}/index.tsx`) return true;
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
var rule3 = {
|
|
159
|
+
meta: {
|
|
160
|
+
type: "problem",
|
|
161
|
+
docs: {
|
|
162
|
+
description: "Disallow imports that reach into a vendored module's internals; import only through `@/modules/<name>` (its index)",
|
|
163
|
+
recommended: true
|
|
164
|
+
},
|
|
165
|
+
messages: {
|
|
166
|
+
noInternalImport: "Import '{{module}}' through its public surface ('@/modules/{{module}}') \u2014 '{{source}}' reaches into module internals, which breaks module install/update isolation."
|
|
167
|
+
},
|
|
168
|
+
schema: []
|
|
169
|
+
},
|
|
170
|
+
create(context) {
|
|
171
|
+
const filename = context.filename;
|
|
172
|
+
if (!filename || filename === "<input>" || filename === "<text>") {
|
|
173
|
+
return {};
|
|
174
|
+
}
|
|
175
|
+
const srcRoot = findSrcRoot(filename);
|
|
176
|
+
if (!srcRoot) {
|
|
177
|
+
return {};
|
|
178
|
+
}
|
|
179
|
+
const root = srcRoot;
|
|
180
|
+
const importerModule = getModuleName(toPosix(filename), root);
|
|
181
|
+
function check(node, sourceNode) {
|
|
182
|
+
if (!sourceNode || sourceNode.type !== "Literal") return;
|
|
183
|
+
const value = sourceNode.value;
|
|
184
|
+
if (typeof value !== "string") return;
|
|
185
|
+
const resolved = resolveImportPath(filename, root, value);
|
|
186
|
+
if (!resolved) return;
|
|
187
|
+
const targetModule = getModuleName(resolved, root);
|
|
188
|
+
if (!targetModule) return;
|
|
189
|
+
if (isPublicSurface(resolved, root, targetModule)) return;
|
|
190
|
+
if (importerModule === targetModule) return;
|
|
191
|
+
context.report({
|
|
192
|
+
node,
|
|
193
|
+
messageId: "noInternalImport",
|
|
194
|
+
data: { module: targetModule, source: value }
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
ImportDeclaration(node) {
|
|
199
|
+
check(node, node.source);
|
|
200
|
+
},
|
|
201
|
+
ImportExpression(node) {
|
|
202
|
+
const src = node.source;
|
|
203
|
+
check(node, src);
|
|
204
|
+
},
|
|
205
|
+
ExportNamedDeclaration(node) {
|
|
206
|
+
check(node, node.source);
|
|
207
|
+
},
|
|
208
|
+
ExportAllDeclaration(node) {
|
|
209
|
+
check(node, node.source);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
var no_module_internal_import_default = rule3;
|
|
215
|
+
|
|
40
216
|
// src/rules/index.ts
|
|
41
217
|
var rules = {
|
|
42
|
-
"no-template-literal-classname": no_template_literal_classname_default
|
|
218
|
+
"no-template-literal-classname": no_template_literal_classname_default,
|
|
219
|
+
"no-kysely-interactive-transaction": no_kysely_interactive_transaction_default,
|
|
220
|
+
"no-module-internal-import": no_module_internal_import_default
|
|
43
221
|
};
|
|
44
222
|
|
|
45
223
|
// src/configs/recommended.ts
|
|
@@ -51,7 +229,9 @@ var recommended = {
|
|
|
51
229
|
}
|
|
52
230
|
},
|
|
53
231
|
rules: {
|
|
54
|
-
[`${pluginName}/no-template-literal-classname`]: "error"
|
|
232
|
+
[`${pluginName}/no-template-literal-classname`]: "error",
|
|
233
|
+
[`${pluginName}/no-kysely-interactive-transaction`]: "error",
|
|
234
|
+
[`${pluginName}/no-module-internal-import`]: "error"
|
|
55
235
|
}
|
|
56
236
|
};
|
|
57
237
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stardeck-customer-apps/eslint-plugin",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Custom ESLint rules for Stardeck customer apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
26
26
|
"dev": "tsup src/index.ts --format esm,cjs --dts --watch",
|
|
27
27
|
"typecheck": "tsc --noEmit",
|
|
28
|
+
"test": "vitest run",
|
|
28
29
|
"format": "prettier --write . && eslint . --fix",
|
|
29
30
|
"lint": "eslint src/"
|
|
30
31
|
},
|