Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

eslint and airbnb issues #22

Closed
dmitry-saritasa opened this issue Oct 5, 2017 · 10 comments
Closed

eslint and airbnb issues #22

dmitry-saritasa opened this issue Oct 5, 2017 · 10 comments

Comments

@dmitry-saritasa
Copy link

(crm) ➜  backend git:(develop) ✗ npm run start                            

> SaritasaAnalytics@0.0.0 start /home/dmitry/Projects/crm/backend
> npm run clean && LOGGY_STACKS=1 node_modules/.bin/brunch watch --server


> SaritasaAnalytics@0.0.0 clean /home/dmitry/Projects/crm/backend
> rm -rf .frontend/

18:27:52 - info: application started on http://localhost:3333/
18:27:52 - info: compiling
18:27:55 - error: Linting of frontend/js/config.js failed. Error: /home/dmitry/Projects/crm/backend/node_modules/eslint-config-airbnb-base/rules/es6.js:
   	Configuration for rule "prefer-destructuring" is invalid:
   	Value "data["0"].VariableDeclarator" has additional properties.
   	Value "data["0"].AssignmentExpression" has additional properties.
   
   Referenced from: airbnb-base
   Referenced from: /home/dmitry/Projects/crm/backend/.eslintrc.js
	Configuration for rule "prefer-destructuring" is invalid:
	Value "data["0"].VariableDeclarator" has additional properties.
	Value "data["0"].AssignmentExpression" has additional properties.

Referenced from: airbnb-base
Referenced from: /home/dmitry/Projects/crm/backend/.eslintrc.js
    at validateRuleOptions (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-validator.js:109:15)
    at Object.keys.forEach.id (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-validator.js:156:13)
    at Array.forEach (native)
    at Object.validate (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-validator.js:155:35)
    at load (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-file.js:559:19)
    at configExtends.reduceRight.e (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-file.js:424:36)
    at Array.reduceRight (native)
    at applyExtends (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-file.js:408:28)
    at load (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-file.js:566:22)
    at configExtends.reduceRight.e (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-file.js:424:36)
    at Array.reduceRight (native)
    at applyExtends (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-file.js:408:28)
    at Object.load (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-file.js:566:22)
    at loadConfig (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config.js:63:33)
    at getLocalConfig (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config.js:130:29)
    at Config.getConfig (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config.js:260:26)
    at processText (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/cli-engine.js:224:33)
    at CLIEngine.executeOnText (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/cli-engine.js:754:26)
    at ESLinter.lint (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/index.js:15:32)
    at file (/home/dmitry/Projects/crm/backend/node_modules/brunch/lib/utils/plugin-adapter.js:64:17)
 
18:27:55 - error: Linting of frontend/js/index.js failed. Error: /home/dmitry/Projects/crm/backend/node_modules/eslint-config-airbnb-base/rules/es6.js:
   	Configuration for rule "prefer-destructuring" is invalid:
   	Value "data["0"].VariableDeclarator" has additional properties.
   	Value "data["0"].AssignmentExpression" has additional properties.
   
   Referenced from: airbnb-base
   Referenced from: /home/dmitry/Projects/crm/backend/.eslintrc.js
	Configuration for rule "prefer-destructuring" is invalid:
	Value "data["0"].VariableDeclarator" has additional properties.
	Value "data["0"].AssignmentExpression" has additional properties.

Referenced from: airbnb-base
Referenced from: /home/dmitry/Projects/crm/backend/.eslintrc.js
    at validateRuleOptions (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-validator.js:109:15)
    at Object.keys.forEach.id (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-validator.js:156:13)
    at Array.forEach (native)
    at Object.validate (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-validator.js:155:35)
    at load (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-file.js:559:19)
    at configExtends.reduceRight.e (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-file.js:424:36)
    at Array.reduceRight (native)
    at applyExtends (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-file.js:408:28)
    at load (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-file.js:566:22)
    at configExtends.reduceRight.e (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-file.js:424:36)
    at Array.reduceRight (native)
    at applyExtends (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-file.js:408:28)
    at Object.load (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config/config-file.js:566:22)
    at loadConfig (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config.js:63:33)
    at getLocalConfig (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config.js:130:29)
    at Config.getConfig (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/config.js:260:26)
    at processText (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/cli-engine.js:224:33)
    at CLIEngine.executeOnText (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/node_modules/eslint/lib/cli-engine.js:754:26)
    at ESLinter.lint (/home/dmitry/Projects/crm/backend/node_modules/eslint-brunch/index.js:15:32)
    at file (/home/dmitry/Projects/crm/backend/node_modules/brunch/lib/utils/plugin-adapter.js:64:17)

**however **

(crm) ➜  backend git:(develop) ✗ node_modules/.bin/eslint frontend/js/*.js

/home/dmitry/Projects/crm/backend/frontend/js/config.js
  60:7  error  Expected an object to be thrown  no-throw-literal

✖ 1 problem (1 error, 0 warnings)

so from cli it works perfect,

my eslintrc.js

module.exports = {
  "env": {
    "browser": true
  },
  "plugins": [
    "html"
  ],
  "extends": "airbnb-base",
  rules: {
    "comma-dangle": ["error", "never"]
  }
};

package.json

{
  "name": "Test",
  "scripts": {
    "clean": "rm -rf .frontend/",
    "livereload": "livereload templates,public",
    "start": "npm run clean && LOGGY_STACKS=1 node_modules/.bin/brunch watch --server",
    "build": "npm run clean && LOGGY_STACKS=1 brunch build",
    "build_prod": "npm run clean && brunch build --production",
    "test": "npm run clean && brunch b --env test",
    "poststart": "cowsay -f dragon The Build Is Complete! Do not forget to apply migrations!"
  },
  "devDependencies": {
    "auto-reload-brunch": "^2.7.1",
    "babel-brunch": "~6.1",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-preset-airbnb": "^2.4.0",
    "babel-preset-env": "^1.6.0",
    "babel-preset-stage-0": "^6.24.1",
    "blessed": "^0.1.81",
    "brunch": "^2",
    "clean-css-brunch": "^2.10.0",
    "copycat-brunch": "^1.1.0",
    "css-brunch": "^2.10.0",
    "es6-promise": "^4.1.1",
    "eslint": "^4.8.0",
    "eslint-config-airbnb-base": "^12.0.1",
    "eslint-plugin-html": "^3.2.2",
    "eslint-plugin-import": "^2.7.0",
    "handlebars-brunch": "^2.10",
    "hmr-brunch": "^0.1.1",
    "jade-brunch": "^2.8",
    "jasmine-core": "^2.8",
    "javascript-brunch": "^2.10.0",
    "karma-brunch": "^1.0.6",
    "livereload": "^0.6.2",
    "mocha": "^4.0.0",
    "phantomjs-prebuilt": "^2.1.15",
    "sass-brunch": "^2.10",
    "static-handlebars-brunch": "~0.1.5",
    "uglify-js-brunch": "^2.10.0",
    "vue-brunch": "^2.0.1"
  },
  "dependencies": {
    "axios": "^0.16.2",
    "alertify.js": "^1.0.12",
    "bootstrap": "~3.3.7",
    "bootstrap-table": "~1.11.2",
    "bootstrap-datepicker": "^1.7.1",
    "bootstrap-select": "^1.12.4",
    "font-awesome": "^4.7.0",
    "handlebars": "^4.0.10",
    "jquery": "^3.2.1",
    "jquery-mockjax": "^2.2.2",
    "jquery-validation": "^1.17.0",
    "jquerypp": "^2.0.2",
    "js-cookie": "~2.1.4",
    "store": "^2.0.12",
    "lodash": "^4.17.4",
    "string": "^3.3.3",
    "underscore": "~1.8.3",
    "vue": "^2.4.4",
    "vue-router": "^2.7.0",
    "vuex": "^2.4.1"
  }
}

@signal-intrusion
Copy link

@dmitry-saritasa install with the latest commit SHA. ex yarn add eslint-brunch#9ad806405804a86d9373e6c0421903a9c5c88c22

It would be great if the authors would simply gut a new tag 3.13.0 and this wouldn't be an issue.

@sakkelaaksonen
Copy link

What was the issue here? Same error message pops up in another project.

@signal-intrusion
Copy link

signal-intrusion commented Oct 18, 2017

@sakkelaaksonen the issue is that eslint had some incompatibilities with a previous version of this project. The maintainers have fixed the issue, but have not created a release tag in ages. So when you npm install or yarn install you get the broken lib.

You can get the fixes by installing the latest commit SHA.

@signal-intrusion
Copy link

Could the maintainers please do us a solid and create a new PATCH release? Thanks.

@Pfurr
Copy link

Pfurr commented Jan 4, 2018

i have same issues, can you helm me? my terminal return:

/../node_modules/eslint-config-airbnb-base/rules/es6.js: Configuration for rule "prefer-destructuring" is invalid: Value "data["0"].VariableDeclarator" has additional properties. Value "data["0"].AssignmentExpression" has additional properties. Referenced from: /../eslint-config-airbnb-base/index.js Referenced from: airbnb Referenced from: / /../APP_MOBILE_DEV/Ristorante_JBosse/.eslintrc

@RaphaelMechali
Copy link

Same problem here (except the message comes from VS Code).
Eslint version: 4.15.0

@vladavip88
Copy link

vladavip88 commented Mar 6, 2018

Use this, I changed from error to warn, just in case:

"prefer-destructuring": [  "warn",
	{
    "VariableDeclarator": {
      "array": false,
      "object": true
    },
    "AssignmentExpression": {
      "array": true,
      "object": true
    }
  },
  {
    "enforceForRenamedProperties": false
  }
]

@Dujota
Copy link

Dujota commented Jun 12, 2018

is there an actual solution for this? im having the same issue:

have tried almost every single suggestion out there. I am on VSCode using Yarn and I am using htis eslintrc file : https://github.com/wesbos/dotfiles/blob/master/.eslintrc

[Error - 15:51:46] /Users/denisdujota/node_modules/eslint-config-airbnb-base/rules/es6.js: Configuration for rule "prefer-destructuring" is invalid: Value "data["0"].VariableDeclarator" has additional properties. Value "data["0"].AssignmentExpression" has additional properties. Referenced from: /Users/denisdujota/node_modules/eslint-config-airbnb-base/index.js Referenced from: airbnb Referenced from: /Users/denisdujota/.eslintrc

@seriva
Copy link

seriva commented Jan 29, 2019

Same issue here none of the workarounds proposed work. Only workaround I found so far is to use an older version of eslint-config-airbnb-base package (11.3.2). A proper fix would be appreciated.

@shvaikalesh
Copy link
Contributor

Resolved by #23.

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

No branches or pull requests

9 participants