Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Overriding default rules #297

@0ubbe

Description

@0ubbe

Summary

Hi 👋🏻 ,

I'm using dstlint to help type an existing library, next-auth, that runs on top of NextJS:

nextauthjs/next-auth#220

The library depends on a few types from NextJS...

import type { NextApiRequest, NextApiResponse } from 'next';
// ...
function NextAuth(req: NextApiRequest, res: NextApiResponse, options?: InitOptions): Promise<void>;

When running dtslint, it tries to parse the types from NextJS and throws an error given there's a // ts-ignore comment somewhere on them:

$ npx dtslint types
Error: At /Users/lluis.agusti/Code/next-auth/node_modules/next/types/index.d.ts:{"line":14,"character":6}: 'ts-ignore' is forbidden.
    at /Users/lluis.agusti/Code/next-auth/node_modules/dtslint/bin/index.js:198:19
    at Generator.next (<anonymous>)
    at fulfilled (/Users/lluis.agusti/Code/next-auth/node_modules/dtslint/bin/index.js:6:58) 

Following the docs, I tried to override that linting rule by writing my own tslint.json but it didn't make the error go away ( maybe it only applies to our declaration files? )

Any chance we could get some help on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions