Last active
February 24, 2017 11:53
-
-
Save bjankord/c5d1b0a578a2c7122e8e1a906f0ab1bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "scripts": { | |
| "compile": "node ../../scripts/compile.js", | |
| "lint": "node ../../scripts/lint.js", | |
| "pretest": "node ../../scripts/pretest.js", | |
| "release:major": "npm test && npm run compile && npm version major -m \"Released version %s\" && npm publish && git push", | |
| "release:minor": "npm test && npm run compile && npm version minor -m \"Released version %s\" && npm publish && git push", | |
| "release:patch": "npm test && npm run compile && npm version patch -m \"Released version %s\" && npm publish && git push", | |
| "test": "node ../../scripts/test.js" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const shell = require('shelljs'); | |
| // Paths are relative to location script is called from | |
| // Uncomment next line to view work directory scripts are executed from | |
| // shell.exec('pwd'); | |
| shell.exec('npm run lint'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const shell = require('shelljs'); | |
| // Paths are relative to location script is called from | |
| // Uncomment next line to view work directory scripts are executed from | |
| // shell.exec('pwd'); | |
| shell.exec('../../node_modules/.bin/eslint **/*.js, **/*.jsx'); | |
| if (shell.exec('../../node_modules/.bin/eslint **/*.js, **/*.jsx').code !== 0) { | |
| shell.echo('Error: JS lint errors detected'); | |
| shell.exit(1); | |
| } | |
| shell.exec('../../node_modules/.bin/eslint **/*.js, **/*.jsx', function(code, stdout, stderr) { | |
| if (code !== 0) { | |
| process.exit(1); | |
| } | |
| // console.log('Exit code:', code); | |
| // console.log('Program output:', stdout); | |
| // console.log('Program stderr:', stderr); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const shell = require('shelljs'); | |
| // Paths are relative to location script is called from | |
| // Uncomment next line to view work directory scripts are executed from | |
| // shell.exec('pwd'); | |
| shell.exec('../../node_modules/.bin/jest --config ../../jestconfig.json'); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using the following in lint.js
And call
npm run lintin the npm-script "pretest" rather thannode ../../scripts/pretest.jsseems to cause the script to error out correctly if there is lint rather than moving on to running tests.