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.

Error when using ESLint Airbnb config

See original GitHub issue

Version

3.5.5

Environment info

Environment Info:

  System:
    OS: Windows 7
    CPU: (4) x64 Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
  Binaries:
    Node: 11.14.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 6.7.0 - C:\Program Files\nodejs\npm.CMD
  npmGlobalPackages:
    @vue/cli: Not Found
  

Steps to reproduce

  1. Run in command line: vue create vue-test
  2. Manually select features
  3. Make sure “Linter / Formatter” is selected
  4. Pick “ESLint Airbnb config”
  5. “Lint on save”
  6. Select to place config “In dedicated config files”
  7. Do not save preset for future use

What is expected?

Project will be created without errors.

What is actually happening?

 ERROR  TypeError: (0 , _ignore.getFileExtensions) is not a function
Occurred while linting d:\temp\vue-test\src\App.vue:9
TypeError: (0 , _ignore.getFileExtensions) is not a function
Occurred while linting d:\temp\vue-test\src\App.vue:9
    at checkSourceValue (d:\temp\vue-test\node_modules\eslint-plugin-import\lib\
rules\no-useless-path-segments.js:103:60)
    at checkSourceValue (d:\temp\vue-test\node_modules\eslint-module-utils\modul
eVisitor.js:29:5)
    at checkSource (d:\temp\vue-test\node_modules\eslint-module-utils\moduleVisi
tor.js:34:5)
    at listeners.(anonymous function).forEach.listener (d:\temp\vue-test\node_mo
dules\eslint\lib\util\safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (d:\temp\vue-test\node_modules\eslint\lib\util\safe-emitter.j
s:45:38)
    at NodeEventGenerator.applySelector (d:\temp\vue-test\node_modules\eslint\li
b\util\node-event-generator.js:251:26)
    at NodeEventGenerator.applySelectors (d:\temp\vue-test\node_modules\eslint\l
ib\util\node-event-generator.js:280:22)
    at NodeEventGenerator.enterNode (d:\temp\vue-test\node_modules\eslint\lib\ut
il\node-event-generator.js:294:14)
    at CodePathAnalyzer.enterNode (d:\temp\vue-test\node_modules\eslint\lib\code
-path-analysis\code-path-analyzer.js:632:23)

Using “ESLint with error prevention only” or “ESLint Standard config” works correctly without errors. Earlier vue-cli versions did not have this problem, but I didn’t have time to find exact version where this issue started.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
LinusBorgcommented, Apr 13, 2019

Seems to be an upstream issue in eslint-plugin-import, see https://github.com/benmosher/eslint-plugin-import/issues/1322

I assume a viable workaround would be to disable this plugin’s rule that throws this error for the time being, until the bug has been fixed upstream:

// .eslintrc.js
module.exports = {
  // ...stuff...
  rules: {
+    "import/no-useless-path-segments": "off",
    "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
    "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
  },
  // ..stuff....
};

Maybe the bug affects other rules as well - disable them accordingly.

2reactions
gitpashcommented, Apr 13, 2019

same with macos, setup eslint for the react-project with ./node_modules/.bin/eslint --init TypeError: (0 , _ignore.getFileExtensions) is not a function Occurred while linting /Users/user/Dev/FrontEnd-Dev-projects_fcc/Advanced_Front-End/react-toe/src/app.js:3 at checkSourceValue (/Users/user/Dev/FrontEnd-Dev-projects_fcc/Advanced_Front-End/react-toe/node_modules/eslint-plugin-import/lib/rules/no-useless-path-segments.js:103:60) at checkSourceValue (/Users/user/Dev/FrontEnd-Dev-projects_fcc/Advanced_Front-End/react-toe/node_modules/eslint-module-utils/moduleVisitor.js:29:5) at checkSource (/Users/user/Dev/FrontEnd-Dev-projects_fcc/Advanced_Front-End/react-toe/node_modules/eslint-module-utils/moduleVisitor.js:34:5) at listeners.(anonymous function).forEach.listener (/Users/user/Dev/FrontEnd-Dev-projects_fcc/Advanced_Front-End/react-toe/node_modules/eslint/lib/util/safe-emitter.js:45:58) at Array.forEach (<anonymous>) at Object.emit (/Users/user/Dev/FrontEnd-Dev-projects_fcc/Advanced_Front-End/react-toe/node_modules/eslint/lib/util/safe-emitter.js:45:38) at NodeEventGenerator.applySelector (/Users/user/Dev/FrontEnd-Dev-projects_fcc/Advanced_Front-End/react-toe/node_modules/eslint/lib/util/node-event-generator.js:251:26) at NodeEventGenerator.applySelectors (/Users/user/Dev/FrontEnd-Dev-projects_fcc/Advanced_Front-End/react-toe/node_modules/eslint/lib/util/node-event-generator.js:280:22) at NodeEventGenerator.enterNode (/Users/user/Dev/FrontEnd-Dev-projects_fcc/Advanced_Front-End/react-toe/node_modules/eslint/lib/util/node-event-generator.js:294:14) at CodePathAnalyzer.enterNode (/Users/user/Dev/FrontEnd-Dev-projects_fcc/Advanced_Front-End/react-toe/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:632:23)

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint-config-airbnb error · Issue #465
I've added "extends": "eslint-config-airbnb" to an empty .eslintrc file and when I run eslint app I get the following error.
Read more >
Eslint with airbnb does not load when using .eslint.json
Note that eslint works just fine whenever using .yml or .js files as configuration. How could I solve this error in the json...
Read more >
eslint-config-airbnb
This package provides Airbnb's .eslintrc as an extensible shared config. Usage. We export three ESLint configurations for your usage. eslint- ...
Read more >
eslint-config-airbnb
Fast, reliable, and secure dependency management.
Read more >
eslint-config-airbnb-typescript - npm package
Make sure you have the regular Airbnb config setup. If you are using React, use eslint-config-airbnb, or if you aren't using React, use...
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