Skip to content

Commit dfe6acc

Browse files
authored
Port codebase to TS (#126)
Port codebase to TS
2 parents 88ce0f2 + f637f20 commit dfe6acc

25 files changed

+13898
-431
lines changed

.codecov.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
codecov:
2+
notify:
3+
require_ci_to_pass: yes
4+
5+
coverage:
6+
precision: 2
7+
round: down
8+
range: '10...100'
9+
10+
status:
11+
project:
12+
default:
13+
threshold: 1
14+
patch:
15+
default:
16+
threshold: 1
17+
changes: no
18+
19+
parsers:
20+
gcov:
21+
branch_detection:
22+
conditional: yes
23+
loop: yes
24+
method: no
25+
macro: no
26+
27+
comment:
28+
layout: 'header, diff'
29+
behavior: default
30+
require_changes: no

.eslintrc.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const path = require('path');
2+
module.exports = {
3+
parser: '@typescript-eslint/parser',
4+
parserOptions: {
5+
project: path.resolve(__dirname, './tsconfig.json'),
6+
tsconfigRootDir: __dirname,
7+
},
8+
env: {
9+
browser: true,
10+
node: true,
11+
},
12+
plugins: ['@typescript-eslint'],
13+
extends: [
14+
'eslint:recommended',
15+
'plugin:@typescript-eslint/eslint-recommended',
16+
'plugin:react/recommended',
17+
'plugin:@typescript-eslint/recommended',
18+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
19+
'prettier',
20+
'prettier/@typescript-eslint',
21+
'prettier/react',
22+
],
23+
rules: {
24+
'@typescript-eslint/prefer-regexp-exec': 1,
25+
},
26+
};

.github/workflows/push.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: react-infinite-scroll-component
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v1
11+
12+
- name: install dependencies
13+
run: yarn
14+
15+
- name: lint
16+
run: yarn lint
17+
18+
- name: prettier
19+
run: yarn prettier:check
20+
21+
- name: unit tests
22+
run: yarn test
23+
24+
- name: ts type checks
25+
run: yarn ts-check
26+
27+
- uses: codecov/[email protected]
28+
with:
29+
token: ${{secrets.CODECOV_TOKEN}}
30+
file: ./coverage/lcov.info

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ npm-debug.log
33
.idea
44
node_modules
55
/lib
6+
.rts2_*
7+
dist
8+
.vscode
9+
storybook-static/
10+
coverage/

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
/server.js
55
/webpack.*
66
npm-debug.log
7+
__tests__
8+
stories/

.prettierrc.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
trailingComma = "es5"
2+
tabWidth = 2
3+
semi = true
4+
singleQuote = true

.storybook/addons.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import '@storybook/addon-actions/register';
2+
import '@storybook/addon-links/register';

.storybook/config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { configure } from "@storybook/react";
2+
3+
configure(require.context("../src", true, /\.?stories\.tsx$/), module);

.storybook/webpack.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = ({ config }) => {
2+
config.module.rules.push({
3+
test: /\.(ts|tsx)$/,
4+
use: [
5+
{
6+
loader: require.resolve("awesome-typescript-loader")
7+
},
8+
// Optional
9+
{
10+
loader: require.resolve("react-docgen-typescript-loader")
11+
}
12+
]
13+
});
14+
config.resolve.extensions.push(".ts", ".tsx");
15+
return config;
16+
};

0 commit comments

Comments
 (0)