Creating different eslint rules for local development

0 votes

I am developing some code and want to figure out what's going wrong, so I have

function foo() {
    console.log("Look its 2016 and I'm still printf debugging");
}

Except, our build process runs esLint as part of the build system and by-design prevents even running the rest of the build pipeline if esLint fails. error Unexpected console statement no-console

What I effectively want is to set up a dev environment where certain rules are turned off (or converted to warnings), and then a production environment with the strict rules turned on. And I want to be able to easily toggle that locally so I can verify my code works before submitting it to a CI server.

Jul 10, 2018 in DevOps Tools by Nilesh
• 7,060 points
839 views

1 answer to this question.

0 votes
You can make a dev.eslintrc or similar and have that extend the main .eslintrc. And then I can use command line args to switch between the two rulesets as needed. Or use pre-commit hook where your code gets checked before any commit happens. You can always disable any rule you want using a comment if local or using .eslintrc file.
answered Jul 10, 2018 by Kalgi
• 2,680 points

Related Questions In DevOps Tools

0 votes
1 answer

What strategies do you use for secrets management across different environments in DevOps workflows?

Securing Secrets: It prevents unauthorized access to ...READ MORE

answered Nov 4 in DevOps Tools by Gagana
• 2,450 points
68 views
0 votes
0 answers

What’s the best approach for managing different environments (dev, staging, prod) with Docker?

What’s the best approach for managing different ...READ MORE

Nov 5 in DevOps Tools by Anila
• 3,390 points
25 views
0 votes
0 answers

How would you unify Docker setups for development and production?

How would you unify Docker setups for ...READ MORE

Nov 12 in DevOps Tools by Anila
• 3,390 points
31 views
0 votes
1 answer

Any rate limiter for kitura

Try using KituraLimiter as a rate limiting ...READ MORE

answered Jun 4, 2018 in DevOps Tools by DareDev
• 6,890 points
645 views
0 votes
1 answer

dpkg a deb file in a local fodler on vagrant

Copy the file in the vagrant folder ...READ MORE

answered Jun 14, 2018 in DevOps Tools by DareDev
• 6,890 points
665 views
+1 vote
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,034 views
0 votes
1 answer

Using 'salt.module.tomcat' for deploying war file

tomcat.deploy_war is an execution module, not a state module. In ...READ MORE

answered Jul 11, 2018 in DevOps Tools by Kalgi
• 2,680 points
758 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP