Custom eslint config with create-react-app

The problem

Nobody expected react-app-rewired, ha ha!

  1. npm i -D react-app-rewired react-app-rewire-eslint
  2. In project root directory createconfig-overrides.js file and
  3. Edit the file:
//config-overrides.jsconst rewireEslint = require(‘react-app-rewire-eslint’);
module.exports = function override(config, env) {
config = rewireEslint(config, env);
return config;
“scripts”: {
“start”: “react-app-rewired start”,
“build”: “react-app-rewired build”,
“test”: “react-app-rewired test — env=jsdom”,
“eject”: “react-scripts eject”

That’s all!




Web developer | React

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adam Dziendziel

Adam Dziendziel

Web developer | React

More from Medium

Add Husky + Lint-staged to React (with Typescript)

How to secure SPAs with Asgardeo

Local storage vs Session Storage vs Cookies vs Redux store

ReactJS — Separating logic using Higher-Order Component (HOC)