Skip to content

Commit eda8392

Browse files
authored
Update deps (#24)
Updates all dev dependencies. Updates markdown-table to v2 (v3 uses ESM). Exports main interfaces. Emits ES2021 instead of es5.
1 parent 7d9a24e commit eda8392

13 files changed

+2663
-3851
lines changed

.eslintrc.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ module.exports = {
77
jest: true
88
},
99
parserOptions: {
10-
ecmaVersion: 2018,
10+
ecmaVersion: 6,
1111
sourceType: 'module'
1212
},
13-
parser: 'typescript-eslint-parser',
14-
plugins: ['typescript'],
13+
parser: '@typescript-eslint/parser',
14+
plugins: ['@typescript-eslint'],
1515
rules: {
16-
'typescript/no-unused-vars': 2
16+
'@typescript-eslint/no-unused-vars': 2
1717
}
1818
};

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ jspm_packages/
5656

5757
lib/
5858
coverage/
59+
docs/

.prettierrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
2-
singleQuote: true
2+
singleQuote: true,
3+
trailingComma: 'none'
34
};

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- Formatted as markdown table
99
- Fail if coverage decreases on a file (check on percentage) for any of the lines/func/statements/branches. Can
1010
 be configured to only check some criteria.
11-
- Written in Typescript
11+
- Written in Typescript.
1212

1313
## Usage
1414

jest.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ module.exports = {
66
transform: {
77
'^.+\\.(js|ts)$': 'ts-jest'
88
},
9+
globals: {
10+
'ts-jest': {
11+
isolatedModules: true,
12+
diagnostics: false
13+
}
14+
},
915
testMatch: ['**/?(*.)test.(js|ts)'],
1016
testEnvironment: 'node',
1117
moduleFileExtensions: ['ts', 'js', 'json']

package.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
"license": "MIT",
1010
"scripts": {
1111
"build": "./node_modules/.bin/tsc -p tsconfig.build.json",
12-
"build-docs": "typedoc --out docs/ src/ typings/",
12+
"build-docs": "typedoc --out docs/ src/index.ts",
1313
"clean": "rm -rf lib docs coverage",
1414
"eslint": "eslint 'src/**'",
1515
"lint": "yarn clean && yarn eslint && yarn prettier",
1616
"postpublish": "yarn publish-docs",
1717
"precommit": "lint-staged",
1818
"prepublishOnly": "yarn clean && yarn lint && yarn test && yarn build",
19-
"prettier": "prettier --single-quote --list-different '**/*.{js,ts,md}'",
19+
"prettier": "prettier -c '**/*.{js,ts,md}'",
2020
"publish-docs": "yarn build-docs && gh-pages -d docs -b gh-pages && yarn clean",
2121
"test": "yarn run tsc && yarn run jest",
2222
"jest": "jest --maxWorkers=4",
@@ -26,25 +26,24 @@
2626
},
2727
"lint-staged": {
2828
"*.{js,ts}": "eslint",
29-
"*.{js,ts,md}": "prettier --single-quote --list-different"
29+
"*.{js,ts,md}": "prettier -c"
3030
},
3131
"devDependencies": {
3232
"@types/jest": "22.2.3",
33-
"@types/node": "9.6.2",
34-
"eslint": "6.7.2",
35-
"eslint-config-prettier": "2.9.0",
36-
"eslint-plugin-typescript": "0.11.0",
37-
"gh-pages": "1.1.0",
38-
"husky": "0.14.3",
39-
"jest": "22.4.3",
40-
"lint-staged": "7.0.4",
41-
"prettier": "1.19.1",
42-
"ts-jest": "22.4.3",
43-
"typedoc": "0.11.1",
44-
"typescript": "2.8.1",
45-
"typescript-eslint-parser": "14.0.0"
33+
"@types/node": "16.11.7",
34+
"@typescript-eslint/eslint-plugin": "5.14.0",
35+
"@typescript-eslint/parser": "5.14.0",
36+
"eslint": "8.11.0",
37+
"eslint-config-prettier": "8.5.0",
38+
"gh-pages": "3.2.3",
39+
"jest": "27.5.1",
40+
"lint-staged": "12.3.5",
41+
"prettier": "2.5.1",
42+
"ts-jest": "27.1.3",
43+
"typedoc": "0.22.13",
44+
"typescript": "4.6.2"
4645
},
4746
"dependencies": {
48-
"markdown-table": "1.1.1"
47+
"markdown-table": "2.0.0"
4948
}
5049
}

src/__snapshots__/resultFormatter.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`resultFormatter should format files results as markdown table 1`] = `
4-
"| Ok | File | Lines | Branches | Functions | Statements |
5-
| --- | ----- | ------------- | ------------- | ------------ | ------------- |
6-
| 🔴 | file1 | 80%<br>(+10%) | 14%<br>(-30%) | 3%<br>(+20%) | 20%<br>(-10%) |
7-
| ✅ | file2 | 20%<br>(+10%) | 8%<br>(+30%) | 2%<br>(+20%) | 5%<br>(+10%) |
4+
"| Ok | File | Lines | Branches | Functions | Statements |
5+
| -- | ----- | ------------- | ------------- | ------------ | ------------- |
6+
| 🔴 | file1 | 80%<br>(+10%) | 14%<br>(-30%) | 3%<br>(+20%) | 20%<br>(-10%) |
7+
| ✅ | file2 | 20%<br>(+10%) | 8%<br>(+30%) | 2%<br>(+20%) | 5%<br>(+10%) |
88
99
Total:
1010

src/diffChecker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const checkCoverageForCondition = (
9090
) => {
9191
const diffPercentages = getSummaryPercentages(coverage);
9292

93-
const values = checkCriteria.map(criteria => diffPercentages[criteria]);
93+
const values = checkCriteria.map((criteria) => diffPercentages[criteria]);
9494

9595
return values.some(condition);
9696
};

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ export function diff(
4242
regression
4343
};
4444
}
45-
45+
export { IJsonSummary, ICoverageDiffOutput, IConfigOptions };
4646
export default diff;

src/resultFormatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const formatFilesResults = (files: IFilesResults): string => {
3636
const header = ['Ok', 'File', 'Lines', 'Branches', 'Functions', 'Statements'];
3737
table.push(header);
3838

39-
Object.keys(files).forEach(file => {
39+
Object.keys(files).forEach((file) => {
4040
const { deltas, pcts, decreased } = files[file];
4141
const row = [
4242
decreased ? '🔴' : '✅',

0 commit comments

Comments
 (0)