Skip to content

Commit bd3c17b

Browse files
committed
Build improvements
1 parent b5efa00 commit bd3c17b

25 files changed

+1902
-392
lines changed

.ado/scripts/.gitignore

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# Runtime data
8+
pids
9+
*.pid
10+
*.seed
11+
*.pid.lock
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage/
15+
*.lcov
16+
17+
# nyc test coverage
18+
.nyc_output
19+
20+
# ESLint cache
21+
.eslintcache
22+
23+
# Optional npm cache directory
24+
.npm
25+
26+
# Optional REPL history
27+
.node_repl_history
28+
29+
# Output of 'npm pack'
30+
*.tgz
31+
32+
# Yarn Integrity file
33+
.yarn-integrity
34+
35+
# dotenv environment variables file
36+
.env
37+
.env.test
38+
39+
# parcel-bundler cache (https://parceljs.org/)
40+
.cache
41+
.parcel-cache
42+
43+
# next.js build output
44+
.next
45+
46+
# nuxt.js build output
47+
.nuxt
48+
49+
# vuepress build output
50+
.vuepress/dist
51+
52+
# Serverless directories
53+
.serverless/
54+
55+
# FuseBox cache
56+
.fusebox/
57+
58+
# DynamoDB Local files
59+
.dynamodb/
60+
61+
# TernJS port file
62+
.tern-port
63+
64+
# Stores VSCode versions used for testing VSCode extensions
65+
.vscode-test
66+
67+
# macOS
68+
.DS_Store
69+
70+
# Windows
71+
Thumbs.db
72+
ehthumbs.db
73+
Desktop.ini

.ado/scripts/.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore files for Prettier
2+
node_modules/
3+
*.min.js
4+
*.bundle.js

.ado/scripts/.prettierrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "all",
4+
"singleQuote": false,
5+
"printWidth": 80,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"bracketSpacing": true,
9+
"arrowParens": "always",
10+
"endOfLine": "lf",
11+
"quoteProps": "as-needed"
12+
}

.ado/scripts/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# JavaScript Build Scripts
2+
3+
This folder contains the JavaScript build scripts for Hermes Windows, along with tooling to maintain code quality.
4+
5+
## Files
6+
7+
- `build.js` - Main build script for Hermes Windows
8+
- `setVersionNumber.js` - Script to set version numbers
9+
10+
## Code Quality Tools
11+
12+
We use **Prettier** and **ESLint** to maintain consistent code style and catch potential issues.
13+
14+
### Setup
15+
16+
From this directory (`.ado/scripts`), install the dependencies:
17+
18+
```bash
19+
npm install
20+
```
21+
22+
### Available Scripts
23+
24+
- `npm run format` - Format all JavaScript files with Prettier
25+
- `npm run format:check` - Check if files need formatting
26+
- `npm run lint` - Run ESLint to check for code issues
27+
- `npm run lint:fix` - Run ESLint and automatically fix issues
28+
- `npm run lint:format` - Format with Prettier and then run ESLint with auto-fix
29+
30+
### Usage
31+
32+
To format and lint your changes:
33+
34+
```bash
35+
npm run lint:format
36+
```
37+
38+
To check formatting without changing files:
39+
40+
```bash
41+
npm run format:check
42+
```
43+
44+
To run just the linter:
45+
46+
```bash
47+
npm run lint
48+
```
49+
50+
## Configuration
51+
52+
- `.prettierrc` - Prettier configuration (formatting rules)
53+
- `eslint.config.js` - ESLint configuration (code quality rules)
54+
- `package.json` - Dependencies and scripts
55+
56+
## Best Practices
57+
58+
1. Run `npm run lint:format` before committing changes
59+
2. Use double quotes for strings (enforced by Prettier)
60+
3. Always use trailing commas in multiline objects/arrays
61+
4. Use `const` instead of `let` when variables are not reassigned
62+
5. Use template literals instead of string concatenation when possible

0 commit comments

Comments
 (0)