Skip to content

Commit ec68c59

Browse files
committed
Simplify and unify package.json scripts section order
1 parent 965b871 commit ec68c59

File tree

6 files changed

+18
-25
lines changed

6 files changed

+18
-25
lines changed

src/content/3/en/part3d.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ It is recommended to create a separate _npm script_ for linting:
325325
"scripts": {
326326
"start": "node index.js",
327327
"dev": "node --watch index.js",
328+
"test": "echo \"Error: no test specified\" && exit 1",
328329
"lint": "eslint ." // highlight-line
329330
// ...
330331
},

src/content/3/fi/osa3d.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ Kannattaa ehkä tehdä linttaustakin varten _npm-skripti_:
313313
"scripts": {
314314
"start": "node index.js",
315315
"dev": "node --watch index.js",
316+
"test": "echo \"Error: no test specified\" && exit 1",
316317
"lint": "eslint ." // highlight-line
317318
// ...
318319
},

src/content/4/en/part4a.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,9 +510,8 @@ Let's define the <i>npm script _test_</i> for the test execution:
510510
"scripts": {
511511
"start": "node index.js",
512512
"dev": "node --watch index.js",
513-
"lint": "eslint .",
514-
// ...
515-
"test": "node --test" // highlight-line
513+
"test": "node --test", // highlight-line
514+
"lint": "eslint ."
516515
},
517516
// ...
518517
}

src/content/4/en/part4b.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,8 @@ Next, let's change the scripts in our notes application <i>package.json</i> file
3030
"start": "NODE_ENV=production node index.js", // highlight-line
3131
"dev": "NODE_ENV=development node --watch index.js", // highlight-line
3232
"test": "NODE_ENV=test node --test", // highlight-line
33-
"build:ui": "rm -rf build && cd ../frontend/ && npm run build && cp -r build ../backend",
34-
"deploy": "fly deploy",
35-
"deploy:full": "npm run build:ui && npm run deploy",
36-
"logs:prod": "fly logs",
37-
"lint": "eslint .",
38-
},
33+
"lint": "eslint ."
34+
}
3935
// ...
4036
}
4137
```
@@ -54,10 +50,10 @@ We can then achieve cross-platform compatibility by using the cross-env library
5450
{
5551
// ...
5652
"scripts": {
57-
"start": "cross-env NODE_ENV=production node index.js",
58-
"dev": "cross-env NODE_ENV=development node --watch index.js",
59-
"test": "cross-env NODE_ENV=test node --test",
60-
// ...
53+
"start": "cross-env NODE_ENV=production node index.js", // highlight-line
54+
"dev": "cross-env NODE_ENV=development node --watch index.js", // highlight-line
55+
"test": "cross-env NODE_ENV=test node --test", // highlight-line
56+
"lint": "eslint ."
6157
},
6258
// ...
6359
}

src/content/4/fi/osa4a.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,8 @@ Määritellään npm-skripti <i>test</i> testien suorittamiseen:
499499
"scripts": {
500500
"start": "node index.js",
501501
"dev": "node --watch index.js",
502-
"lint": "eslint .",
503-
// ...
504-
"test": "node --test" // highlight-line
502+
"test": "node --test", // highlight-line
503+
"lint": "eslint ."
505504
},
506505
// ...
507506
}

src/content/4/fi/osa4b.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,8 @@ Määritellään nyt tiedostossa <i>package.json</i>, että testejä suoritettae
2828
"start": "NODE_ENV=production node index.js", // highlight-line
2929
"dev": "NODE_ENV=development node --watch index.js", // highlight-line
3030
"test": "NODE_ENV=test node --test", // highlight-line
31-
"build:ui": "rm -rf build && cd ../frontend/ && npm run build && cp -r build ../backend",
32-
"deploy": "fly deploy",
33-
"deploy:full": "npm run build:ui && npm run deploy",
34-
"logs:prod": "fly logs",
35-
"lint": "eslint .",
36-
},
31+
"lint": "eslint ."
32+
}
3733
// ...
3834
}
3935
```
@@ -52,9 +48,10 @@ ja muuttamalla <i>package.json</i> kaikilla käyttöjärjestelmillä toimivaan m
5248
{
5349
// ...
5450
"scripts": {
55-
"start": "cross-env NODE_ENV=production node index.js",
56-
"dev": "cross-env NODE_ENV=development node --watch index.js",
57-
"test": "cross-env NODE_ENV=test node --test",
51+
"start": "cross-env NODE_ENV=production node index.js", // highlight-line
52+
"dev": "cross-env NODE_ENV=development node --watch index.js", // highlight-line
53+
"test": "cross-env NODE_ENV=test node --test", // highlight-line
54+
"lint": "eslint ."
5855
},
5956
// ...
6057
}

0 commit comments

Comments
 (0)