Home > Back-end >  No "eslint" targets found
No "eslint" targets found

Time:11-04

I have a Gruntfile.js like this.

module.exports = function(grunt) {
    require('time-grunt')(grunt);
    require('load-grunt-config')(grunt, {
        jitGrunt: {
            staticMappings: {
                scsslint: 'grunt-scss-lint'
            }
        }
    });

    grunt.loadNpmTasks('grunt-run');
    grunt.registerTask('default', ['eslint', 'jest', 'scsslint', 'svgstore'])
};

And when I run the grunt it says.

grunt

No "eslint" targets found.

eslint is already installed and I even created the configuration file using

./node_modules/.bin/eslint --init And this is the content of .eslintrc.js.

module.exports = {
    "env": {
        "browser": true,
        "es2021": true,
        "node": true
    },
    "extends": "eslint:recommended",
    "parserOptions": {
        "ecmaVersion": 13
    },
    "rules": {
    }
};

Any opinions?

CodePudding user response:

Depending on how you downloaded the codebase for the theme, it may be missing the "grunt" folder. If your project is missing this folder, try adding the one from Cornerstone: https://github.com/bigcommerce/cornerstone/tree/master/grunt

CodePudding user response:

Per the BigCommerce documentation around eslint errors -- If bundling your theme triggers multiple lint errors related to the bundle.js file, your theme is missing the .eslintignore file.

You can retrieve this file from the Cornerstone repo. Once you add this in, re-run the bundle command.

  • Related