Skip to content

Commit f1c7759

Browse files
author
nkakuev_cg
committed
new stup
1 parent 1acd7f7 commit f1c7759

File tree

8 files changed

+2229
-8187
lines changed

8 files changed

+2229
-8187
lines changed

.eslintrc.json

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
11
{
2-
"extends": [
3-
"eslint:recommended",
4-
"plugin:react/recommended",
5-
"plugin:@typescript-eslint/recommended",
6-
"prettier/@typescript-eslint",
7-
"plugin:prettier/recommended"
8-
],
9-
"plugins": ["react", "@typescript-eslint", "prettier"],
10-
"env": {
11-
"browser": true,
12-
"jasmine": true,
13-
"jest": true
14-
},
15-
"rules": {
16-
"linebreak-style": 0,
17-
"no-unused-vars": [ "warn", { "vars": "all", "args": "all", "ignoreRestSiblings": false } ],
18-
"react/jsx-filename-extension": [ 0, { "extensions": [ ".js", ".jsx" ] } ],
19-
"no-console": 1,
20-
"prettier/prettier": 0,
21-
"no-func-assign": 0
22-
},
23-
"settings": {
24-
"react": {
25-
"pragma": "React",
26-
"version": "detect"
27-
}
28-
},
29-
"parser": "@typescript-eslint/parser"
30-
}
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"jsx": true,
5+
"useJSXTextNode": true
6+
},
7+
"extends": [ "plugin:@typescript-eslint/recommended", "prettier", "prettier/@typescript-eslint" ],
8+
"plugins": [ "@typescript-eslint" ],
9+
"rules": {
10+
"@typescript-eslint/explicit-function-return-type": "off",
11+
"react-hooks/rules-of-hooks": "error",
12+
"react-hooks/exhaustive-deps": "warn"
13+
}
14+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ typings/
4343

4444
# Optional npm cache directory
4545
.npm
46+
.vs
4647

4748
# Optional eslint cache
4849
.eslintcache

package.json

Lines changed: 17 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
"license": "MIT",
77
"scripts": {
88
"dev": "rollup -c --watch",
9-
"build": "rollup -c",
10-
"lint:fix": "eslint './src/**/*.{ts,tsx}'",
9+
"build": "rollup -c",
10+
"lint:fix": "eslint './src/**/*.{ts,tsx}'",
1111
"start": "npm-run-all --parallel dev test:watch",
1212
"test": "jest",
13-
"test:watch": "jest --watch",
14-
"storybook": "start-storybook -p 6006",
15-
"build-storybook": "build-storybook"
13+
"test:watch": "jest --watch"
1614
},
1715
"jest": {
1816
"testURL": "http://localhost/",
@@ -29,45 +27,21 @@
2927
}
3028
},
3129
"dependencies": {
32-
"react": "^16.5.0",
33-
"react-dom": "^16.5.0",
34-
"styled-components": "^3.4.9"
30+
"@types/react": "^16.8.14",
31+
"@types/react-dom": "^16.8.4",
32+
"react": "^16.8.6",
33+
"react-dom": "^16.8.6",
34+
"webpack": "^4.30.0"
3535
},
3636
"devDependencies": {
37-
"@babel/cli": "^7.0.0",
38-
"@babel/core": "^7.0.0",
39-
"@babel/plugin-transform-modules-commonjs": "^7.1.0",
40-
"@babel/preset-env": "^7.0.0",
41-
"@babel/preset-react": "^7.0.0",
42-
"@storybook/addon-actions": "^3.4.11",
43-
"@storybook/addon-links": "^3.4.11",
44-
"@storybook/addons": "^3.4.11",
45-
"@storybook/react": "^3.4.11",
46-
"@types/react": "^16.8.13",
47-
"@types/react-dom": "^16.8.4",
48-
"@typescript-eslint/eslint-plugin": "^1.6.0",
49-
"@typescript-eslint/parser": "^1.6.0",
50-
"babel-cli": "^6.26.0",
51-
"babel-core": "^6.26.3",
52-
"babel-eslint": "^10.0.1",
53-
"babel-runtime": "^6.26.0",
54-
"enzyme": "^3.3.0",
55-
"eslint": "^4.17.0",
56-
"eslint-config-prettier": "^4.1.0",
57-
"eslint-config-react": "^1.1.7",
58-
"eslint-friendly-formatter": "^4.0.1",
59-
"eslint-plugin-jsx-a11y": "^6.0.3",
60-
"eslint-plugin-prettier": "^2.6.0",
61-
"eslint-plugin-react": "^7.7.0",
62-
"jest": "^23.6.0",
63-
"npm-run-all": "^4.1.2",
64-
"prettier": "^1.10.2",
65-
"rollup-plugin-eslint": "^5.0.0",
66-
"rollup-plugin-node-resolve": "^3.4.0",
67-
"rollup-plugin-replace": "^2.1.0",
68-
"rollup-plugin-typescript2": "^0.20.1",
69-
"rollup-watch": "^4.3.1",
70-
"sinon": "^4.2.2",
71-
"typescript": "^3.4.3"
37+
"@typescript-eslint/eslint-plugin": "^1.7.0",
38+
"@typescript-eslint/parser": "^1.7.0",
39+
"awesome-typescript-loader": "^5.2.1",
40+
"eslint": "^5.16.0",
41+
"eslint-config-prettier": "^4.2.0",
42+
"eslint-plugin-react-hooks": "^1.6.0",
43+
"prettier": "^1.17.0",
44+
"source-map-loader": "^0.2.4",
45+
"typescript": "^3.4.5"
7246
}
7347
}

