question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could we have this feature?

Angular’s test files end in .spec.ts

I want to use let in those files, as it is common practice to do so

A typical test looks like:

describe('CloseButtonComponent', () => {
    let component: CloseButtonComponent;
    let fixture: ComponentFixture<CloseButtonComponent>;

    beforeEach(async(() => {
        TestBed.configureTestingModule({
            declarations: [CloseButtonComponent],
            providers: [
                {
                    provide: Store,
                    useValue: {
                        select: () => Observable.empty(),
                    },
                },
            ],
        }).compileComponents();
    }));

    beforeEach(() => {
        fixture = TestBed.createComponent(CloseButtonComponent);
        component = fixture.componentInstance;
        fixture.detectChanges();
    });

    it('should create', () => {
        expect(component).toBeTruthy();
    });
});

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jonaskellocommented, Nov 9, 2018

There might be another solution too. IIRC the tslint CLI command will look upwards in the directory hierarchy for tslint.json for every file it lints. So if you have your .spec.ts in a test directory you can put a separate tslint.json in that directory. Then tslint will use it for the test directory, while you can have anohter tslint.json at the root level for everything else. That way you only have to run tslint once but can still have different set of rules for the test directory.

1reaction
dolanmiucommented, Nov 8, 2018

I want linting for the .spec.ts files, I just want to disable no-let for .spec.ts files

Read more comments on GitHub >

github_iconTop Results From Across the Web

ignore-suffix - IBM
Specifies the suffix distinguished name (DN) that you want to be ignored. Repeat this stanza entry for each suffix you want to be...
Read more >
Prefix, Suffix and Derived words for ignore - NiftyWord
Suffixes of ignore · ignored. Word Popularity Bar. 5/5. « ignored. adjective satellite disregarded neglected; unheeded. · ignores. 4/5. « ignore. verb refuse...
Read more >
Spring Boot 2.2.6 - MVC | How to ignore suffix and prefix ...
I suppose you can use redirect, to go to desired url without prefixes.
Read more >
How to read a file ignore its suffix - UiPath Community Forum
How to read a file ignore its suffix · Help Studio · excel, activities · learningRPA (Huohuo) August 12, 2020, 3:48am #1. Hi...
Read more >
A way to ignore prefix/suffix in module ID, then resolve the ...
Search Terms wildcard module declarations ignore prefix suffix relative path Suggestion import url, { other, exported, values } from 'css:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found