Skip to content

Commit c021f2f

Browse files
committed
modernize
1 parent ef388ef commit c021f2f

File tree

158 files changed

+7754
-19113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+7754
-19113
lines changed

.eslintrc

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

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
## feathers-hooks-common
22

3+
### WIP Changes:
4+
5+
- added alterData, alterResult, deprecated alterItems
6+
- added discardData, discardResult, deprecated discard
7+
- moved to omitData, omitResult, deprecated omit
8+
- added keepData, keepResult, deprecated keep
9+
- moved to pickData, pickResult, deprecated pick
10+
- added lowercaseData, lowercaseResult, deprecated lowercase
11+
- added setNowData, setNowResult, deprecated setNow
12+
13+
- added getDataIsArray, getResultIsArray, deprecated getItems
14+
- added replaceData, replaceResult, deprecated replaceItems
15+
16+
- removed several checks that are handled by typescript
17+
- removed check for `preventChanges(true, ...fieldNames)`
18+
19+
- renamed 'keepQuery' to 'pickQuery', added alias
20+
321
<p align="center">
422
<img src="https://hooks-common.feathersjs.com/feathers-hooks-common-logo.png" width="200">
523
</p>

docs/.vitepress/config.mts

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
1-
import { defineConfig } from "vitepress";
2-
import { name, description, ogUrl, ogImage } from "./meta";
3-
import { version } from '../../package.json'
1+
import { defineConfig } from 'vitepress';
2+
import { name, description, ogUrl, ogImage } from './meta';
3+
import { version } from '../../package.json';
44

55
export default defineConfig({
6-
title: "feathers-hooks-common",
6+
title: 'feathers-hooks-common',
77
lastUpdated: true,
8-
description: "",
8+
description: '',
99
head: [
10-
["meta", { name: "theme-color", content: "#ae0bb1" }],
11-
["link", { rel: "icon", href: "/feathers-hooks-common-logo.png" }],
12-
["meta", { property: "og:title", content: name }],
13-
["meta", { property: "og:description", content: description }],
14-
["meta", { property: "og:url", content: ogUrl }],
15-
["meta", { property: "og:image", content: ogImage }],
16-
["meta", { name: "twitter:title", content: name }],
17-
["meta", { name: "twitter:description", content: description }],
18-
["meta", { name: "twitter:image", content: ogImage }],
19-
["meta", { name: "twitter:card", content: "summary_large_image" }],
10+
['meta', { name: 'theme-color', content: '#ae0bb1' }],
11+
['link', { rel: 'icon', href: '/feathers-hooks-common-logo.png' }],
12+
['meta', { property: 'og:title', content: name }],
13+
['meta', { property: 'og:description', content: description }],
14+
['meta', { property: 'og:url', content: ogUrl }],
15+
['meta', { property: 'og:image', content: ogImage }],
16+
['meta', { name: 'twitter:title', content: name }],
17+
['meta', { name: 'twitter:description', content: description }],
18+
['meta', { name: 'twitter:image', content: ogImage }],
19+
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
2020
],
2121
themeConfig: {
22-
siteTitle: "feathers-hooks-common",
22+
siteTitle: 'feathers-hooks-common',
2323
editLink: {
2424
pattern:
25-
"https://github.com/feathersjs-ecosystem/feathers-hooks-common/edit/master/docs/:path",
25+
'https://github.com/feathersjs-ecosystem/feathers-hooks-common/edit/master/docs/:path',
2626
},
27-
lastUpdatedText: "Last Updated",
27+
lastUpdatedText: 'Last Updated',
2828
socialLinks: [
2929
{
30-
icon: "twitter",
31-
link: "https://twitter.com/feathersjs",
30+
icon: 'twitter',
31+
link: 'https://twitter.com/feathersjs',
3232
},
3333
{
34-
icon: "discord",
35-
link: "https://discord.gg/qa8kez8QBx",
34+
icon: 'discord',
35+
link: 'https://discord.gg/qa8kez8QBx',
3636
},
3737
{
38-
icon: "github",
39-
link: "https://github.com/feathersjs-ecosystem/feathers-hooks-common",
38+
icon: 'github',
39+
link: 'https://github.com/feathersjs-ecosystem/feathers-hooks-common',
4040
},
4141
],
42-
logo: "/feathers-hooks-common-logo.png",
42+
logo: '/feathers-hooks-common-logo.png',
4343
sidebar: [
4444
{
45-
text: "Guide",
45+
text: 'Guide',
4646
items: [
47-
{ text: "Overview", link: "/overview" },
48-
{ text: "Hooks", link: "/hooks" },
49-
{ text: "Utilities", link: "/utilities" },
50-
{ text: "Migrating", link: "/migrating" },
51-
{ text: "Guides", link: "/guides" },
47+
{ text: 'Overview', link: '/overview' },
48+
{ text: 'Hooks', link: '/hooks' },
49+
{ text: 'Utilities', link: '/utilities' },
50+
{ text: 'Migrating', link: '/migrating' },
51+
{ text: 'Guides', link: '/guides' },
5252
],
5353
},
5454
],
@@ -58,23 +58,23 @@ export default defineConfig({
5858
items: [
5959
{
6060
text: 'Changelog',
61-
link: 'https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/CHANGELOG.md'
61+
link: 'https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/CHANGELOG.md',
6262
},
6363
{
6464
text: 'Contributing',
65-
link: 'https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/.github/contributing.md'
66-
}
67-
]
68-
}
65+
link: 'https://github.com/feathersjs-ecosystem/feathers-hooks-common/blob/master/.github/contributing.md',
66+
},
67+
],
68+
},
6969
],
7070
footer: {
71-
message: "Released under the MIT License.",
72-
copyright: "Copyright © 2016-present Feathers contributors",
71+
message: 'Released under the MIT License.',
72+
copyright: 'Copyright © 2016-present Feathers contributors',
7373
},
7474
algolia: {
7575
appId: '4GNLWKU0RF',
7676
apiKey: '8114a3bec3c82b65c26a4ed113659bce',
77-
indexName: 'feathers-hooks'
78-
}
77+
indexName: 'feathers-hooks',
78+
},
7979
},
8080
});

