Skip to content

Commit

Permalink
Add .eslintrc
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusGertdenken committed Nov 18, 2022
1 parent 21a1c4f commit a2cadf8
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 17 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ async function createChaynsApp({
templateSharedPath
)
});
await copyFile(getTemplatePath(`../templates/api-v5/shared/ts/.eslintrc`), path.join(destination, '.eslintrc'));
}

// Main template
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { counterSliceName } from './slice';

export const selectCounterState = (state) => state[counterSliceName];

export const selectCounterValue = (state) => selectCounterState(state).value;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createSlice } from '@reduxjs/toolkit';

const initialState = { value: 0 };

const counterSlice = createSlice({
const slice = createSlice({
name: 'counter',
initialState,
reducers: {
Expand All @@ -18,6 +18,6 @@ const counterSlice = createSlice({
},
});

export const { increment, decrement, incrementByAmount } = counterSlice.actions;
export const counterReducer = counterSlice.reducer;
export const counterSliceName = counterSlice.name;
export const { increment, decrement, incrementByAmount } = slice.actions;
export const counterReducer = slice.reducer;
export const counterSliceName = slice.name;
2 changes: 1 addition & 1 deletion templates/api-v5/shared/js/src/redux-modules/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { configureStore, combineReducers } from '@reduxjs/toolkit';
import { counterReducer } from './counter/counterSlice';
import { counterReducer } from './counter/slice';

const rootReducer = combineReducers({
counter: counterReducer
Expand Down
2 changes: 1 addition & 1 deletion templates/api-v5/shared/js/template-package-redux.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@reduxjs/toolkit": "^1.8.6"
},
"devDependencies": {
"chayns-toolkit": "^2.0.0-beta.26",
"chayns-toolkit": "^2.0.0",
"prettier": "^2.7.1",
"prettier-plugin-packagejson": "^2.3.0"
}
Expand Down
2 changes: 1 addition & 1 deletion templates/api-v5/shared/js/template-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"chayns-api": "^1.0.0"
},
"devDependencies": {
"chayns-toolkit": "^2.0.0-beta.26",
"chayns-toolkit": "^2.0.0",
"prettier": "^2.7.1",
"prettier-plugin-packagejson": "^2.3.0"
}
Expand Down
17 changes: 17 additions & 0 deletions templates/api-v5/shared/ts/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": [
"@chayns-toolkit"
],
"rules": {
"no-param-reassign": [
"error",
{
"props": true,
"ignorePropertyModificationsFor": [
"state"
]
}
]
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { counterSliceName } from './slice';
import { RootState } from '../index';

export const selectCounterState = (state: RootState) => state[counterSliceName];

export const selectCounterValue = (state: RootState) => selectCounterState(state).value;
2 changes: 1 addition & 1 deletion templates/api-v5/shared/ts/src/redux-modules/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { configureStore, combineReducers } from '@reduxjs/toolkit';
import { counterReducer } from './counter/counterSlice';
import { counterReducer } from './counter/slice';

const rootReducer = combineReducers({
counter: counterReducer
Expand Down
2 changes: 1 addition & 1 deletion templates/api-v5/shared/ts/template-package-redux.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@reduxjs/toolkit": "^1.8.6"
},
"devDependencies": {
"chayns-toolkit": "^2.0.0-beta.26",
"chayns-toolkit": "^2.0.0",
"prettier": "^2.7.1",
"prettier-plugin-packagejson": "^2.3.0",
"typescript": "^4.8.4",
Expand Down
2 changes: 1 addition & 1 deletion templates/api-v5/shared/ts/template-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"chayns-api": "^1.0.0"
},
"devDependencies": {
"chayns-toolkit": "^2.0.0-beta.26",
"chayns-toolkit": "^2.0.0",
"prettier": "^2.7.1",
"prettier-plugin-packagejson": "^2.3.0",
"typescript": "^4.8.4",
Expand Down

0 comments on commit a2cadf8

Please sign in to comment.