ESLint not throwing any errors from npm command












0















Below is the configuration setup for eslint. Trying to define a basic eslint rule to define const instead of let if its an array or object



"scripts": {
"lint": "eslint src/**/*.js --fix"
}


.eslintrc



"rules": {
"strict": [2, "never"],
"prefer-const": 2
}



vscode referring to .eslintrc file for the rule defined on
prefer-const and throwing error in ide as below which is perfectly
fine




enter image description here




But npm run lint is not giving any error on the same nor fixing the code




enter image description here



Attaching the folder structure below where eslintrc is located
enter image description here
What is missing in my script?










share|improve this question

























  • Maybe, it's fixing it for you? Since you have --fix flag?

    – Manish Gharat
    Nov 15 '18 at 10:16











  • It’s not even fixing not giving any errors from command line

    – Mithun
    Nov 15 '18 at 10:19











  • And the .eslintrc file is in the folder from where you're running the command?

    – Manish Gharat
    Nov 15 '18 at 10:25











  • Yes it is in root project folder

    – Mithun
    Nov 15 '18 at 10:26











  • Can you please post a screenshot of your folder structure?

    – Manish Gharat
    Nov 15 '18 at 10:49
















0















Below is the configuration setup for eslint. Trying to define a basic eslint rule to define const instead of let if its an array or object



"scripts": {
"lint": "eslint src/**/*.js --fix"
}


.eslintrc



"rules": {
"strict": [2, "never"],
"prefer-const": 2
}



vscode referring to .eslintrc file for the rule defined on
prefer-const and throwing error in ide as below which is perfectly
fine




enter image description here




But npm run lint is not giving any error on the same nor fixing the code




enter image description here



Attaching the folder structure below where eslintrc is located
enter image description here
What is missing in my script?










share|improve this question

























  • Maybe, it's fixing it for you? Since you have --fix flag?

    – Manish Gharat
    Nov 15 '18 at 10:16











  • It’s not even fixing not giving any errors from command line

    – Mithun
    Nov 15 '18 at 10:19











  • And the .eslintrc file is in the folder from where you're running the command?

    – Manish Gharat
    Nov 15 '18 at 10:25











  • Yes it is in root project folder

    – Mithun
    Nov 15 '18 at 10:26











  • Can you please post a screenshot of your folder structure?

    – Manish Gharat
    Nov 15 '18 at 10:49














0












0








0


1






Below is the configuration setup for eslint. Trying to define a basic eslint rule to define const instead of let if its an array or object



"scripts": {
"lint": "eslint src/**/*.js --fix"
}


.eslintrc



"rules": {
"strict": [2, "never"],
"prefer-const": 2
}



vscode referring to .eslintrc file for the rule defined on
prefer-const and throwing error in ide as below which is perfectly
fine




enter image description here




But npm run lint is not giving any error on the same nor fixing the code




enter image description here



Attaching the folder structure below where eslintrc is located
enter image description here
What is missing in my script?










share|improve this question
















Below is the configuration setup for eslint. Trying to define a basic eslint rule to define const instead of let if its an array or object



"scripts": {
"lint": "eslint src/**/*.js --fix"
}


.eslintrc



"rules": {
"strict": [2, "never"],
"prefer-const": 2
}



vscode referring to .eslintrc file for the rule defined on
prefer-const and throwing error in ide as below which is perfectly
fine




enter image description here




But npm run lint is not giving any error on the same nor fixing the code




enter image description here



Attaching the folder structure below where eslintrc is located
enter image description here
What is missing in my script?







javascript visual-studio-code eslint lint






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 13:20







Mithun

















asked Nov 15 '18 at 10:13









MithunMithun

79521546




