JavaScript for WordPress Forums Vanilla JavaScript 1.7.14.9 – ERROR LINTING WITH GULP Reply To: 1.7.14.9 – ERROR LINTING WITH GULP

#25895
Jonathan
Participant

Hi Zac! 🙂 Greetings from Venezuela (though I’m currently living in Chile).

I’m sorry; I’m kinda sleepy, this is the problem I’m having, take a look! It’s kinda working, but not as it’s supposed to?

Following the video completely, I installed the gulp-eslint package and followed all directions.

If I modify an Js file while gulp is running, it throws this error:


[11:45:05] Starting 'bundlejs'...
/Users/Mistwalker/Desktop/gurupu/node_modules/eslint/lib/config.js:170
            throw noConfigError;
            ^

Error: No ESLint configuration found.
    at getLocalConfig (/Users/Mistwalker/Desktop/gurupu/node_modules/eslint/lib/config.js:162:35)
    at Config.getConfig (/Users/Mistwalker/Desktop/gurupu/node_modules/eslint/lib/config.js:260:26)
    at processText (/Users/Mistwalker/Desktop/gurupu/node_modules/eslint/lib/cli-engine.js:224:33)
    at CLIEngine.executeOnText (/Users/Mistwalker/Desktop/gurupu/node_modules/eslint/lib/cli-engine.js:754:26)
    at verify (/Users/Mistwalker/Desktop/gurupu/node_modules/gulp-eslint/index.js:20:25)
    at Transform._transform (/Users/Mistwalker/Desktop/gurupu/node_modules/gulp-eslint/index.js:70:17)
    at Transform._read (_stream_transform.js:167:10)
    at Transform._write (_stream_transform.js:155:12)
    at doWrite (_stream_writable.js:300:12)
    at writeOrBuffer (_stream_writable.js:286:5)

I haven’t touched anything but adding another number in the console log @ app.js:23


console.log( 'Testing 1,2,3,4' );

But whenever I add this code to the package.json


  "eslintConfig": {
    "eslintConfig": {
      "env": {
        "no-unused-vars": ["error", { "vars": "all" }]
      }
    }
  },

And add another number to app.js:23


console.log( 'Testing 1,2,3,4,5' );

It works.

In other words, without the eslintConfig part, the eslint won’t work with my project! Shouldn’t it be working without that snippet?