-
Notifications
You must be signed in to change notification settings - Fork 4
/
package-scripts.js
53 lines (50 loc) · 1.51 KB
/
package-scripts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const webpackDevConfig = '--config dev.webpack.babel.js';
const tslintCommand = 'tslint --project tsconfig.json --config tslint.json';
const eslintCommand = 'eslint .';
/* Start of stylelint */
const stylelintCommandCSS = 'stylelint "src/**/*.css" --config css.stylelint.config.js';
const stylelintCommandTypeScriptConfig = '--config typescript.stylelint.config.js';
const stylelintCommandTS = `stylelint "src/**/*.ts" ${stylelintCommandTypeScriptConfig}`;
const stylelintCommandTSX = `stylelint "src/**/*.tsx" ${stylelintCommandTypeScriptConfig}`;
/* End of stylelint */
module.exports = {
scripts: {
build: {
dev: `webpack --env.development ${webpackDevConfig}`,
},
dev: {
script: `webpack-dev-server --env.development ${webpackDevConfig}`,
description: 'Run local dev server',
},
tslint: {
script: tslintCommand,
fix: {
script: `${tslintCommand} --fix`,
},
},
eslint: {
script: eslintCommand,
fix: {
script: `${eslintCommand} --fix`,
},
},
stylelint: {
script: 'nps stylelint.css && nps stylelint.ts && nps stylelint.tsx',
css: {
script: stylelintCommandCSS,
description: 'Run stylelint on CSS files',
},
ts: {
script: stylelintCommandTS,
description: 'Run stylelint on TS files',
},
tsx: {
script: stylelintCommandTSX,
description: 'Run stylelint on TSX files',
},
},
prettier: {
markdown: 'prettier *.md --write',
},
},
};