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 guard-for-in and no-restricted-syntax #53

Open
akshayarise opened this issue Oct 11, 2016 · 1 comment
Open
Assignees
Labels

Comments

@akshayarise
Copy link

I am unable to resolve the below issues , please help :-
1.) guard-for-in (The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.)
link is here http://eslint.org/docs/rules/guard-for-in
issue coming in this code :-

for (const modelName in models) {
    loopbackModels[modelName] = loopback.createDataSource({
    connector: loopbackConnectorRest,
      options: {
       followRedirect: false,
      },
      operations: models[modelName].firstOperation,
    });
  }

2.) no-restricted-syntax (Using 'ForInStatement' is not allowed.)
link is here http://eslint.org/docs/rules/no-restricted-syntax
issue coming in this code:-

for (const pathVariable in swaggerDoc.paths) {
    for (const httpMethod in swaggerDoc.paths[pathVariable]) {for (const pathVariable in swaggerDoc.paths) {
    for (const httpMethod in swaggerDoc.paths[pathVariable]) {
      if (httpMethod !== 'parameters') {
        const operation = {};
        operation.template = {};
        operation.template.query = {};
        operation.functions = {};
        operation.template.url =
          ${swaggerDoc.schemes[0]}://${swaggerDoc.host}${swaggerDoc.basePath}${pathVariable}`;
        operation.template.method = httpMethod;
      if (httpMethod !== 'parameters') {
        const operation = {};
        operation.template = {};
        operation.template.query = {};
        operation.functions = {};
        operation.template.url =
          `${swaggerDoc.schemes[0]}://${swaggerDoc.host}${swaggerDoc.basePath}${pathVariable}`;
        operation.template.method = httpMethod;
@gaurav21r gaurav21r self-assigned this Oct 11, 2016
@akshayarise akshayarise changed the title Airbnb ESLint Issues Airbnb ESLint Issues in guard-for-in and no-restricted-syntax Oct 18, 2016
@gaurav21r
Copy link
Member

@akshaykumardell12345 Thanks! I'll need to open an issue at https://github.com/airbnb/javascript/

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

2 participants