Skip to content

Commit 4a83048

Browse files
committed
feat: initial commit
0 parents  commit 4a83048

20 files changed

+10587
-0
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
coverage/
2+
lib/

.eslintrc.js

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
'use strict';
2+
3+
module.exports = {
4+
parser: require.resolve('@typescript-eslint/parser'),
5+
extends: [
6+
'plugin:node/recommended',
7+
'plugin:@typescript-eslint/eslint-recommended',
8+
'plugin:react/recommended',
9+
'prettier',
10+
],
11+
plugins: ['node', 'prettier', 'import', '@typescript-eslint', 'react'],
12+
parserOptions: {
13+
ecmaVersion: 2018,
14+
},
15+
env: {
16+
node: true,
17+
es6: true,
18+
},
19+
rules: {
20+
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
21+
'@typescript-eslint/no-require-imports': 'error',
22+
'@typescript-eslint/ban-ts-ignore': 'warn',
23+
'@typescript-eslint/ban-types': 'error',
24+
'@typescript-eslint/no-unused-vars': 'error',
25+
'no-else-return': 'error',
26+
'no-negated-condition': 'error',
27+
eqeqeq: ['error', 'smart'],
28+
strict: 'error',
29+
'prefer-template': 'warn',
30+
'object-shorthand': ['warn', 'always', { avoidExplicitReturnArrows: true }],
31+
'prefer-destructuring': [
32+
'error',
33+
{ VariableDeclarator: { array: true, object: true } },
34+
],
35+
'sort-imports': ['error', { ignoreDeclarationSort: true }],
36+
'prettier/prettier': 'error',
37+
// TS covers this
38+
'node/no-missing-import': 'off',
39+
'node/no-unsupported-features/es-syntax': 'off',
40+
'node/no-unsupported-features/es-builtins': 'error',
41+
'import/no-commonjs': 'error',
42+
'import/no-duplicates': 'error',
43+
'import/no-extraneous-dependencies': 'error',
44+
'import/no-unused-modules': 'error',
45+
// handled by TS
46+
'react/prop-types': 'off',
47+
},
48+
settings: {
49+
react: {
50+
version: 'detect',
51+
},
52+
},
53+
overrides: [
54+
{
55+
files: ['*.js'],
56+
rules: {
57+
'@typescript-eslint/no-require-imports': 'off',
58+
},
59+
},
60+
{
61+
files: 'src/**/*',
62+
parserOptions: {
63+
sourceType: 'module',
64+
},
65+
},
66+
{
67+
files: ['.eslintrc.js', 'babel.config.js'],
68+
rules: {
69+
'@typescript-eslint/no-require-imports': 'off',
70+
'import/no-commonjs': 'off',
71+
},
72+
},
73+
],
74+
};

