eslint / typescript-eslint-parser

An ESLint custom parser which leverages TypeScript ESTree to allow for ESLint to lint TypeScript source code.
Other
915 stars 92 forks source link

no-namespace: allow global augmentation #477

Closed IlyaSemenov closed 6 years ago

IlyaSemenov commented 6 years ago

What version of TypeScript are you using? 2.8.3

What version of typescript-eslint-parser are you using? 15.0.0

What code were you trying to parse?

index.d.ts:

declare global {
    interface Process {
        client: boolean
        server: boolean
    }
}

or

declare namespace NodeJS {
    interface Process {
        client: boolean
        server: boolean
    }
}

with:

rules: {
    'typescript/no-namespace': 'error',
},

What did you expect to happen? No errors.

What happened? error ES2015 module syntax is preferred over custom TypeScript modules and namespaces typescript/no-namespace

There was a similar issue in tslint - https://github.com/palantir/tslint/issues/3157 - and it was fixed.

JamesHenry commented 6 years ago

Thanks @IlyaSemenov, issues related to custom rules in the plugin should be reported there: https://github.com/nzakas/eslint-plugin-typescript

The rule will need to be updated.