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
856 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
• 6,530 points
110 views
0 votes
1 answer

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

Manage Different Environments (dev, staging, prod) With ...READ MORE

answered Nov 6 in DevOps Tools by Gagana
• 6,530 points
55 views
0 votes
1 answer

How would you unify Docker setups for development and production?

Single Dockerfile with separate stages: Development stage with debugging tools and ...READ MORE

answered Nov 25 in DevOps Tools by Gagana
• 6,530 points
56 views
0 votes
1 answer

How do you structure your Docker Compose files for development versus production environments?

Structuring Docker Compose files requires balancing simplicity ...READ MORE

answered Nov 22 in DevOps Tools by Gagana
• 6,530 points
45 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
659 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,062 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
782 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