So I have a package-scripts folder that holds all my scripts for building in the react environment:
const npsUtils = require('nps-utils')
module.exports = {
scripts: {
default: 'react-scripts start',
build: 'react-scripts build',
test: 'react-scripts test',
eject: 'react-scripts eject',
lint: {
default: 'eslint ./ --ignore-path .gitignore',
fix: 'yarn run lint -- --fix',
},
format: 'prettier --write "{,!(node_modules)/**/}*.js"',
validate: npsUtils.concurrent.nps('lint', 'format', 'build'),
},
}
However, when I try to call the lint fix script, it always fails. My call yarn start lint:fix
always fails and gives the error
Scripts must resolve to strings. There is no script that can be resolved from "lint:fix"
So how do i call lint fix?
You can do this:
and call it by: