"No ESLint configuration found" error

alecxe picture alecxe · Jul 3, 2016 · Viewed 72k times · Source

Recently, we've upgraded to ESLint 3.0.0 and started to receive the following message running the grunt eslint task:

> $ grunt eslint
Running "eslint:files" (eslint) task
Warning: No ESLint configuration found. Use --force to continue.

Here is the grunt-eslint configuration:

var lintTargets = [
    "<%= app.src %>/**/*/!(*test|swfobject)+(.js)",
    "test/e2e/**/*/*.js",
    "!test/e2e/db/models/*.js"
];
module.exports.tasks = {
    eslint: {
        files: {
            options: {
                config: 'eslint.json',
                fix: true,
                rulesdir: ['eslint_rules']
            },
            src: lintTargets
        }
    }
};

What should we do to fix the error?

Answer

ankit biswas picture ankit biswas · Mar 4, 2017

The error you are facing is because your configuration is not present. To configure the eslint type

eslint --init

then configure as your requirement.

then execute the project again.