Skip to content

Commit c6352d4

Browse files
aarondillfisker
andauthored
chore: meta tweak (#291)
Co-authored-by: fisker Cheung <[email protected]>
1 parent 07820db commit c6352d4

File tree

6 files changed

+39
-40
lines changed

6 files changed

+39
-40
lines changed

.github/workflows/pr.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ jobs:
88
fail-fast: false
99
matrix:
1010
os:
11-
- "ubuntu-latest"
12-
# - "macos-latest"
13-
# - "windows-latest"
11+
- 'ubuntu-latest'
12+
# - 'macos-latest'
13+
# - 'windows-latest'
1414
node_version:
15-
- "18"
16-
- "16"
17-
- "14"
18-
- "12"
15+
- '18'
16+
- '16'
17+
- '14'
18+
- '12'
1919
name: Node.js ${{ matrix.node_version }} on ${{ matrix.os }}
2020
runs-on: ${{ matrix.os }}
2121
steps:
@@ -34,12 +34,9 @@ jobs:
3434
- name: Install Dependencies
3535
run: npm ci
3636

37-
- name: Run ESLint
37+
- name: Lint
3838
if: matrix.node_version == '18'
3939
run: npm run lint
4040

41-
- name: Check package.json
42-
run: npm run sort-package-json
43-
4441
- name: Run Tests
4542
run: npm run test-coverage

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.nyc_output/
2+
tests/snapshots/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ If an array, sort keys in ordering of `options.sortOrder`.
157157
158158
```js
159159
const sorted = sortPackageJson(packageJsonObject, {
160-
sortOrder: ['version']
160+
sortOrder: ['version'],
161161
})
162162

163163
console.log(Object.keys(sorted))
@@ -173,7 +173,7 @@ If a function, sort fields by [Array#sort(options.sortOrder)](https://developer.
173173
const sorted = sortPackageJson(packageJsonObject, {
174174
sortOrder(left, right) {
175175
return left.localeCompare(right)
176-
}
176+
},
177177
})
178178

179179
console.log(Object.keys(sorted))

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,28 @@
2828
"reporter.js"
2929
],
3030
"scripts": {
31-
"lint": "eslint .",
31+
"fix": "eslint . --fix && prettier . \"!**/*.js\" --write && node cli.js \"package.json\"",
32+
"lint": "eslint . && prettier . \"!**/*.js\" --check && node cli.js \"package.json\" --check",
3233
"prepare": "husky install",
3334
"semantic-release": "semantic-release",
34-
"sort-package-json": "node cli.js package.json --check",
3535
"test": "ava && dtslint --localTs node_modules/typescript/lib",
3636
"test-coverage": "nyc ava",
37-
"update-snapshot": "ava -u && node cli.js package.json"
37+
"update-snapshots": "ava --update-snapshots"
3838
},
3939
"commitlint": {
4040
"extends": [
4141
"@commitlint/config-conventional"
4242
]
4343
},
4444
"lint-staged": {
45+
"package.json": [
46+
"node cli.js"
47+
],
4548
"*.js": [
4649
"eslint --fix"
4750
],
48-
"*.ts": [
49-
"prettier --write"
50-
],
51-
"package.json": [
52-
"node cli.js"
51+
"**/*,!*.js": [
52+
"prettier --write --ignore-unkown"
5353
]
5454
},
5555
"prettier": {

tsconfig.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"compilerOptions": {
3-
"module": "commonjs",
4-
"lib": ["es6"],
5-
"noImplicitAny": true,
6-
"noImplicitThis": true,
7-
"strictNullChecks": true,
8-
"strictFunctionTypes": true,
9-
"noEmit": true,
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"lib": ["es6"],
5+
"noImplicitAny": true,
6+
"noImplicitThis": true,
7+
"strictNullChecks": true,
8+
"strictFunctionTypes": true,
9+
"noEmit": true,
1010

11-
// If the library is an external module (uses `export`), this allows your test file to import "mylib" instead of "./index".
12-
// If the library is global (cannot be imported via `import` or `require`), leave this out.
13-
"baseUrl": ".",
14-
"paths": { "sort-package-json": ["."] }
15-
}
16-
}
11+
// If the library is an external module (uses `export`), this allows your test file to import "mylib" instead of "./index".
12+
// If the library is global (cannot be imported via `import` or `require`), leave this out.
13+
"baseUrl": ".",
14+
"paths": { "sort-package-json": ["."] }
15+
}
16+
}

tslint.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"extends": "dtslint/dtslint.json", // Or "dtslint/dt.json" if on DefinitelyTyped
3-
"rules": {
4-
"semicolon": false
5-
}
6-
}
2+
"extends": "dtslint/dtslint.json", // Or "dtslint/dt.json" if on DefinitelyTyped
3+
"rules": {
4+
"semicolon": false
5+
}
6+
}

0 commit comments

Comments
 (0)