mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-03 14:57:22 +03:00
Merge pull request #1208 from acelaya-forks/feature/update-coding-standard
Update to JS coding standard v2.5.0
This commit is contained in:
commit
5549aaacbb
8 changed files with 1770 additions and 968 deletions
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
|
@ -12,11 +12,11 @@ updates:
|
|||
fontawesome:
|
||||
patterns:
|
||||
- '@fortawesome/*'
|
||||
eslint:
|
||||
eslint-plugins: # TODO Add eslint back once updated to v9
|
||||
patterns:
|
||||
- '@shlinkio/eslint-config-js-coding-standard'
|
||||
- '@typescript-eslint/*'
|
||||
- 'eslint'
|
||||
- 'eslint-plugin-*'
|
||||
shlink:
|
||||
patterns:
|
||||
- '@shlinkio/*'
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
shlink_web_client_node:
|
||||
user: 1000:1000
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
shlink_web_client_node:
|
||||
container_name: shlink_web_client_node
|
||||
|
|
2714
package-lock.json
generated
2714
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -57,7 +57,7 @@
|
|||
"workbox-strategies": "^7.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@shlinkio/eslint-config-js-coding-standard": "~2.4.1",
|
||||
"@shlinkio/eslint-config-js-coding-standard": "~2.5.0",
|
||||
"@shlinkio/stylelint-config-css-coding-standard": "~1.1.1",
|
||||
"@testing-library/jest-dom": "^6.4.5",
|
||||
"@testing-library/react": "^15.0.7",
|
||||
|
@ -74,6 +74,10 @@
|
|||
"axe-core": "^4.9.1",
|
||||
"chalk": "^5.3.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||
"eslint-plugin-react": "^7.34.2",
|
||||
"eslint-plugin-react-hooks": "^4.6.2",
|
||||
"eslint-plugin-simple-import-sort": "^12.1.0",
|
||||
"history": "^5.3.0",
|
||||
"jsdom": "^24.1.0",
|
||||
"sass": "^1.77.4",
|
||||
|
|
|
@ -44,4 +44,4 @@ export const isNotFoundServer = (server: SelectedServer): server is NotFoundServ
|
|||
|
||||
export const getServerId = (server: SelectedServer) => (isServerWithId(server) ? server.id : '');
|
||||
|
||||
export const serverWithIdToServerData = ({ id, autoConnect, ...server }: ServerWithId): ServerData => server;
|
||||
export const serverWithIdToServerData = ({ name, url, apiKey }: ServerWithId): ServerData => ({ name, url, apiKey });
|
||||
|
|
|
@ -44,8 +44,8 @@ export const { actions, reducer } = createSlice({
|
|||
},
|
||||
},
|
||||
deleteServer: (state, { payload }) => {
|
||||
const { [payload.id]: deletedServer, ...rest } = state;
|
||||
return rest;
|
||||
delete state[payload.id];
|
||||
return state;
|
||||
},
|
||||
setAutoConnect: {
|
||||
prepare: ({ id: serverId }: ServerWithId, autoConnect: boolean) => ({
|
||||
|
|
|
@ -107,7 +107,9 @@ describe('serversReducer', () => {
|
|||
});
|
||||
|
||||
it('generates an id for every provided server if they do not have it', () => {
|
||||
const servers = Object.values(list).map(({ id, ...rest }) => rest);
|
||||
const servers = Object.values(list).map(({ name, autoConnect, url, apiKey }) => (
|
||||
{ name, autoConnect, url, apiKey }
|
||||
));
|
||||
const { payload } = createServers(servers);
|
||||
|
||||
expect(Object.values(payload).every(({ id }) => !!id)).toEqual(true);
|
||||
|
|
Loading…
Reference in a new issue