ESLint not throwing any errors from npm command
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

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

Attaching the folder structure below where eslintrc is located

What is missing in my script?
javascript visual-studio-code eslint lint
|
show 1 more comment
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

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

Attaching the folder structure below where eslintrc is located

What is missing in my script?
javascript visual-studio-code eslint lint
Maybe, it's fixing it for you? Since you have--fixflag?
– 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
|
show 1 more comment
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

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

Attaching the folder structure below where eslintrc is located

What is missing in my script?
javascript visual-studio-code eslint lint
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

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

Attaching the folder structure below where eslintrc is located

What is missing in my script?
javascript visual-studio-code eslint lint
javascript visual-studio-code eslint lint
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--fixflag?
– 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
|
show 1 more comment
Maybe, it's fixing it for you? Since you have--fixflag?
– 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
|
show 1 more comment
1 Answer
1
active
oldest
votes
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.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
edited Nov 16 '18 at 12:51
answered Nov 16 '18 at 12:46
Manish GharatManish Gharat
31618
31618
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Maybe, it's fixing it for you? Since you have
--fixflag?– 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