(self, deps: NpmDeps)
Adds global environments to eslintrc
Adds global environments to eslintrc
Adds global environments to eslintrc
def __add_globals(self, deps: NpmDeps) -> None:
        """Adds global environments to eslintrc"""
        node_globals = [
            g for g in self.POSSIBLE_GLOBALS if g in deps
        ] + self.ALWAYS_INCLUDE_GLOBALS
        env_dict = dict((g, True) for g in node_globals)

        with self.eslintrc_path.open() as stream:
            rc = yaml.safe_load(stream)
        rc[RC_ENVIRONMENTS] = env_dict
        with self.eslintrc_path.open("w") as stream:
            yaml.safe_dump(rc, stream)
def __add_globals ( self , deps : NpmDeps ) -> None : node_globals = [ g for g in self . POSSIBLE_GLOBALS if g in deps ] + self . ALWAYS_INCLUDE_GLOBALS env_dict = dict ( ( g , True ) for g in node_globals ) with self . eslintrc_path . open ( ) as stream : rc = yaml . safe_load ( stream ) rc [ RC_ENVIRONMENTS ] = env_dict with self . eslintrc_path . open ( "w" ) as stream : yaml . safe_dump ( rc , stream )