@@ -17,16 +17,24 @@ Check out [@ts-safeql-demos/basic-flat-config](https://github.com/ts-safeql/safe
1717
1818``` js
1919// eslint.config.js
20-
21- export default [
22- // ...
20+ import tseslint from " typescript-eslint" ;
21+ import safeql from " @ts-safeql/eslint-plugin/config" ;
22+
23+ export default tseslint .config (
24+ {
25+ languageOptions: {
26+ parserOptions: {
27+ projectService: true ,
28+ },
29+ },
30+ },
2331 safeql .configs .connections ({
2432 // The URL of the database:
2533 databaseUrl: " postgres://postgres:postgres@localhost:5432/my_database" ,
2634 // Check all of the queries that are used with the `sql` tag:
2735 targets: [{ tag: " sql" }],
28- }),
29- ] ;
36+ })
37+ ) ;
3038```
3139
3240== Legacy Config
@@ -87,9 +95,17 @@ Check out [@ts-safeql-demos/multi-connections](https://github.com/ts-safeql/safe
8795
8896` ` ` js
8997// eslint.config.js
90-
91- export default [
92- // ...
98+ import tseslint from "typescript-eslint";
99+ import safeql from "@ts-safeql/eslint-plugin/config";
100+
101+ export default tseslint.config(
102+ {
103+ languageOptions: {
104+ parserOptions: {
105+ projectService: true,
106+ },
107+ },
108+ },
93109 safeql.configs.connections({
94110 connections: [
95111 {
@@ -109,8 +125,8 @@ export default [
109125 ],
110126 },
111127 ],
112- }),
113- ] ;
128+ })
129+ ) ;
114130` ` `
115131
116132== Legacy Config
@@ -165,9 +181,17 @@ Check out [@ts-safeql-demos/basic-migrations-raw](https://github.com/ts-safeql/s
165181
166182` ` ` js
167183// eslint.config.js
168-
169- export default [
170- // ...
184+ import tseslint from "typescript-eslint";
185+ import safeql from "@ts-safeql/eslint-plugin/config";
186+
187+ export default tseslint.config(
188+ {
189+ languageOptions: {
190+ parserOptions: {
191+ projectService: true,
192+ },
193+ },
194+ },
171195 safeql.configs.connections({
172196 connections: [
173197 {
@@ -180,8 +204,8 @@ export default [
180204 // "connectionUrl": "postgres://pguser:password@localhost:5432/postgres"
181205 },
182206 ],
183- }),
184- ] ;
207+ })
208+ ) ;
185209` ` `
186210
187211== Legacy Config
@@ -250,9 +274,17 @@ Check out [@ts-safeql-demos/multi-connections](https://github.com/ts-safeql/safe
250274
251275` ` ` js
252276// eslint.config.js
253-
254- export default [
255- // ...
277+ import tseslint from "typescript-eslint";
278+ import safeql from "@ts-safeql/eslint-plugin/config";
279+
280+ export default tseslint.config(
281+ {
282+ languageOptions: {
283+ parserOptions: {
284+ projectService: true,
285+ },
286+ },
287+ },
256288 safeql.configs.connections({
257289 connections: [
258290 {
@@ -270,8 +302,8 @@ export default [
270302 ],
271303 },
272304 ],
273- }),
274- ] ;
305+ })
306+ ) ;
275307` ` `
276308
277309== Legacy Config
@@ -316,9 +348,17 @@ export default [
316348
317349` ` ` js
318350// eslint.config.js
319-
320- export default [
321- // ...
351+ import tseslint from "typescript-eslint";
352+ import safeql from "@ts-safeql/eslint-plugin/config";
353+
354+ export default tseslint.config(
355+ {
356+ languageOptions: {
357+ parserOptions: {
358+ projectService: true,
359+ },
360+ },
361+ },
322362 safeql.configs.connections({
323363 connections: [
324364 {
@@ -343,8 +383,8 @@ export default [
343383 ],
344384 },
345385 ],
346- }),
347- ] ;
386+ })
387+ ) ;
348388` ` `
349389
350390== Legacy Config
@@ -399,9 +439,17 @@ SafeQL uses [minimatch](https://github.com/isaacs/minimatch) to match the glob p
399439
400440` ` ` js
401441// eslint.config.js
402-
403- export default [
404- // ...
442+ import tseslint from "typescript-eslint";
443+ import safeql from "@ts-safeql/eslint-plugin/config";
444+
445+ export default tseslint.config(
446+ {
447+ languageOptions: {
448+ parserOptions: {
449+ projectService: true,
450+ },
451+ },
452+ },
405453 safeql.configs.connections({
406454 // The URL of the database:
407455 databaseUrl: "postgres://postgres:postgres@localhost:5432/my_database",
@@ -410,8 +458,8 @@ export default [
410458 // either ` db .$queryRaw ` or ` db .$executeRaw ` // [!code focus]
411459 { tag: "db.+($queryRaw|$executeRaw)" }, // [!code focus]
412460 ],
413- }),
414- ] ;
461+ })
462+ ) ;
415463` ` `
416464
417465== Legacy Config
@@ -453,9 +501,17 @@ SafeQL can also use regex to match the sql tags.
453501
454502` ` ` js
455503// eslint.config.js
456-
457- export default [
458- // ...
504+ import tseslint from "typescript-eslint";
505+ import safeql from "@ts-safeql/eslint-plugin/config";
506+
507+ export default tseslint.config(
508+ {
509+ languageOptions: {
510+ parserOptions: {
511+ projectService: true,
512+ },
513+ },
514+ },
459515 safeql.configs.connections({
460516 // The URL of the database:
461517 databaseUrl: "postgres://postgres:postgres@localhost:5432/my_database",
@@ -464,8 +520,8 @@ export default [
464520 // either ` db .$queryRaw ` or ` db .$executeRaw ` // [!code focus]
465521 { tag: { regex: 'db\. ($queryRaw|$executeRaw)' } }, // [!code focus]
466522 ],
467- }),
468- ] ;
523+ })
524+ ) ;
469525` ` `
470526
471527== Legacy Config
@@ -519,9 +575,17 @@ function getName() {
519575
520576` ` ` js
521577// eslint.config.js
522-
523- export default [
524- // ...
578+ import tseslint from " typescript-eslint" ;
579+ import safeql from " @ts-safeql/eslint-plugin/config" ;
580+
581+ export default tseslint .config (
582+ {
583+ languageOptions: {
584+ parserOptions: {
585+ projectService: true ,
586+ },
587+ },
588+ },
525589 safeql .configs .connections ({
526590 connections: [
527591 {
@@ -532,8 +596,8 @@ export default [
532596 ],
533597 },
534598 ],
535- }),
536- ] ;
599+ })
600+ ) ;
537601` ` `
538602
539603== Legacy Config
0 commit comments