Eslint Setup?
I added a eslint config file which looks like this to my t3 project:
But right now I am getting following error and I don't know why.
{
"env": {
"browser": true,
"es2021": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"next",
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"quotes": [2, "single", { "avoidEscape": true }],
"semicolon": 0
}
}
{
"env": {
"browser": true,
"es2021": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"next",
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"quotes": [2, "single", { "avoidEscape": true }],
"semicolon": 0
}
}
SyntaxError: Error while loading rule '@next/next/no-html-link-for-pages': Invalid regular expression: /^/invoices/[id|/$/: Unterminated character class
Occurred while linting /Users/utdev/code/invoicer.so/src/server/trpc/router/index.ts
SyntaxError: Error while loading rule '@next/next/no-html-link-for-pages': Invalid regular expression: /^/invoices/[id|/$/: Unterminated character class
Occurred while linting /Users/utdev/code/invoicer.so/src/server/trpc/router/index.ts
1 Reply
the
router/index.ts
file looks like this, nothing special
import { t } from '../trpc'
import { clientRouter } from './client'
import { fileRouter } from './file'
import { invoiceRouter } from './invoice'
import { authRouter } from './auth'
export const appRouter = t.router({
client: clientRouter,
invoice: invoiceRouter,
file: fileRouter,
auth: authRouter,
})
// export type definition of API
export type AppRouter = typeof appRouter
import { t } from '../trpc'
import { clientRouter } from './client'
import { fileRouter } from './file'
import { invoiceRouter } from './invoice'
import { authRouter } from './auth'
export const appRouter = t.router({
client: clientRouter,
invoice: invoiceRouter,
file: fileRouter,
auth: authRouter,
})
// export type definition of API
export type AppRouter = typeof appRouter