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?
There are two primary ways to configure ESLint: Configuration Comments - use JavaScript comments to embed configuration information directly into a file. Configuration Files - use a JavaScript, JSON, or YAML file to specify configuration information for an entire directory and all of its subdirectories.
The ESLint configuration is in the ./node_modules/@spm/eslint-config/index. js file. To check the code for ESLint violations, run the following command in the application root directory. Errors are listed in the console.
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.
Try to swap config
with configFile
. Then :
eslint.json
file and Gruntfile.js
file)eslint.json
), i.e.:.
{
"rules": {
"eqeqeq": "off",
"curly": "warn",
"quotes": ["warn", "double"]
}
}
for more examples, go here.
I've had the same error. It seems to need configuration.
Go to your project root & run in terminal
./node_modules/.bin/eslint --init
I hade the same problem with Gulp and running "gulp-eslint": "^3.0.1" version. I had to rename config: to configFile in Gulp task
.pipe(lint({configFile: 'eslint.json'}))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With