Setting up SafeQL for Prisma
I need help in setting up SafeQL for Prisma. I can't correctly configure my
When I run
eslint.configeslint.config and tsconfigtsconfig. This is my eslint.config.mjseslint.config.mjs right now:import tseslint from 'typescript-eslint';
import safeql from '@ts-safeql/eslint-plugin/config';
/** @type {import('eslint').Linter.Config} */
export default tseslint.config({
plugins: {
'@ts-safeql/eslint-plugin': safeql,
},
rules: {
'@ts-safeql/eslint-plugin': [
'error',
{
connections: [
{
// The migrations path:
migrationsDir: './prisma/migrations',
targets: [
// This makes `prisma.$queryRaw` and `prisma.$executeRaw` commands linted
{ tag: 'prisma.+($queryRaw|$executeRaw)', transform: '{type}[]' },
],
},
],
},
],
},
});import tseslint from 'typescript-eslint';
import safeql from '@ts-safeql/eslint-plugin/config';
/** @type {import('eslint').Linter.Config} */
export default tseslint.config({
plugins: {
'@ts-safeql/eslint-plugin': safeql,
},
rules: {
'@ts-safeql/eslint-plugin': [
'error',
{
connections: [
{
// The migrations path:
migrationsDir: './prisma/migrations',
targets: [
// This makes `prisma.$queryRaw` and `prisma.$executeRaw` commands linted
{ tag: 'prisma.+($queryRaw|$executeRaw)', transform: '{type}[]' },
],
},
],
},
],
},
});When I run
npx eslint .npx eslint . I get the following:Oops! Something went wrong! :(
ESLint: 9.4.0
TypeError: Key "rules": Key "@ts-safeql/eslint": Could not find plugin "@ts-safeql".Oops! Something went wrong! :(
ESLint: 9.4.0
TypeError: Key "rules": Key "@ts-safeql/eslint": Could not find plugin "@ts-safeql".