79521546













  • Maybe, it's fixing it for you? Since you have --fix flag?

    – Manish Gharat
    Nov 15 '18 at 10:16











  • It’s not even fixing not giving any errors from command line

    – Mithun
    Nov 15 '18 at 10:19











  • And the .eslintrc file is in the folder from where you're running the command?

    – Manish Gharat
    Nov 15 '18 at 10:25











  • Yes it is in root project folder

    – Mithun
    Nov 15 '18 at 10:26











  • Can you please post a screenshot of your folder structure?

    – Manish Gharat
    Nov 15 '18 at 10:49



















  • Maybe, it's fixing it for you? Since you have --fix flag?

    – Manish Gharat
    Nov 15 '18 at 10:16











  • It’s not even fixing not giving any errors from command line

    – Mithun
    Nov 15 '18 at 10:19











  • And the .eslintrc file is in the folder from where you're running the command?

    – Manish Gharat
    Nov 15 '18 at 10:25











  • Yes it is in root project folder

    – Mithun
    Nov 15 '18 at 10:26











  • Can you please post a screenshot of your folder structure?

    – Manish Gharat
    Nov 15 '18 at 10:49

















Maybe, it's fixing it for you? Since you have --fix flag?

– Manish Gharat
Nov 15 '18 at 10:16





Maybe, it's fixing it for you? Since you have --fix flag?

– Manish Gharat
Nov 15 '18 at 10:16













It’s not even fixing not giving any errors from command line

– Mithun
Nov 15 '18 at 10:19





It’s not even fixing not giving any errors from command line

– Mithun
Nov 15 '18 at 10:19













And the .eslintrc file is in the folder from where you're running the command?

– Manish Gharat
Nov 15 '18 at 10:25





And the .eslintrc file is in the folder from where you're running the command?

– Manish Gharat
Nov 15 '18 at 10:25













Yes it is in root project folder

– Mithun
Nov 15 '18 at 10:26





Yes it is in root project folder

– Mithun
Nov 15 '18 at 10:26













Can you please post a screenshot of your folder structure?

– Manish Gharat
Nov 15 '18 at 10:49





Can you please post a screenshot of your folder structure?

– Manish Gharat
Nov 15 '18 at 10:49












1 Answer
1






active

oldest

votes


















0














Your config file name should be .eslintrc.json.



Here's the reference documentation you can check: https://eslint.org/docs/user-guide/configuring



Also attaching a link to deprecation notice for .eslintrc file without extension: https://dev.to/ohbarye/eslintrc-without-file-extension-is-deprecated-3ngg



Try changing your config file name and it should work.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53317061%2feslint-not-throwing-any-errors-from-npm-command%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Your config file name should be .eslintrc.json.



    Here's the reference documentation you can check: https://eslint.org/docs/user-guide/configuring



    Also attaching a link to deprecation notice for .eslintrc file without extension: https://dev.to/ohbarye/eslintrc-without-file-extension-is-deprecated-3ngg



    Try changing your config file name and it should work.






    share|improve this answer






























      0














      Your config file name should be .eslintrc.json.



      Here's the reference documentation you can check: https://eslint.org/docs/user-guide/configuring



      Also attaching a link to deprecation notice for .eslintrc file without extension: https://dev.to/ohbarye/eslintrc-without-file-extension-is-deprecated-3ngg



      Try changing your config file name and it should work.






      share|improve this answer




























        0












        0








        0







        Your config file name should be .eslintrc.json.



        Here's the reference documentation you can check: https://eslint.org/docs/user-guide/configuring



        Also attaching a link to deprecation notice for .eslintrc file without extension: https://dev.to/ohbarye/eslintrc-without-file-extension-is-deprecated-3ngg



        Try changing your config file name and it should work.






        share|improve this answer















        Your config file name should be .eslintrc.json.



        Here's the reference documentation you can check: https://eslint.org/docs/user-guide/configuring



        Also attaching a link to deprecation notice for .eslintrc file without extension: https://dev.to/ohbarye/eslintrc-without-file-extension-is-deprecated-3ngg



        Try changing your config file name and it should work.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 16 '18 at 12:51

























        answered Nov 16 '18 at 12:46









        Manish GharatManish Gharat

        31618




        31618
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53317061%2feslint-not-throwing-any-errors-from-npm-command%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            List item for chat from Array inside array React Native

            Thiostrepton

            Caerphilly