Skip to content

Instantly share code, notes, and snippets.

@michchan
Last active October 28, 2020 08:31
Show Gist options
  • Save michchan/3de35bc278044e6e6096a2f2aa769d97 to your computer and use it in GitHub Desktop.
Save michchan/3de35bc278044e6e6096a2f2aa769d97 to your computer and use it in GitHub Desktop.
Useful npm scripts setup on package.json for Node/TypeScript/React projects
{
// React / Node project
"clearbuildcache": "rm -rf ./build",
// source-map-explorer
"analyze": "source-map-explorer 'build/static/js/*.js'",
// Eslint
"eslint": "eslint --ext .js,.jsx,.ts,.tsx .",
"eslint:fix": "npm run eslint -- --fix",
// Stylelint
"stylelint": "stylelint 'src/**/*.{js,jsx,ts,tsx}'",
// Typescript
"watch": "tsc -- --watch --noemit",
// React
// Disable eslint on development with Create React App,
// say when the project is too large to make the reloading so slow.
"start": "REACT_APP_DEV_DISABLE_ESLINT=true react-scripts start",
// For AWS CDK
"deploy": "cdk deploy FundPriceMonitorBackendStack --require-approval never",
"template": "npm run build && cdk synth --no-staging > template.yaml",
"invoke": "npm run template && sam local invoke",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment