tlvince / eslint-plugin-jasmine

ESLint rules for Jasmine
https://www.npmjs.com/package/eslint-plugin-jasmine
MIT License
95 stars 58 forks source link

new-line-before-expect doesn't allow multiline expects. #354

Open C0DK opened 2 years ago

C0DK commented 2 years ago

Describe the bug new-line-before-expect doesn't see preceding expect if it's in a multiple case.

i.e this fails (on the last line):

    expect("foo").toEqual("foo");
    expect("foo").toEqual(
      "foo"
    );
    expect("foo").toEqual("foo");

This does not

    expect("foo").toEqual("foo");
    expect("foo").toEqual("foo");
    expect("foo").toEqual("foo");

To Reproduce

Steps to reproduce the behaviour

describe('the bug', () => {
  it('happens', () => {
    expect('foo').toEqual('foo');
    expect('foo').toEqual('foo');
    expect('foo').toEqual('foo');
  });
});

Expected behaviour

That it wouldn't fail

Context

ChrisMBarr commented 1 year ago

This might be related, but I have some code where I expected errors in a few place but I only get one error unless I put a line between then.

image

image