Coder Social home page Coder Social logo

Comments (12)

buzinas avatar buzinas commented on June 16, 2024 1

I could simulate the error now. I'll fix it, thanks!

from tslint-eslint-rules.

buzinas avatar buzinas commented on June 16, 2024

Hey there, thanks for reporting it!

The string was incorrect, you're right, and there was already an issue reporting that. I've just fixed it.

Although, I couldn't simulate your error, in fact I've created a test putting your entire code there (9da7ba8) and it passes with no false positives. Can you please investigate further?

from tslint-eslint-rules.

RomkeVdMeulen avatar RomkeVdMeulen commented on June 16, 2024

It's really strange, but I'm still getting the same error after updating to the latest version of the rule. Maybe some kind of parse error? Here's the complete source:

[gulp-tslint] error (no-ex-assign) bootstrap.ts[23, 22]: do not assign to the exception parameter.
import {Aurelia} from "aurelia-framework";
import {bootstrap} from "aurelia-bootstrapper";
import {TemplateRegistryEntry, Loader} from "aurelia-loader";
import {TextTemplateLoader} from "aurelia-loader-default";

declare var frontendConfig: { translate: string, debug: boolean };

(<any>TextTemplateLoader).prototype.standardLoadTemplate = TextTemplateLoader.prototype.loadTemplate;
TextTemplateLoader.prototype.loadTemplate = function(loader: Loader, entry: TemplateRegistryEntry): Promise<any> {
    entry.address += "?translate=" + frontendConfig.language;
    return (<any>this).standardLoadTemplate(loader, entry);
};

export function bootstrapComponents(): void {
    "use strict";

    let paths: string[] = [];
    for (let i = 0; i < arguments.length; i++) {
        let component: string = arguments[i];
        paths.push("frontend/components/" + component + "/" + component);
    }

    bootstrap((aurelia: Aurelia) => { // line 23
        aurelia.use
            .defaultBindingLanguage()
            .defaultResources()
            .developmentLogging()
            .globalResources(paths);

        aurelia.start().then(()  => aurelia.enhance({}, document.body));
    });
}

from tslint-eslint-rules.

buzinas avatar buzinas commented on June 16, 2024

@nfriend

from tslint-eslint-rules.

Hufschmidt avatar Hufschmidt commented on June 16, 2024

The following code also throws no-ex-assign on line 3 col 2

import {Component} from '@angular/core';

@Component({

})
export class App {
}

with tslint 3.11 and tslint-eslint-rules 1.3.0

from tslint-eslint-rules.

Hufschmidt avatar Hufschmidt commented on June 16, 2024

See PR, tested with all linked examples. Still triggering for actuall exception assignments, eg.

import {Component} from '@angular/core';

@Component({
})
export class MyApp {
  public hi() {
    try {
      console.log('Hello World');
    }
    catch (e) {
      // Hi
      let z = 'xxxx';
      e = 2;
      let x = e;
      z.toString();
      z = 'gfdg';
      console.log('Done!', x, z);
      console.log(e);
    }
  }
}

Throws: src/app.ts[18, 11]: do not assign to the exception parameter.

from tslint-eslint-rules.

buzinas avatar buzinas commented on June 16, 2024

@Hufschmidt Unfortunately, the linting is not passing for the submitted PR.

from tslint-eslint-rules.

buzinas avatar buzinas commented on June 16, 2024

@Zelein

from tslint-eslint-rules.

nickzelei avatar nickzelei commented on June 16, 2024

Oh, thanks @buzinas I didn't realize this was here. Thanks for closing my issue.

from tslint-eslint-rules.

buzinas avatar buzinas commented on June 16, 2024

@Hufschmidt if you don't mind, I'll copy the ideas provided from your PR and submit one myself, so we can merge this.

from tslint-eslint-rules.

Hufschmidt avatar Hufschmidt commented on June 16, 2024

Sure, go ahead. :)

from tslint-eslint-rules.

buzinas avatar buzinas commented on June 16, 2024

@Hufschmidt ty, just did it, the fix was released in v1.6.0

from tslint-eslint-rules.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.