Skip to content

Commit 4f118f2

Browse files
committed
cleaned tslint.json
1 parent 341ffb8 commit 4f118f2

8 files changed

+3461
-170
lines changed

.storybook/addons.js

Whitespace-only changes.

.storybook/config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {
2+
configure
3+
} from '@storybook/react';
4+
const req = require.context('../src/components', true, /.stories.tsx$/);
5+
6+
function loadStories() {
7+
req.keys().forEach(req);
8+
}
9+
configure(loadStories, module);

.storybook/tsconfig.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": "./",
4+
"allowSyntheticDefaultImports": true,
5+
"module": "es2015",
6+
"target": "es5",
7+
"lib": ["es6", "dom"],
8+
"sourceMap": true,
9+
"allowJs": false,
10+
"jsx": "react",
11+
"moduleResolution": "node",
12+
"rootDir": "../",
13+
"outDir": "dist",
14+
"noImplicitReturns": true,
15+
"noImplicitThis": true,
16+
"noImplicitAny": true,
17+
"strictNullChecks": true,
18+
"declaration": true
19+
},
20+
"include": [
21+
"src/**/*"
22+
],
23+
"exclude": [
24+
"node_modules",
25+
"build",
26+
"dist",
27+
"scripts",
28+
"acceptance-tests",
29+
"webpack",
30+
"jest",
31+
"src/setupTests.ts",
32+
"**/*/*.test.ts",
33+
"examples"
34+
]
35+
}

.storybook/webpack.config.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const path = require("path");
2+
const SRC_PATH = path.join(__dirname, '../src');
3+
const STORIES_PATH = path.join(__dirname, '../stories');
4+
//dont need stories path if you have your stories inside your //components foldermodule.exports = ({config}) => {
5+
config.module.rules.push({
6+
test: /\.(ts|tsx)$/,
7+
include: [SRC_PATH, STORIES_PATH],
8+
use: [{
9+
loader: require.resolve(’awesome - typescript - loader’),
10+
options: {
11+
configFileName: './.storybook/tsconfig.json'
12+
}
13+
},
14+
{
15+
loader: require.resolve(’react - docgen - typescript - loader’)
16+
}
17+
]
18+
});
19+
config.resolve.extensions.push(.ts’, '.tsx’);
20+
return config;
21+
};

package.json

+10-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
"dependencies": {
1010
"@babel/plugin-transform-runtime": "^7.10.1",
1111
"@n8tb1t/use-scroll-position": "^1.0.43",
12+
"@storybook/react": "^5.3.19",
1213
"@testing-library/jest-dom": "^4.2.4",
1314
"@testing-library/react": "^9.3.2",
1415
"@testing-library/user-event": "^7.1.2",
1516
"@types/emoji-mart": "^2.11.0",
1617
"@types/invariant": "^2.2.31",
17-
"@types/jest": "^24.0.0",
18+
"@types/jest": "^26.0.5",
1819
"@types/node": "^12.0.0",
1920
"@types/pubnub": "^4.27.2",
2021
"@types/react": "^16.9.0",
@@ -62,7 +63,8 @@
6263
"start": "webpack-dev-server --mode development --open --hot",
6364
"dev": "webpack-dev-server --mode development --open --hot",
6465
"build": "webpack --mode production",
65-
"firehose": "node src/tools/firehose.js start liveeventdemo.row1"
66+
"firehose": "node src/tools/firehose.js start liveeventdemo.row1",
67+
"storybook": "start-storybook -p 9001 -c .storybook"
6668
},
6769
"eslintConfig": {
6870
"extends": "react-app"
@@ -75,15 +77,21 @@
7577
"@babel/preset-env": "^7.6.3",
7678
"@babel/preset-react": "^7.6.3",
7779
"@babel/preset-typescript": "7.9.0",
80+
"@storybook/addon-info": "^5.3.19",
7881
"@typescript-eslint/eslint-plugin": "^3.6.0",
7982
"@typescript-eslint/parser": "^3.6.0",
83+
"awesome-typescript-loader": "^5.2.1",
8084
"babel-eslint": "^10.1.0",
8185
"babel-loader": "^8.1.0",
8286
"eslint": "^7.4.0",
8387
"eslint-config-prettier": "^6.11.0",
8488
"eslint-plugin-prettier": "^3.1.4",
89+
"jest": "^26.1.0",
8590
"prettier": "^2.0.5",
91+
"react-docgen-typescript-loader": "^3.7.2",
92+
"react-docgen-typescript-webpack-plugin": "^1.1.0",
8693
"source-map-loader": "^0.2.4",
94+
"ts-jest": "^26.1.3",
8795
"ts-loader": "^7.0.5",
8896
"typescript": "^3.9.6"
8997
},

src/index.stories.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
import {
3+
Button
4+
} from '@storybook/react/demo';
5+
6+
export default {
7+
title: 'Button'
8+
};
9+
10+
export const withText = () => < Button > Hello Button < /Button>;
11+
12+
export const withEmoji = () => ( <
13+
Button >
14+
<
15+
span role = "img"
16+
aria - label = "so cool" > 😀😎👍💯
17+
<
18+
/span> <
19+
/Button>
20+
);

tslint.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"extends": "tslint:recommended",
33
"rulesDirectory": [
4-
"path/to/custom/rules/directory/",
5-
"another/path/"
4+
65
],
76
"rules": {
87
"max-line-length": {

0 commit comments

Comments
 (0)