docs/.vitepress/meta.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export const name = "feathers-hooks-common";
2-
export const description = "Common hooks and utils for FeathersJS apps";
1+
export const name = 'feathers-hooks-common';
2+
export const description = 'Common hooks and utils for FeathersJS apps';
33

4-
export const ogUrl = "https://hooks-common.feathersjs.com/";
5-
export const ogImage = "https://hooks-common.feathersjs.com/feathers-hooks-common-logo.png";
4+
export const ogUrl = 'https://hooks-common.feathersjs.com/';
5+
export const ogImage = 'https://hooks-common.feathersjs.com/feathers-hooks-common-logo.png';

docs/.vitepress/theme/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import Theme from 'vitepress/theme'
2-
import '../style/main.css'
1+
import Theme from 'vitepress/theme';
2+
import '../style/main.css';
33

44
export default {
55
...Theme,
6-
}
6+
};

eslint.config.mjs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
4+
import eslintPluginImportX from 'eslint-plugin-import-x';
5+
import tsParser from '@typescript-eslint/parser';
6+
7+
export default tseslint.config(
8+
{
9+
ignores: [
10+
'**/node_modules',
11+
'**/dist',
12+
'**/coverage',
13+
'docs/.vitepress/cache',
14+
'docs/.vitepress/dist',
15+
],
16+
},
17+
eslint.configs.recommended,
18+
// eslint-disable-next-line import-x/no-named-as-default-member
19+
tseslint.configs.recommended,
20+
{
21+
rules: {
22+
// unset js rules
23+
'no-unused-vars': 'off',
24+
'@typescript-eslint/no-explicit-any': 'off',
25+
},
26+
},
27+
eslintPluginImportX.flatConfigs.recommended,
28+
eslintPluginImportX.flatConfigs.typescript,
29+
{
30+
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
31+
ignores: ['eslint.config.js'],
32+
languageOptions: {
33+
parser: tsParser,
34+
ecmaVersion: 'latest',
35+
sourceType: 'module',
36+
},
37+
rules: {
38+
'import-x/no-dynamic-require': 'warn',
39+
'import-x/no-nodejs-modules': 'off',
40+
},
41+
},
42+
{
43+
files: ['**/*.test.ts'],
44+
rules: {
45+
'@typescript-eslint/no-explicit-any': 'off',
46+
'@typescript-eslint/ban-ts-comment': 'off',
47+
'@typescript-eslint/no-unused-vars': 'off',
48+
},
49+
},
50+
eslintPluginPrettierRecommended,
51+
);

0 commit comments

Comments
 (0)