eslint-plugin-slonik 1.0.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/LICENSE +48 -0
- package/README.md +368 -0
- package/dist/config.cjs +61 -0
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +192 -0
- package/dist/config.d.mts +192 -0
- package/dist/config.d.ts +192 -0
- package/dist/config.mjs +59 -0
- package/dist/config.mjs.map +1 -0
- package/dist/index.cjs +27 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +319 -0
- package/dist/index.d.mts +319 -0
- package/dist/index.d.ts +319 -0
- package/dist/index.mjs +20 -0
- package/dist/index.mjs.map +1 -0
- package/dist/shared/eslint-plugin-slonik.1m1xlVmw.d.cts +611 -0
- package/dist/shared/eslint-plugin-slonik.1m1xlVmw.d.mts +611 -0
- package/dist/shared/eslint-plugin-slonik.1m1xlVmw.d.ts +611 -0
- package/dist/shared/eslint-plugin-slonik.BxexVlk1.cjs +1539 -0
- package/dist/shared/eslint-plugin-slonik.BxexVlk1.cjs.map +1 -0
- package/dist/shared/eslint-plugin-slonik.C0xTyWZ2.mjs +2866 -0
- package/dist/shared/eslint-plugin-slonik.C0xTyWZ2.mjs.map +1 -0
- package/dist/shared/eslint-plugin-slonik.DbzoLz5_.mjs +1514 -0
- package/dist/shared/eslint-plugin-slonik.DbzoLz5_.mjs.map +1 -0
- package/dist/shared/eslint-plugin-slonik.rlOTrCdf.cjs +2929 -0
- package/dist/shared/eslint-plugin-slonik.rlOTrCdf.cjs.map +1 -0
- package/dist/workers/check-sql.worker.cjs +2436 -0
- package/dist/workers/check-sql.worker.cjs.map +1 -0
- package/dist/workers/check-sql.worker.d.cts +171 -0
- package/dist/workers/check-sql.worker.d.mts +171 -0
- package/dist/workers/check-sql.worker.d.ts +171 -0
- package/dist/workers/check-sql.worker.mjs +2412 -0
- package/dist/workers/check-sql.worker.mjs.map +1 -0
- package/package.json +103 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
2
|
+
import { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
|
|
3
|
+
import { C as Config } from './shared/eslint-plugin-slonik.1m1xlVmw.mjs';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
declare const _default: {
|
|
7
|
+
configs: {
|
|
8
|
+
/**
|
|
9
|
+
* If you prefer configuring via a config file (slonik.config.ts), use this config.
|
|
10
|
+
*/
|
|
11
|
+
useConfigFile: {
|
|
12
|
+
plugins: {
|
|
13
|
+
slonik: {
|
|
14
|
+
rules: {
|
|
15
|
+
"check-sql": _typescript_eslint_utils_ts_eslint.RuleModule<"error" | "typeInferenceFailed" | "invalidQuery" | "missingTypeAnnotations" | "incorrectTypeAnnotations" | "invalidTypeAnnotations", ({
|
|
16
|
+
connections: {
|
|
17
|
+
targets: ({
|
|
18
|
+
wrapper: string | {
|
|
19
|
+
regex: string;
|
|
20
|
+
};
|
|
21
|
+
maxDepth?: number | undefined;
|
|
22
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
23
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
24
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
25
|
+
} | {
|
|
26
|
+
tag: string | {
|
|
27
|
+
regex: string;
|
|
28
|
+
};
|
|
29
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
30
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
31
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
32
|
+
})[];
|
|
33
|
+
migrationsDir: string;
|
|
34
|
+
keepAlive?: boolean | undefined;
|
|
35
|
+
overrides?: {
|
|
36
|
+
types?: Record<"bigint" | "boolean" | "int" | "null" | "void" | "date" | "int2" | "int4" | "int8" | "smallint" | "real" | "float4" | "float" | "float8" | "numeric" | "decimal" | "smallserial" | "serial" | "bigserial" | "uuid" | "text" | "varchar" | "char" | "bpchar" | "citext" | "bit" | "bool" | "timestamp" | "timestamptz" | "time" | "timetz" | "interval" | "inet" | "cidr" | "macaddr" | "macaddr8" | "money" | "json" | "jsonb" | "bytea", string | {
|
|
37
|
+
parameter: string | {
|
|
38
|
+
regex: string;
|
|
39
|
+
};
|
|
40
|
+
return: string;
|
|
41
|
+
}> | Record<string, string | {
|
|
42
|
+
parameter: string | {
|
|
43
|
+
regex: string;
|
|
44
|
+
};
|
|
45
|
+
return: string;
|
|
46
|
+
}> | undefined;
|
|
47
|
+
columns?: Record<string, string> | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
nullAsUndefined?: boolean | undefined;
|
|
50
|
+
nullAsOptional?: boolean | undefined;
|
|
51
|
+
inferLiterals?: boolean | ("string" | "number" | "boolean")[] | undefined;
|
|
52
|
+
connectionUrl?: string | undefined;
|
|
53
|
+
databaseName?: string | undefined;
|
|
54
|
+
watchMode?: boolean | undefined;
|
|
55
|
+
} | {
|
|
56
|
+
targets: ({
|
|
57
|
+
wrapper: string | {
|
|
58
|
+
regex: string;
|
|
59
|
+
};
|
|
60
|
+
maxDepth?: number | undefined;
|
|
61
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
62
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
63
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
64
|
+
} | {
|
|
65
|
+
tag: string | {
|
|
66
|
+
regex: string;
|
|
67
|
+
};
|
|
68
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
69
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
70
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
71
|
+
})[];
|
|
72
|
+
databaseUrl: string;
|
|
73
|
+
keepAlive?: boolean | undefined;
|
|
74
|
+
overrides?: {
|
|
75
|
+
types?: Record<"bigint" | "boolean" | "int" | "null" | "void" | "date" | "int2" | "int4" | "int8" | "smallint" | "real" | "float4" | "float" | "float8" | "numeric" | "decimal" | "smallserial" | "serial" | "bigserial" | "uuid" | "text" | "varchar" | "char" | "bpchar" | "citext" | "bit" | "bool" | "timestamp" | "timestamptz" | "time" | "timetz" | "interval" | "inet" | "cidr" | "macaddr" | "macaddr8" | "money" | "json" | "jsonb" | "bytea", string | {
|
|
76
|
+
parameter: string | {
|
|
77
|
+
regex: string;
|
|
78
|
+
};
|
|
79
|
+
return: string;
|
|
80
|
+
}> | Record<string, string | {
|
|
81
|
+
parameter: string | {
|
|
82
|
+
regex: string;
|
|
83
|
+
};
|
|
84
|
+
return: string;
|
|
85
|
+
}> | undefined;
|
|
86
|
+
columns?: Record<string, string> | undefined;
|
|
87
|
+
} | undefined;
|
|
88
|
+
nullAsUndefined?: boolean | undefined;
|
|
89
|
+
nullAsOptional?: boolean | undefined;
|
|
90
|
+
inferLiterals?: boolean | ("string" | "number" | "boolean")[] | undefined;
|
|
91
|
+
} | ({
|
|
92
|
+
targets: ({
|
|
93
|
+
wrapper: string | {
|
|
94
|
+
regex: string;
|
|
95
|
+
};
|
|
96
|
+
maxDepth?: number | undefined;
|
|
97
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
98
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
99
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
100
|
+
} | {
|
|
101
|
+
tag: string | {
|
|
102
|
+
regex: string;
|
|
103
|
+
};
|
|
104
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
105
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
106
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
107
|
+
})[];
|
|
108
|
+
migrationsDir: string;
|
|
109
|
+
keepAlive?: boolean | undefined;
|
|
110
|
+
overrides?: {
|
|
111
|
+
types?: Record<"bigint" | "boolean" | "int" | "null" | "void" | "date" | "int2" | "int4" | "int8" | "smallint" | "real" | "float4" | "float" | "float8" | "numeric" | "decimal" | "smallserial" | "serial" | "bigserial" | "uuid" | "text" | "varchar" | "char" | "bpchar" | "citext" | "bit" | "bool" | "timestamp" | "timestamptz" | "time" | "timetz" | "interval" | "inet" | "cidr" | "macaddr" | "macaddr8" | "money" | "json" | "jsonb" | "bytea", string | {
|
|
112
|
+
parameter: string | {
|
|
113
|
+
regex: string;
|
|
114
|
+
};
|
|
115
|
+
return: string;
|
|
116
|
+
}> | Record<string, string | {
|
|
117
|
+
parameter: string | {
|
|
118
|
+
regex: string;
|
|
119
|
+
};
|
|
120
|
+
return: string;
|
|
121
|
+
}> | undefined;
|
|
122
|
+
columns?: Record<string, string> | undefined;
|
|
123
|
+
} | undefined;
|
|
124
|
+
nullAsUndefined?: boolean | undefined;
|
|
125
|
+
nullAsOptional?: boolean | undefined;
|
|
126
|
+
inferLiterals?: boolean | ("string" | "number" | "boolean")[] | undefined;
|
|
127
|
+
connectionUrl?: string | undefined;
|
|
128
|
+
databaseName?: string | undefined;
|
|
129
|
+
watchMode?: boolean | undefined;
|
|
130
|
+
} | {
|
|
131
|
+
targets: ({
|
|
132
|
+
wrapper: string | {
|
|
133
|
+
regex: string;
|
|
134
|
+
};
|
|
135
|
+
maxDepth?: number | undefined;
|
|
136
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
137
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
138
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
139
|
+
} | {
|
|
140
|
+
tag: string | {
|
|
141
|
+
regex: string;
|
|
142
|
+
};
|
|
143
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
144
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
145
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
146
|
+
})[];
|
|
147
|
+
databaseUrl: string;
|
|
148
|
+
keepAlive?: boolean | undefined;
|
|
149
|
+
overrides?: {
|
|
150
|
+
types?: Record<"bigint" | "boolean" | "int" | "null" | "void" | "date" | "int2" | "int4" | "int8" | "smallint" | "real" | "float4" | "float" | "float8" | "numeric" | "decimal" | "smallserial" | "serial" | "bigserial" | "uuid" | "text" | "varchar" | "char" | "bpchar" | "citext" | "bit" | "bool" | "timestamp" | "timestamptz" | "time" | "timetz" | "interval" | "inet" | "cidr" | "macaddr" | "macaddr8" | "money" | "json" | "jsonb" | "bytea", string | {
|
|
151
|
+
parameter: string | {
|
|
152
|
+
regex: string;
|
|
153
|
+
};
|
|
154
|
+
return: string;
|
|
155
|
+
}> | Record<string, string | {
|
|
156
|
+
parameter: string | {
|
|
157
|
+
regex: string;
|
|
158
|
+
};
|
|
159
|
+
return: string;
|
|
160
|
+
}> | undefined;
|
|
161
|
+
columns?: Record<string, string> | undefined;
|
|
162
|
+
} | undefined;
|
|
163
|
+
nullAsUndefined?: boolean | undefined;
|
|
164
|
+
nullAsOptional?: boolean | undefined;
|
|
165
|
+
inferLiterals?: boolean | ("string" | "number" | "boolean")[] | undefined;
|
|
166
|
+
})[];
|
|
167
|
+
} | {
|
|
168
|
+
useConfigFile: boolean;
|
|
169
|
+
})[], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
170
|
+
name: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
meta: {
|
|
174
|
+
name: string;
|
|
175
|
+
version: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
rules: {
|
|
180
|
+
"slonik/check-sql": ["error", {
|
|
181
|
+
useConfigFile: boolean;
|
|
182
|
+
}];
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* If you prefer configuring via a flat config, use this config.
|
|
187
|
+
*/
|
|
188
|
+
connections: (connections: Config["connections"]) => FlatConfig.Config;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
export { _default as default };
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
2
|
+
import { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
|
|
3
|
+
import { C as Config } from './shared/eslint-plugin-slonik.1m1xlVmw.js';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
declare const _default: {
|
|
7
|
+
configs: {
|
|
8
|
+
/**
|
|
9
|
+
* If you prefer configuring via a config file (slonik.config.ts), use this config.
|
|
10
|
+
*/
|
|
11
|
+
useConfigFile: {
|
|
12
|
+
plugins: {
|
|
13
|
+
slonik: {
|
|
14
|
+
rules: {
|
|
15
|
+
"check-sql": _typescript_eslint_utils_ts_eslint.RuleModule<"error" | "typeInferenceFailed" | "invalidQuery" | "missingTypeAnnotations" | "incorrectTypeAnnotations" | "invalidTypeAnnotations", ({
|
|
16
|
+
connections: {
|
|
17
|
+
targets: ({
|
|
18
|
+
wrapper: string | {
|
|
19
|
+
regex: string;
|
|
20
|
+
};
|
|
21
|
+
maxDepth?: number | undefined;
|
|
22
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
23
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
24
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
25
|
+
} | {
|
|
26
|
+
tag: string | {
|
|
27
|
+
regex: string;
|
|
28
|
+
};
|
|
29
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
30
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
31
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
32
|
+
})[];
|
|
33
|
+
migrationsDir: string;
|
|
34
|
+
keepAlive?: boolean | undefined;
|
|
35
|
+
overrides?: {
|
|
36
|
+
types?: Record<"bigint" | "boolean" | "int" | "null" | "void" | "date" | "int2" | "int4" | "int8" | "smallint" | "real" | "float4" | "float" | "float8" | "numeric" | "decimal" | "smallserial" | "serial" | "bigserial" | "uuid" | "text" | "varchar" | "char" | "bpchar" | "citext" | "bit" | "bool" | "timestamp" | "timestamptz" | "time" | "timetz" | "interval" | "inet" | "cidr" | "macaddr" | "macaddr8" | "money" | "json" | "jsonb" | "bytea", string | {
|
|
37
|
+
parameter: string | {
|
|
38
|
+
regex: string;
|
|
39
|
+
};
|
|
40
|
+
return: string;
|
|
41
|
+
}> | Record<string, string | {
|
|
42
|
+
parameter: string | {
|
|
43
|
+
regex: string;
|
|
44
|
+
};
|
|
45
|
+
return: string;
|
|
46
|
+
}> | undefined;
|
|
47
|
+
columns?: Record<string, string> | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
nullAsUndefined?: boolean | undefined;
|
|
50
|
+
nullAsOptional?: boolean | undefined;
|
|
51
|
+
inferLiterals?: boolean | ("string" | "number" | "boolean")[] | undefined;
|
|
52
|
+
connectionUrl?: string | undefined;
|
|
53
|
+
databaseName?: string | undefined;
|
|
54
|
+
watchMode?: boolean | undefined;
|
|
55
|
+
} | {
|
|
56
|
+
targets: ({
|
|
57
|
+
wrapper: string | {
|
|
58
|
+
regex: string;
|
|
59
|
+
};
|
|
60
|
+
maxDepth?: number | undefined;
|
|
61
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
62
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
63
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
64
|
+
} | {
|
|
65
|
+
tag: string | {
|
|
66
|
+
regex: string;
|
|
67
|
+
};
|
|
68
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
69
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
70
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
71
|
+
})[];
|
|
72
|
+
databaseUrl: string;
|
|
73
|
+
keepAlive?: boolean | undefined;
|
|
74
|
+
overrides?: {
|
|
75
|
+
types?: Record<"bigint" | "boolean" | "int" | "null" | "void" | "date" | "int2" | "int4" | "int8" | "smallint" | "real" | "float4" | "float" | "float8" | "numeric" | "decimal" | "smallserial" | "serial" | "bigserial" | "uuid" | "text" | "varchar" | "char" | "bpchar" | "citext" | "bit" | "bool" | "timestamp" | "timestamptz" | "time" | "timetz" | "interval" | "inet" | "cidr" | "macaddr" | "macaddr8" | "money" | "json" | "jsonb" | "bytea", string | {
|
|
76
|
+
parameter: string | {
|
|
77
|
+
regex: string;
|
|
78
|
+
};
|
|
79
|
+
return: string;
|
|
80
|
+
}> | Record<string, string | {
|
|
81
|
+
parameter: string | {
|
|
82
|
+
regex: string;
|
|
83
|
+
};
|
|
84
|
+
return: string;
|
|
85
|
+
}> | undefined;
|
|
86
|
+
columns?: Record<string, string> | undefined;
|
|
87
|
+
} | undefined;
|
|
88
|
+
nullAsUndefined?: boolean | undefined;
|
|
89
|
+
nullAsOptional?: boolean | undefined;
|
|
90
|
+
inferLiterals?: boolean | ("string" | "number" | "boolean")[] | undefined;
|
|
91
|
+
} | ({
|
|
92
|
+
targets: ({
|
|
93
|
+
wrapper: string | {
|
|
94
|
+
regex: string;
|
|
95
|
+
};
|
|
96
|
+
maxDepth?: number | undefined;
|
|
97
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
98
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
99
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
100
|
+
} | {
|
|
101
|
+
tag: string | {
|
|
102
|
+
regex: string;
|
|
103
|
+
};
|
|
104
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
105
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
106
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
107
|
+
})[];
|
|
108
|
+
migrationsDir: string;
|
|
109
|
+
keepAlive?: boolean | undefined;
|
|
110
|
+
overrides?: {
|
|
111
|
+
types?: Record<"bigint" | "boolean" | "int" | "null" | "void" | "date" | "int2" | "int4" | "int8" | "smallint" | "real" | "float4" | "float" | "float8" | "numeric" | "decimal" | "smallserial" | "serial" | "bigserial" | "uuid" | "text" | "varchar" | "char" | "bpchar" | "citext" | "bit" | "bool" | "timestamp" | "timestamptz" | "time" | "timetz" | "interval" | "inet" | "cidr" | "macaddr" | "macaddr8" | "money" | "json" | "jsonb" | "bytea", string | {
|
|
112
|
+
parameter: string | {
|
|
113
|
+
regex: string;
|
|
114
|
+
};
|
|
115
|
+
return: string;
|
|
116
|
+
}> | Record<string, string | {
|
|
117
|
+
parameter: string | {
|
|
118
|
+
regex: string;
|
|
119
|
+
};
|
|
120
|
+
return: string;
|
|
121
|
+
}> | undefined;
|
|
122
|
+
columns?: Record<string, string> | undefined;
|
|
123
|
+
} | undefined;
|
|
124
|
+
nullAsUndefined?: boolean | undefined;
|
|
125
|
+
nullAsOptional?: boolean | undefined;
|
|
126
|
+
inferLiterals?: boolean | ("string" | "number" | "boolean")[] | undefined;
|
|
127
|
+
connectionUrl?: string | undefined;
|
|
128
|
+
databaseName?: string | undefined;
|
|
129
|
+
watchMode?: boolean | undefined;
|
|
130
|
+
} | {
|
|
131
|
+
targets: ({
|
|
132
|
+
wrapper: string | {
|
|
133
|
+
regex: string;
|
|
134
|
+
};
|
|
135
|
+
maxDepth?: number | undefined;
|
|
136
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
137
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
138
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
139
|
+
} | {
|
|
140
|
+
tag: string | {
|
|
141
|
+
regex: string;
|
|
142
|
+
};
|
|
143
|
+
transform?: string | (string | [string, string])[] | undefined;
|
|
144
|
+
fieldTransform?: "snake" | "pascal" | "camel" | "screaming snake" | undefined;
|
|
145
|
+
skipTypeAnnotations?: boolean | undefined;
|
|
146
|
+
})[];
|
|
147
|
+
databaseUrl: string;
|
|
148
|
+
keepAlive?: boolean | undefined;
|
|
149
|
+
overrides?: {
|
|
150
|
+
types?: Record<"bigint" | "boolean" | "int" | "null" | "void" | "date" | "int2" | "int4" | "int8" | "smallint" | "real" | "float4" | "float" | "float8" | "numeric" | "decimal" | "smallserial" | "serial" | "bigserial" | "uuid" | "text" | "varchar" | "char" | "bpchar" | "citext" | "bit" | "bool" | "timestamp" | "timestamptz" | "time" | "timetz" | "interval" | "inet" | "cidr" | "macaddr" | "macaddr8" | "money" | "json" | "jsonb" | "bytea", string | {
|
|
151
|
+
parameter: string | {
|
|
152
|
+
regex: string;
|
|
153
|
+
};
|
|
154
|
+
return: string;
|
|
155
|
+
}> | Record<string, string | {
|
|
156
|
+
parameter: string | {
|
|
157
|
+
regex: string;
|
|
158
|
+
};
|
|
159
|
+
return: string;
|
|
160
|
+
}> | undefined;
|
|
161
|
+
columns?: Record<string, string> | undefined;
|
|
162
|
+
} | undefined;
|
|
163
|
+
nullAsUndefined?: boolean | undefined;
|
|
164
|
+
nullAsOptional?: boolean | undefined;
|
|
165
|
+
inferLiterals?: boolean | ("string" | "number" | "boolean")[] | undefined;
|
|
166
|
+
})[];
|
|
167
|
+
} | {
|
|
168
|
+
useConfigFile: boolean;
|
|
169
|
+
})[], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
170
|
+
name: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
meta: {
|
|
174
|
+
name: string;
|
|
175
|
+
version: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
rules: {
|
|
180
|
+
"slonik/check-sql": ["error", {
|
|
181
|
+
useConfigFile: boolean;
|
|
182
|
+
}];
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* If you prefer configuring via a flat config, use this config.
|
|
187
|
+
*/
|
|
188
|
+
connections: (connections: Config["connections"]) => FlatConfig.Config;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
export = _default;
|
package/dist/config.mjs
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { r as rules } from './shared/eslint-plugin-slonik.DbzoLz5_.mjs';
|
|
2
|
+
import './shared/eslint-plugin-slonik.C0xTyWZ2.mjs';
|
|
3
|
+
import 'path';
|
|
4
|
+
import 'postgres';
|
|
5
|
+
import 'crypto';
|
|
6
|
+
import 'fs';
|
|
7
|
+
import 'ts-pattern';
|
|
8
|
+
import '@typescript-eslint/utils';
|
|
9
|
+
import 'fp-ts/lib/Either.js';
|
|
10
|
+
import 'fp-ts/lib/function.js';
|
|
11
|
+
import 'fp-ts/lib/Option.js';
|
|
12
|
+
import 'fp-ts/lib/TaskEither.js';
|
|
13
|
+
import 'fp-ts/lib/Json.js';
|
|
14
|
+
import 'pg-connection-string';
|
|
15
|
+
import 'typescript';
|
|
16
|
+
import 'synckit';
|
|
17
|
+
import 'node:url';
|
|
18
|
+
import 'zod';
|
|
19
|
+
import 'module';
|
|
20
|
+
|
|
21
|
+
const version = "1.0.0";
|
|
22
|
+
|
|
23
|
+
const slonikPlugin = {
|
|
24
|
+
rules,
|
|
25
|
+
meta: {
|
|
26
|
+
name: "eslint-plugin-slonik",
|
|
27
|
+
version
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const config = {
|
|
32
|
+
configs: {
|
|
33
|
+
/**
|
|
34
|
+
* If you prefer configuring via a config file (slonik.config.ts), use this config.
|
|
35
|
+
*/
|
|
36
|
+
useConfigFile: {
|
|
37
|
+
plugins: {
|
|
38
|
+
slonik: slonikPlugin
|
|
39
|
+
},
|
|
40
|
+
rules: {
|
|
41
|
+
"slonik/check-sql": ["error", { useConfigFile: true }]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* If you prefer configuring via a flat config, use this config.
|
|
46
|
+
*/
|
|
47
|
+
connections: (connections) => ({
|
|
48
|
+
plugins: {
|
|
49
|
+
slonik: slonikPlugin
|
|
50
|
+
},
|
|
51
|
+
rules: {
|
|
52
|
+
"slonik/check-sql": ["error", { connections }]
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { config as default };
|
|
59
|
+
//# sourceMappingURL=config.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.mjs","sources":["../src/plugin.ts","../src/config.ts"],"sourcesContent":["import { FlatConfig } from \"@typescript-eslint/utils/ts-eslint\";\nimport rules from \"./rules\";\nimport { version } from \"../package.json\";\n\nexport default {\n rules: rules,\n meta: {\n name: \"eslint-plugin-slonik\",\n version: version,\n },\n} satisfies FlatConfig.Plugin;\n","import { FlatConfig } from \"@typescript-eslint/utils/ts-eslint\";\nimport { Config } from \"./rules/RuleOptions\";\nimport slonikPlugin from \"./plugin\";\n\nexport default {\n configs: {\n /**\n * If you prefer configuring via a config file (slonik.config.ts), use this config.\n */\n useConfigFile: {\n plugins: {\n slonik: slonikPlugin,\n },\n rules: {\n \"slonik/check-sql\": [\"error\", { useConfigFile: true }],\n },\n } satisfies FlatConfig.Config,\n\n /**\n * If you prefer configuring via a flat config, use this config.\n */\n connections: (connections: Config[\"connections\"]): FlatConfig.Config => ({\n plugins: {\n slonik: slonikPlugin,\n },\n rules: {\n \"slonik/check-sql\": [\"error\", { connections }],\n },\n }),\n },\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAIA,qBAAe;AAAA,EACb,KAAA;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,sBAAA;AAAA,IACN;AAAA;AAEJ,CAAA;;ACNA,eAAe;AAAA,EACb,OAAA,EAAS;AAAA;AAAA;AAAA;AAAA,IAIP,aAAA,EAAe;AAAA,MACb,OAAA,EAAS;AAAA,QACP,MAAA,EAAQ;AAAA,OACV;AAAA,MACA,KAAA,EAAO;AAAA,QACL,oBAAoB,CAAC,OAAA,EAAS,EAAE,aAAA,EAAe,MAAM;AAAA;AACvD,KACF;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA,EAAa,CAAC,WAAA,MAA2D;AAAA,MACvE,OAAA,EAAS;AAAA,QACP,MAAA,EAAQ;AAAA,OACV;AAAA,MACA,KAAA,EAAO;AAAA,QACL,kBAAA,EAAoB,CAAC,OAAA,EAAS,EAAE,aAAa;AAAA;AAC/C,KACF;AAAA;AAEJ,CAAA;;;;"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./shared/eslint-plugin-slonik.BxexVlk1.cjs');
|
|
4
|
+
require('./shared/eslint-plugin-slonik.rlOTrCdf.cjs');
|
|
5
|
+
require('path');
|
|
6
|
+
require('postgres');
|
|
7
|
+
require('crypto');
|
|
8
|
+
require('fs');
|
|
9
|
+
require('ts-pattern');
|
|
10
|
+
require('@typescript-eslint/utils');
|
|
11
|
+
require('fp-ts/lib/Either.js');
|
|
12
|
+
require('fp-ts/lib/function.js');
|
|
13
|
+
require('fp-ts/lib/Option.js');
|
|
14
|
+
require('fp-ts/lib/TaskEither.js');
|
|
15
|
+
require('fp-ts/lib/Json.js');
|
|
16
|
+
require('pg-connection-string');
|
|
17
|
+
require('typescript');
|
|
18
|
+
require('synckit');
|
|
19
|
+
require('node:url');
|
|
20
|
+
require('zod');
|
|
21
|
+
require('module');
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
exports.defineConfig = index.defineConfig;
|
|
26
|
+
exports.rules = index.rules;
|
|
27
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|