rollup.config.js

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

stories/index.stories.js

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

tsconfig.json

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
{
2-
"compileOnSave": true,
3-
"allowSyntheticDefaultImports": true,
42
"compilerOptions": {
5-
"target": "esnext",
6-
"moduleResolution": "node",
7-
"outDir": "dist",
8-
"declaration": true,
9-
"jsx": "react",
10-
"module": "es2015",
11-
"strict": true
3+
"outDir": "./dist/",
4+
"sourceMap": true,
5+
"noImplicitAny": true,
6+
"module": "commonjs",
7+
"target": "es6",
8+
"jsx": "react"
129
},
1310
"include": [
14-
"src/**/*"
15-
],
16-
"exclude": [
17-
"node_modules",
18-
"**/*.spec.ts"
11+
"./src/**/*"
1912
]
2013
}

webpack.config.js

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
module.exports = {
2+
entry: './src/index.tsx',
3+
output: {
4+
filename: 'index.js',
5+
path: path.resolve(__dirname, 'dist'),
6+
publicPath: '/dist',
7+
library: '',
8+
libraryTarget: 'commonjs2'
9+
},
10+
11+
devtool: 'source-map',
12+
13+
resolve: {
14+
modules: [ path.resolve(__dirname, './src'), 'node_modules' ],
15+
extensions: [ '.ts', '.tsx', '.js', '.json' ]
16+
},
17+
18+
module: {
19+
rules: [
20+
{
21+
enforce: 'pre',
22+
test: /\.tsx?$/,
23+
loader: 'eslint-loader',
24+
exclude: /node_modules/,
25+
options: {
26+
configFile: './.eslintrc.json',
27+
formatter: lintFormatter,
28+
failOnWarning: false,
29+
failOnError: false
30+
}
31+
},
32+
{ test: /\.tsx?$/, loader: 'awesome-typescript-loader' },
33+
{ enforce: 'pre', test: /\.js$/, loader: 'source-map-loader' }
34+
]
35+
},
36+
37+
externals: {
38+
react: {
39+
commonjs: 'react',
40+
commonjs2: 'react',
41+
amd: 'React',
42+
root: 'React'
43+
},
44+
'react-dom': {
45+
commonjs: 'react-dom',
46+
commonjs2: 'react-dom',
47+
amd: 'ReactDOM',
48+
root: 'ReactDOM'
49+
},
50+
'styled-components': {
51+
commonjs: 'styled-components',
52+
commonjs2: 'styled-components'
53+
}
54+
}
55+
};
56+
57+
// const path = require('path');
58+
// const webpack = require('webpack');
59+
// const lintFormatter = require('eslint-formatter-friendly');
60+
// const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
61+
62+
// module.exports = {
63+
// entry: './src/index.js',
64+
// output: {
65+
// filename: 'index.js',
66+
// path: path.resolve(__dirname, 'dist'),
67+
// publicPath: '/dist',
68+
// library: '',
69+
// libraryTarget: 'commonjs2'
70+
// },
71+
// resolve: {
72+
// modules: [ path.resolve(__dirname, './src'), 'node_modules' ],
73+
// extensions: [ '.js', '.jsx', '.json' ]
74+
// },
75+
76+
// externals: {
77+
// react: {
78+
// commonjs: 'react',
79+
// commonjs2: 'react',
80+
// amd: 'React',
81+
// root: 'React'
82+
// },
83+
// 'react-dom': {
84+
// commonjs: 'react-dom',
85+
// commonjs2: 'react-dom',
86+
// amd: 'ReactDOM',
87+
// root: 'ReactDOM'
88+
// },
89+
// 'styled-components': {
90+
// commonjs: 'styled-components',
91+
// commonjs2: 'styled-components'
92+
// }
93+
// },
94+
95+
// stats: 'errors-only',
96+
97+
// node: {
98+
// fs: 'empty'
99+
// },
100+
101+
// module: {
102+
// rules: [
103+
// {
104+
// enforce: 'pre',
105+
// test: /\.js?$/,
106+
// loader: 'eslint-loader',
107+
// exclude: /node_modules/,
108+
// options: {
109+
// configFile: './.eslintrc.json',
110+
// formatter: lintFormatter,
111+
// failOnWarning: false,
112+
// failOnError: false
113+
// }
114+
// },
115+
// {
116+
// test: /\.(eot|svg|ttf|woff|woff2)$/,
117+
// loader: 'file-loader?name=app/fonts/[name].[ext]'
118+
// },
119+
// {
120+
// test: /\.js?$/,
121+
// loader: 'babel-loader',
122+
// exclude: /node_modules/
123+
// },
124+
// {
125+
// test: /\.(png|jpg|gif)$/,
126+
// use: [
127+
// {
128+
// loader: 'file-loader',
129+
// options: {}
130+
// }
131+
// ]
132+
// }
133+
// ]
134+
// },
135+
// devtool: 'inline-source-map',
136+
137+
// plugins: [ new webpack.HotModuleReplacementPlugin(), new webpack.NamedModulesPlugin(), new UglifyJsPlugin() ]
138+
// };

0 commit comments

Comments
 (0)