Skip to content

Commit 7b35e6f

Browse files
committed
feat: Migrate to TypeScript
1 parent d91abc9 commit 7b35e6f

File tree

191 files changed

+4101
-5502
lines changed

Some content is hidden

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

191 files changed

+4101
-5502
lines changed

.babelrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

.eslintignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
benchmark/fixtures/
2+
lib/
13
src/__tests__/fixtures/
2-
dist/
3-
flow-typed/
44
website/node_modules
55
website/dist/

.eslintrc.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
'use strict';
2+
13
module.exports = {
2-
parser: 'babel-eslint',
4+
root: true,
35
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
46
parserOptions: {
57
ecmaVersion: 2020,
@@ -15,18 +17,25 @@ module.exports = {
1517
node: true,
1618
es6: true,
1719
},
18-
globals: {
19-
ASTNode: true,
20-
NodePath: true,
21-
$Exact: true,
22-
},
2320
overrides: [
2421
{
25-
files: 'website/**/*.js',
26-
env: { browser: true },
22+
files: ['*rc.js', '*.config.js'],
23+
parserOptions: {
24+
ecmaVersion: 2019,
25+
sourceType: 'script',
26+
},
27+
rules: {
28+
strict: ['error', 'global'],
29+
},
30+
},
31+
{
32+
files: '**/*.ts',
33+
parser: '@typescript-eslint/parser',
34+
plugins: ['@typescript-eslint'],
35+
extends: ['plugin:@typescript-eslint/recommended'],
2736
rules: {
28-
// conflicts with jsx
29-
'no-unused-vars': 'off',
37+
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
38+
'@typescript-eslint/ban-ts-comment': 'off',
3039
},
3140
},
3241
{

.flowconfig

Lines changed: 0 additions & 13 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/dist
1+
/lib
22
node_modules/
33
.idea/
44
coverage/

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
src/__tests__/fixtures/
2-
dist/
2+
benchmark/fixtures/
3+
lib/

.prettierrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"overrides": [{
1212
"files": [
1313
"bin/react-docgen.js",
14-
"bin/__tests__/example/**/*.js"
14+
"bin/__tests__/__fixtures__/**/*.js"
1515
],
1616
"options": {
1717
"trailingComma": "es5"
1818
}
1919
}]
20-
}
20+
}

benchmark/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "react-docgen-benchmark",
3+
"private": true,
4+
"description": "Generate benchmarks for react-docgen",
5+
"scripts": {
6+
"start": "node --expose-gc ./index.js"
7+
},
8+
"license": "MIT",
9+
"dependencies": {
10+
"benchmark": "2.1.4",
11+
"cli-table": "0.3.5"
12+
}
13+
}

benchmark/yarn.lock

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2+
# yarn lockfile v1
3+
4+
5+
6+
version "2.1.4"
7+
resolved "https://registry.yarnpkg.com/benchmark/-/benchmark-2.1.4.tgz#09f3de31c916425d498cc2ee565a0ebf3c2a5629"
8+
integrity sha1-CfPeMckWQl1JjMLuVloOvzwqVik=
9+
dependencies:
10+
lodash "^4.17.4"
11+
platform "^1.3.3"
12+
13+
14+
version "0.3.5"
15+
resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.5.tgz#643508c1d6b6e7b02c82c18afd5fcc8b6dab3ca6"
16+
integrity sha512-7uo2+RMNQUZ13M199udxqwk1qxTOS53EUak4gmu/aioUpdH5RvBz0JkJslcWz6ABKedZNqXXzikMZgHh+qF16A==
17+
dependencies:
18+
colors "1.0.3"
19+
20+
21+
version "1.0.3"
22+
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
23+
integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=
24+
25+
lodash@^4.17.4:
26+
version "4.17.21"
27+
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
28+
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
29+
30+
platform@^1.3.3:
31+
version "1.3.6"
32+
resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7"
33+
integrity sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==
File renamed without changes.

0 commit comments

Comments
 (0)