Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Airbnb ESLint Issues in no-undef and no-unused-expressions #54

Open
akshayarise opened this issue Oct 14, 2016 · 2 comments
Open

Airbnb ESLint Issues in no-undef and no-unused-expressions #54

akshayarise opened this issue Oct 14, 2016 · 2 comments
Labels

Comments

@akshayarise
Copy link

I am unable to resolve the below issues , please help :-
1.) no-undef ('describe' is not defined.)
no-undef ('it' is not defined.)
link is here :- http://eslint.org/docs/rules/no-undef
issue coming in this code :-

describe('sendgrid request is executed', () => {
  it(' its response should have executed successfully ', (done) => {
    models.college.school(
      'tUfzJg7U', {
        abhs: {
          college: 'xyz@rediffmail.com',
        },        
      },
      (err, body, response) => {
        expect(response.statusCode).to.equal(202);
        expect(response.statusMessage).to.equal('Accepted');
        expect('body').to.exist;
        done();
      });
  });
});

2.) no-unused-expressions (Expected an assignment or function call and instead saw an expression)
link is here:- http://eslint.org/docs/rules/no-unused-expressions
issue coming in the below code at line having

expect('body').to.exist;

describe('sendgrid request is executed', () => {
  it(' its response should have executed successfully ', (done) => {
    models.college.school(
      'b7U', {
        from: {
          school: 'abcd@gmail.com',
        },
       },
      (err, body, response) => {
        expect(response.statusCode).to.equal(202);
        expect(response.statusMessage).to.equal('Accepted');
        expect('body').to.exist;
        done();
      });
  });
});
@akshayarise akshayarise changed the title Airbnb ESLint Issues Airbnb ESLint Issues in no-undef and no-unused-expressions Oct 18, 2016
@gaurav21r
Copy link
Member

@akshaykumardell12345 Thanks for the bug reports.

For the first point, @riteshe63 Please add another eslintconfig within the \test folder with the mocha environment turned on in the testing generator. http://eslint.org/docs/user-guide/configuring#specifying-environments

For the second point @divya3103 Please note I think there is a possible difference of opinion and we will need to raise an issue @ https://github.com/chaijs/chai

@DashmeetArt
Copy link

"no-undef" Issues
1) no-undef ('document' is not defined.)
2) no-undef ('skateDomDiff' is not defined.)

<script>
    document.getElementById('codeView').addEventListener('keyup', () => {
        const oldDom = document.getElementById('html');
        const newDom = document.createElement('div');
        newDom.innerHTML = document.getElementById('codeView').value;
        const instructions = skateDomDiff.diff({
          destination: newDom,
          source: oldDom,
        });
        skateDomDiff.patch(instructions);
    });
  </script>

3) no-undef ('window' is not defined.)

<script>
    window.onload = function defaultValues() {
        document.getElementById('border').style.backgroundColor = 'rgba(0,0,0,0.15)';
        document.getElementById('borderOptions').style.width = '300px';
        document.getElementById('borderOptions').style.visibility = 'visible';
    };
</script>

4) no-undef ('Polymer' is not defined.)

<script>
        Polymer({
          is: 'demo',
          properties: {
</script>

"no-unused-expressions" Issues

1) no-unused-expressions (Expected an assignment or function call and instead saw and expression.)

screen shot 2016-10-27 at 3 58 45 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants