Skip to content

Commit

Permalink
chore: meta tweak (#291)
Browse files Browse the repository at this point in the history
Co-authored-by: fisker Cheung <lionkay@gmail.com>
  • Loading branch information
aarondill and fisker authored Feb 2, 2023
1 parent 07820db commit c6352d4
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 40 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ jobs:
fail-fast: false
matrix:
os:
- "ubuntu-latest"
# - "macos-latest"
# - "windows-latest"
- 'ubuntu-latest'
# - 'macos-latest'
# - 'windows-latest'
node_version:
- "18"
- "16"
- "14"
- "12"
- '18'
- '16'
- '14'
- '12'
name: Node.js ${{ matrix.node_version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -34,12 +34,9 @@ jobs:
- name: Install Dependencies
run: npm ci

- name: Run ESLint
- name: Lint
if: matrix.node_version == '18'
run: npm run lint

- name: Check package.json
run: npm run sort-package-json

- name: Run Tests
run: npm run test-coverage
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.nyc_output/
tests/snapshots/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ If an array, sort keys in ordering of `options.sortOrder`.
```js
const sorted = sortPackageJson(packageJsonObject, {
sortOrder: ['version']
sortOrder: ['version'],
})

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

console.log(Object.keys(sorted))
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,28 @@
"reporter.js"
],
"scripts": {
"lint": "eslint .",
"fix": "eslint . --fix && prettier . \"!**/*.js\" --write && node cli.js \"package.json\"",
"lint": "eslint . && prettier . \"!**/*.js\" --check && node cli.js \"package.json\" --check",
"prepare": "husky install",
"semantic-release": "semantic-release",
"sort-package-json": "node cli.js package.json --check",
"test": "ava && dtslint --localTs node_modules/typescript/lib",
"test-coverage": "nyc ava",
"update-snapshot": "ava -u && node cli.js package.json"
"update-snapshots": "ava --update-snapshots"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"lint-staged": {
"package.json": [
"node cli.js"
],
"*.js": [
"eslint --fix"
],
"*.ts": [
"prettier --write"
],
"package.json": [
"node cli.js"
"**/*,!*.js": [
"prettier --write --ignore-unkown"
]
},
"prettier": {
Expand Down
28 changes: 14 additions & 14 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noEmit": true,
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noEmit": true,

// If the library is an external module (uses `export`), this allows your test file to import "mylib" instead of "./index".
// If the library is global (cannot be imported via `import` or `require`), leave this out.
"baseUrl": ".",
"paths": { "sort-package-json": ["."] }
}
}
// If the library is an external module (uses `export`), this allows your test file to import "mylib" instead of "./index".
// If the library is global (cannot be imported via `import` or `require`), leave this out.
"baseUrl": ".",
"paths": { "sort-package-json": ["."] }
}
}
10 changes: 5 additions & 5 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "dtslint/dtslint.json", // Or "dtslint/dt.json" if on DefinitelyTyped
"rules": {
"semicolon": false
}
}
"extends": "dtslint/dtslint.json", // Or "dtslint/dt.json" if on DefinitelyTyped
"rules": {
"semicolon": false
}
}

0 comments on commit c6352d4

Please sign in to comment.