Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

type declarations should have distinct AST from vars #414

Closed
JamesHenry opened this issue Dec 13, 2017 · 3 comments · Fixed by #596
Closed

type declarations should have distinct AST from vars #414

JamesHenry opened this issue Dec 13, 2017 · 3 comments · Fixed by #596

Comments

@JamesHenry
Copy link
Member

  • We currently generate a "special" variable declaration for a type declaration.
  • This was done to allow core rules such as semi to work with type declarations out of the box.
  • However, other core rules (and plugin rules) have issues with this

It leads to issues such as #350 #359

We should come up with a distinct AST for type declarations and figure out how to make semi work in some other way.

@IanEdington
Copy link

IanEdington commented Feb 7, 2018

This is throwing no-restricted-globals on line 6 for name: sting;

import * as React from 'react';

import { Name } from './styled';

export interface propTypes {
  name: string;
}

export default class SomeClass extends React.PureComponent<propTypes> {
  render() {
    const { name } = this.props;

    return <Name>{name}</Name>;
  }
}

Is this what this issue is talking about?

@majelbstoat
Copy link

export default class MyComponent extends React.Component<Props, State> {
  open = () => {
    console.log('something')
  }
}

This is also throwing no-restricted-globals for open.

@billyvg
Copy link

billyvg commented Jun 9, 2018

Is this related to the following throwing no-eval errors?

export type Spec = {
    eval?: string;
};

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.