Skip to content

Commit 082c191

Browse files
authored
Merge pull request #56 from natterstefan/next
2 parents 6e3bb6d + 2e649ce commit 082c191

61 files changed

Lines changed: 16535 additions & 22974 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/**/*.d.ts

.eslintrc.js

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,68 @@
11
const path = require('path')
22

33
module.exports = {
4-
extends: 'eslint-config-ns',
4+
extends: [
5+
'eslint-config-ns',
6+
// add typescript specific linting rules and add prettier typescript support
7+
'plugin:@typescript-eslint/recommended',
8+
'prettier/@typescript-eslint',
9+
],
10+
parser: '@typescript-eslint/parser',
511
plugins: ['react-hooks'],
612
globals: {
713
__DEV__: true,
814
},
915
rules: {
10-
'jest/prefer-strict-equal': 'error',
16+
'import/extensions': 0,
17+
'import/order': [
18+
'error',
19+
{
20+
pathGroups: [
21+
{
22+
pattern: 'react-component-catalog',
23+
group: 'external',
24+
position: 'after',
25+
},
26+
],
27+
},
28+
],
1129
'no-underscore-dangle': 0,
1230
'sort-keys': 0,
31+
32+
// jest settings
33+
'jest/prefer-strict-equal': 'error',
34+
35+
// react settings
1336
'react/jsx-props-no-spreading': 0,
1437
'react/prop-types': 0,
1538
'react-hooks/rules-of-hooks': 'error',
1639
'react-hooks/exhaustive-deps': 'error',
40+
41+
// typescript settings
42+
'@typescript-eslint/explicit-function-return-type': 0,
43+
'@typescript-eslint/no-explicit-any': 0,
44+
'@typescript-eslint/no-unused-vars': [
45+
'error',
46+
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
47+
],
48+
'@typescript-eslint/interface-name-prefix': [
49+
2,
50+
{
51+
prefixWithI: 'always',
52+
allowUnderscorePrefix: true,
53+
},
54+
],
1755
},
1856
overrides: [
1957
{
20-
files: ['*.test.js'],
58+
files: ['*.test.ts', '*.test.tsx'],
2159
rules: {
2260
'import/no-extraneous-dependencies': 0,
2361
'max-classes-per-file': 0,
2462
'no-console': 0,
63+
// lets loosen the typescript rules in test files a little
64+
'@typescript-eslint/explicit-function-return-type': 0,
65+
'@typescript-eslint/no-explicit-any': 0,
2566
},
2667
},
2768
],
@@ -34,6 +75,12 @@ module.exports = {
3475
['Base', path.resolve(__dirname, 'example/client/base')],
3576
],
3677
},
78+
node: {
79+
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts'],
80+
},
81+
},
82+
react: {
83+
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
3784
},
3885
},
3986
}

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# OS, IDE, ...
22
.DS_Store
3-
.vscode
43

54
# Logs and Testing
65
coverage
@@ -10,9 +9,17 @@ coverage
109
node_modules
1110
tmp
1211

12+
# Linting
13+
.eslintcache
14+
1315
# build
16+
.awcache
17+
build
1418
dist
1519
es
1620
esm
1721
lib
1822
*.tgz
23+
24+
# typescript declaration files generated by tsc in src
25+
src/**/*.d.ts

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.12
1+
12.12.0

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
nodejs 12.12.0
2+
yarn 1.21.1

.travis.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
language: node_js
22

3+
env:
4+
global:
5+
- YARN_VERSION="1.21.1"
6+
37
node_js:
48
- "node"
59

10+
before_install:
11+
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION
12+
- export PATH="$HOME/.yarn/bin:$PATH"
13+
14+
install:
15+
- yarn
16+
617
script:
7-
- npm run test
8-
- npm run build
9-
- npm run size
18+
- yarn test
19+
- yarn build
20+
- yarn size
1021

1122
notifications:
1223
email:
@@ -15,6 +26,7 @@ notifications:
1526
after_success: "npm run coveralls"
1627

1728
cache:
29+
yarn: true
1830
directories:
1931
- ~/.npm # cache npm's cache
2032
- ~/npm # cache latest npm

.vscode/launch.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Jest: Debug Tests",
6+
"type": "node",
7+
"request": "launch",
8+
"runtimeArgs": [
9+
"--inspect-brk",
10+
"${workspaceRoot}/node_modules/.bin/jest",
11+
"--runInBand",
12+
"--detectOpenHandles"
13+
],
14+
"console": "integratedTerminal",
15+
"internalConsoleOptions": "neverOpen",
16+
"port": 9229
17+
},
18+
{
19+
"type": "node",
20+
"request": "launch",
21+
"name": "Jest: All Tests",
22+
"program": "${workspaceFolder}/node_modules/.bin/jest",
23+
"args": ["--runInBand", "--detectOpenHandles"],
24+
"console": "integratedTerminal",
25+
"internalConsoleOptions": "neverOpen",
26+
"disableOptimisticBPs": true,
27+
"windows": {
28+
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
29+
}
30+
},
31+
{
32+
"type": "node",
33+
"request": "launch",
34+
"name": "Jest: Current File",
35+
"program": "${workspaceFolder}/node_modules/.bin/jest",
36+
"args": ["${file}", "--detectOpenHandles"],
37+
"console": "integratedTerminal",
38+
"internalConsoleOptions": "neverOpen",
39+
"disableOptimisticBPs": true,
40+
"windows": {
41+
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
42+
}
43+
}
44+
]
45+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
All notable changes to this project will be documented here. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
44

55

6+
## [2.0.0-beta.0](https://github.com/natterstefan/react-component-catalog/compare/v1.3.0...v2.0.0-beta.0) (2019-12-15)
7+
8+
9+
### Features
10+
11+
* js -> ts ([#47](https://github.com/natterstefan/react-component-catalog/issues/47)) ([a57e291](https://github.com/natterstefan/react-component-catalog/commit/a57e291e86e0d273bc168fafad584839bad77d61))
12+
613
## [1.3.0](https://github.com/natterstefan/react-component-catalog/compare/v1.2.0...v1.3.0) (2019-11-18)
714

815

0 commit comments

Comments
 (0)