.github/workflows/lint.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Lint
2+
on: [pull_request]
3+
4+
jobs:
5+
commitlint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v1
9+
- uses: wagoid/[email protected]
10+
env:
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/nodejs.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Unit tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- next
8+
pull_request:
9+
branches:
10+
- master
11+
- next
12+
13+
jobs:
14+
test-node:
15+
name: Test on Node.js v${{ matrix.node-version }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
node-version: [8.x, 10.x, 12.x, 13.x]
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v1
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v1
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
- name: install
29+
run: yarn
30+
- name: run prettylint
31+
run: yarn prettylint
32+
- name: run typecheck
33+
run: yarn typecheck
34+
- name: run tests
35+
run: yarn test --coverage
36+
env:
37+
CI: true
38+
test-os:
39+
name: Test on ${{ matrix.os }} using Node.js LTS
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
os: [ubuntu-latest, windows-latest, macOS-latest]
44+
runs-on: ${{ matrix.os }}
45+
46+
steps:
47+
- uses: actions/checkout@v1
48+
- uses: actions/setup-node@v1
49+
with:
50+
node-version: 12.x
51+
- name: install
52+
run: yarn
53+
- name: run prettylint
54+
run: yarn prettylint
55+
- name: run typecheck
56+
run: yarn typecheck
57+
- name: run tests
58+
run: yarn test --coverage
59+
env:
60+
CI: true

.github/workflows/release.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
release:
9+
name: release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@master
13+
- uses: actions/setup-node@v1
14+
with:
15+
node-version: '12.x'
16+
- name: install
17+
run: yarn
18+
- name: run prettylint
19+
run: yarn prettylint
20+
- name: run typecheck
21+
run: yarn typecheck
22+
- name: run tests
23+
run: yarn test --coverage
24+
- run: yarn semantic-release
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
lib/

LICENSE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2019 Simen Bekkhus
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[![Actions Status](https://github.com/jest-community/jest-react-reporter/workflows/Unit%20tests/badge.svg)](https://github.com/jest-community/eslint-plugin-jest/actions)
2+
3+
## Installation
4+
5+
```
6+
$ yarn add --dev jest-react-reporter
7+
```
8+
9+
## Usage
10+
11+
Register the reporter with Jest following the docs:
12+
https://jestjs.io/docs/en/configuration#reporters-array-modulename-modulename-options
13+
14+
Note that this is still early days and this reporter is quite experimental.
15+
We're aiming for feature parity with Jest's builtin reporters as a start, but
16+
we're hoping to add more features in the future. Please open issues (preferably
17+
PRs!) for any bugs.

babel.config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
module.exports = {
4+
presets: [
5+
'@babel/preset-typescript',
6+
'@babel/preset-react',
7+
['@babel/preset-env', { targets: { node: 8 } }],
8+
],
9+
};

package.json

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"name": "jest-react-reporter",
3+
"version": "0.0.0",
4+
"description": "Reporter for Jest written in React",
5+
"repository": "jest-community/jest-react-reporter",
6+
"license": "MIT",
7+
"author": "Simen Bekkhus <[email protected]>",
8+
"files": [
9+
"lib/"
10+
],
11+
"main": "lib/",
12+
"engines": {
13+
"node": ">=8"
14+
},
15+
"peerDependencies": {
16+
"jest": "^24.9.0 || ^25.0.0"
17+
},
18+
"scripts": {
19+
"prepare": "yarn build",
20+
"lint": "eslint . --ignore-pattern '!.eslintrc.js' --ext js,ts,tsx",
21+
"prettylint": "prettylint docs/**/*.md README.md package.json",
22+
"test": "jest",
23+
"build": "babel --extensions .js,.ts,.tsx src --out-dir lib",
24+
"typecheck": "tsc -p ."
25+
},
26+
"devDependencies": {
27+
"@babel/cli": "^7.7.0",
28+
"@babel/core": "^7.7.2",
29+
"@babel/preset-env": "^7.7.1",
30+
"@babel/preset-react": "^7.7.0",
31+
"@babel/preset-typescript": "^7.7.2",
32+
"@commitlint/cli": "^8.2.0",
33+
"@commitlint/config-conventional": "^8.2.0",
34+
"@semantic-release/changelog": "^3.0.5",
35+
"@semantic-release/git": "^7.0.18",
36+
"@types/jest": "^24.0.15",
37+
"@types/node": "^12.12.7",
38+
"@types/react": "^16.9.11",
39+
"@typescript-eslint/eslint-plugin": "^2.6.1",
40+
"@typescript-eslint/parser": "^2.6.1",
41+
"babel-jest": "^25.0.0",
42+
"eslint": "^6.6.0",
43+
"eslint-config-prettier": "^6.5.0",
44+
"eslint-plugin-import": "^2.18.2",
45+
"eslint-plugin-jest": "^23.0.3",
46+
"eslint-plugin-node": "^10.0.0",
47+
"eslint-plugin-prettier": "^3.1.1",
48+
"eslint-plugin-react": "^7.16.0",
49+
"husky": "^3.0.9",
50+
"jest": "^25.0.0",
51+
"lint-staged": "^9.4.2",
52+
"prettier": "^1.19.1",
53+
"prettylint": "^1.0.0",
54+
"semantic-release": "^15.13.30",
55+
"typescript": "^3.7.2"
56+
},
57+
"prettier": {
58+
"proseWrap": "always",
59+
"singleQuote": true,
60+
"trailingComma": "all"
61+
},
62+
"lint-staged": {
63+
"*.{js,ts,tsx}": [
64+
"eslint --fix",
65+
"git add"
66+
],
67+
"*.{md,json}": [
68+
"prettier --write",
69+
"git add"
70+
]
71+
},
72+
"jest": {
73+
"testEnvironment": "node"
74+
},
75+
"commitlint": {
76+
"extends": [
77+
"@commitlint/config-conventional"
78+
]
79+
},
80+
"husky": {
81+
"hooks": {
82+
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS",
83+
"pre-commit": "lint-staged"
84+
}
85+
},
86+
"release": {
87+
"plugins": [
88+
"@semantic-release/commit-analyzer",
89+
"@semantic-release/release-notes-generator",
90+
"@semantic-release/changelog",
91+
"@semantic-release/npm",
92+
"@semantic-release/git",
93+
"@semantic-release/github"
94+
]
95+
},
96+
"dependencies": {
97+
"@jest/reporters": "^25.0.0",
98+
"@jest/test-result": "^25.0.0",
99+
"@jest/types": "^25.0.0",
100+
"ink": "^2.5.0",
101+
"jest-util": "^25.0.0",
102+
"react": "^16.11.0",
103+
"slash": "^3.0.0"
104+
}
105+
}

0 commit comments

Comments
 (0)