Skip to content

Commit

Permalink
Removed flow-types from library
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalnarkhede committed Jan 7, 2021
1 parent d14cb27 commit 3858d11
Show file tree
Hide file tree
Showing 69 changed files with 3,176 additions and 6,504 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react", "@babel/flow"],
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-runtime",
Expand Down
5 changes: 0 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
**/*{.,-}min.js
node_modules/
/lib/
/example/lib/
/examples/one/
/native-example/lib/
/native-package/lib/
/expo-package/lib/
/flow-typed/
build
dist
/docs/
Expand Down
125 changes: 84 additions & 41 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,67 +1,110 @@
{
"plugins": ["babel", "markdown"],
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:flowtype/recommended",
"plugin:react/recommended",
"plugin:jest/recommended"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"modules": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["babel", "markdown"],
"rules": {
"no-console": 0,
"no-mixed-spaces-and-tabs": 1,
"array-callback-return": 2,
"arrow-body-style": 2,
"comma-dangle": 0,
"no-unused-vars": 1,
"eqeqeq": [2, "smart"],
"no-useless-concat": 2,
"babel/no-invalid-this": 2,
"default-case": 2,
"eqeqeq": [2, "smart"],
"jest/expect-expect": 0,
"jest/no-conditional-expect": 0,
"jsx-quotes": ["error", "prefer-single"],
"linebreak-style": [2, "unix"],
"no-console": 0,
"no-mixed-spaces-and-tabs": 1,
"no-self-compare": 2,
"prefer-const": 1,
"no-underscore-dangle": [2, { "allowAfterThis": true }],
"no-unused-vars": [1, { "ignoreRestSiblings": true }],
"no-useless-concat": 2,
"no-var": 2,
"object-shorthand": 1,
"babel/no-invalid-this": 2,
"array-callback-return": 2,
"valid-typeof": 2,
"arrow-body-style": 2,
"require-await": 2,
"prefer-const": 1,
"react/prop-types": 0,
"no-var": 2,
"linebreak-style": [2, "unix"],
"require-await": 2,
"semi": [1, "always"],
"flowtype/require-valid-file-annotation": [
0,
"always",
{
"annotationStyle": "line"
}
],
"flowtype/generic-spacing": 0,
"flowtype/space-after-type-colon": 0
"valid-typeof": 2
},
"env": {
"es6": true,
"browser": true,
"commonjs": true,
"mocha": true
},
"globals": {
"process": true
},
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018,
"ecmaFeatures": {
"modules": true
"settings": {
"import/resolver": {
"babel-module": {},
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"paths": ["src"]
}
},
"react": {
"pragma": "React",
"version": "detect"
}
},
"overrides": [
{
"files": ["*.md"],
"rules": {
"no-undef": 0,
"react/jsx-no-undef": 0,
"react/react-in-jsx-scope": 0,
"semi": 0,
"no-undef": 0
"semi": 0
}
},
{
"env": {
"es6": true,
"browser": true
},
"files": ["**/*.ts", "**/*.tsx"],
"parserOptions": {
"ecmaFeatures": {
"modules": true,
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["babel", "markdown", "prettier", "react"],
"rules": {
"react-hooks/exhaustive-deps": 0,
"react-native/no-inline-styles": 0,
"array-callback-return": 2,
"arrow-body-style": 2,
"comma-dangle": 0,
"babel/no-invalid-this": 2,
"default-case": 2,
"eqeqeq": [2, "smart"],
"linebreak-style": [2, "unix"],
"jsx-quotes": ["error", "prefer-single"],
"no-console": 0,
"no-mixed-spaces-and-tabs": 1,
"no-self-compare": 2,
"no-shadow": 0,
"no-underscore-dangle": [2, { "allowAfterThis": true }],
"no-unused-vars": [1, { "ignoreRestSiblings": true }],
"no-useless-concat": 2,
"no-var": 2,
"object-shorthand": 1,
"prefer-const": 1,
"react/prop-types": 0,
"require-await": 2,
"semi": [1, "always"],
"valid-typeof": 2
}
}
]
Expand Down
13 changes: 3 additions & 10 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
{
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "always",
"jsxSingleQuote": true,
"singleQuote": true,
"tabWidth": 2,
"overrides": [
{
"files": "*.ts",
"options": {
"trailingComma": "all"
}
}
]
"trailingComma": "all"
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ In order to use Stream React Components in your application, you first need to i

```jsx
<StreamApp
apiKey="{API_KEY}"
appId="{APP_ID}"
userId="{USER_ID}"
token="{TOKEN}"
analyticsToken="{ANALYTICS_TOKEN}"
apiKey='{API_KEY}'
appId='{APP_ID}'
userId='{USER_ID}'
token='{TOKEN}'
analyticsToken='{ANALYTICS_TOKEN}'
>
{/* everything from your application interacting with Stream should be nested here */}
</StreamApp>
Expand Down
3 changes: 1 addition & 2 deletions dotgit/hooks/pre-commit-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ if ! yarn run lint; then
echo "some files were not formatted correctly (prettier/eslint) commit aborted!"
echo "your changes are still staged, you can accept formatting changes with git add or ignore them by adding --no-verify to git commit"
exit 1
fi
yarn run flow
fi
2 changes: 1 addition & 1 deletion examples/expo/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const App = () => {
<SafeAreaView style={{ flex: 1 }} forceInset={{ top: 'always' }}>
<StreamApp apiKey={apiKey} appId={appId} token={token}>
<FlatFeed Activity={renderActivity} notify />
<StatusUpdateForm feedGroup="timeline" />
<StatusUpdateForm feedGroup='timeline' />
</StreamApp>
</SafeAreaView>
);
Expand Down
7 changes: 2 additions & 5 deletions examples/expo/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
// eslint-disable-next-line no-undef
module.exports = function(api) {
api.cache(true);
return {
presets: [
'babel-preset-expo',
'@babel/preset-flow',
'module:metro-react-native-babel-preset',
],
presets: ['babel-preset-expo', 'module:metro-react-native-babel-preset'],
env: {
development: {
plugins: ['module:react-native-dotenv'],
Expand Down
4 changes: 0 additions & 4 deletions examples/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
},
"devDependencies": {
"@babel/core": "~7.9.0",
"@babel/preset-flow": "^7.12.1",
"babel-cli": "^6.26.0",
"babel-eslint": "^8.2.5",
"babel-plugin-root-import": "^6.1.0",
Expand All @@ -44,11 +43,8 @@
"babel-preset-expo": "^8.3.0",
"dotenv": "^6.0.0",
"eslint": "^5.1.0",
"eslint-plugin-flowtype": "^2.29.1",
"eslint-plugin-jest": "^21.17.0",
"eslint-plugin-react": "^7.10.0",
"flow-bin": "^0.80.0",
"flow-copy-source": "^2.0.2",
"jest-expo": "~27.0.0",
"prettier": "^1.13.7",
"react-native-scripts": "1.14.0",
Expand Down
1 change: 1 addition & 0 deletions examples/expo/scripts/initData.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-undef */
// @flow

import stream from 'getstream';
Expand Down
1 change: 1 addition & 0 deletions examples/expo/scripts/test_notification.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-undef */
// @flow
import stream from 'getstream';

Expand Down
71 changes: 0 additions & 71 deletions examples/expo/types.js

This file was deleted.

25 changes: 0 additions & 25 deletions examples/expo/utils.js

This file was deleted.

2 changes: 1 addition & 1 deletion examples/native/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const App = () => {
<SafeAreaView style={{flex: 1}} forceInset={{top: 'always'}}>
<StreamApp apiKey={apiKey} appId={appId} token={token}>
<FlatFeed Activity={renderActivity} notify />
<StatusUpdateForm feedGroup="timeline" />
<StatusUpdateForm feedGroup={'timeline'} />
</StreamApp>
</SafeAreaView>
);
Expand Down
1 change: 1 addition & 0 deletions examples/native/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line no-undef
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
env: {
Expand Down
Loading

0 comments on commit 3858d11

Please sign in to comment.