Skip to content

Commit

Permalink
Updated to use eslint instead of tslint, wired up middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
nebrius committed Aug 20, 2020
1 parent fe8d34d commit 67fea9f
Show file tree
Hide file tree
Showing 29 changed files with 28,352 additions and 31,347 deletions.
29 changes: 29 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended'
],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true // Allows for the parsing of JSX
}
},
settings: {
react: {
version: 'detect' // Tells eslint-plugin-react to automatically detect the version of React to use
}
},
rules: {
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-module-boundary-types': [
'error',
{ allowArgumentsExplicitlyTypedAsAny: true }
]
}
};
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,6 @@ typings/
src
example
tsconfig.json
tslint.json
.prettierrc.json
.eslintrc.js
.vscode
9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"semi": true,
"trailingComma": "none",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2,
"bracketSpacing": true,
"jsxBracketSameLine": false
}
36 changes: 0 additions & 36 deletions .vscode/settings.json

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Reduxology <!-- omit in toc -->

**Note: this library is still in preview and there may be bugs or design decisions that need to be fleshed out. I'm grateful for any and all issues filed with bugs, feedback, and other thoughts you may have!**

1. [Installation](#installation)
2. [Usage](#usage)
1. [Actions](#actions)
Expand Down
16 changes: 9 additions & 7 deletions declarations/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
/// <reference types="react" />
import { ConnectedComponent } from 'react-redux';
import { Middleware } from 'redux';
import { Reducer } from './reducer';
declare type MapStateToProps = (getSlice: (slice: string) => any) => any;
declare type MapDispatchToProps = (dispatch: (action: string, ...data: any[]) => void) => any;
export { ActionListener } from './reducer';
export declare type MapStateToProps = (getSlice: (slice: string) => any) => any;
export declare type MapDispatchToProps = (dispatch: (action: string, ...data: any[]) => void) => any;
declare const reducers: unique symbol;
declare const store: unique symbol;
export declare class Reduxology {
private [reducers];
private [store];
createContainer: (mapStateToProps: MapStateToProps, mapDispatchToProps: MapDispatchToProps, component: any) => import("react-redux").ConnectedComponent<any, Pick<unknown, never>>;
createContainer: (mapStateToProps: MapStateToProps, mapDispatchToProps: MapDispatchToProps, component: any) => ConnectedComponent<any, Pick<unknown, never>>;
createReducer: (slice: string, initialData: any) => Reducer;
dispatch: (type: string, ...data: any[]) => void;
createRoot: (Container: any) => JSX.Element;
createRoot: (Container: any, ...middleware: Middleware[]) => JSX.Element;
}
export declare const createContainer: (mapStateToProps: MapStateToProps, mapDispatchToProps: MapDispatchToProps, component: any) => import("react-redux").ConnectedComponent<any, Pick<unknown, never>>;
export declare const createContainer: (mapStateToProps: MapStateToProps, mapDispatchToProps: MapDispatchToProps, component: any) => ConnectedComponent<any, Pick<unknown, never>>;
export declare const createReducer: (slice: string, initialData: any) => Reducer;
export declare const createRoot: (Container: any) => JSX.Element;
export declare const createRoot: (Container: any, ...middleware: Middleware[]) => JSX.Element;
export declare const dispatch: (type: string, ...data: any[]) => void;
export {};
4 changes: 2 additions & 2 deletions declarations/reducer.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Reducer as ReduxReducer } from 'redux';
export declare type ReducerActionListener = (state: any, ...actionData: any[]) => void;
export declare type ActionListener = (state: any, ...actionData: any[]) => void;
export declare const reduxReducer: unique symbol;
declare const actionHandlers: unique symbol;
export declare class Reducer {
[reduxReducer]: ReduxReducer;
private [actionHandlers];
constructor(init: any);
handle: (actionType: string, handler: ReducerActionListener) => Reducer;
handle: (actionType: string, handler: ActionListener) => Reducer;
removeHandler: (actionType: string) => void;
isHandlerRegistered: (actionType: string) => boolean;
}
Expand Down
8 changes: 4 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/reducer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/reducer.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/state.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/state.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 67fea9f

Please sign in to comment.