widoz / konomi Goto Github PK
View Code? Open in Web Editor NEWA WordPress Plugin to save posts as favorites based on Interactivity Api
License: GNU General Public License v2.0
A WordPress Plugin to save posts as favorites based on Interactivity Api
License: GNU General Public License v2.0
Update the tsconfig.json
file with the following rules
{
"compilerOptions": {
"target": "ES2022",
"alwaysStrict": true,
"exactOptionalPropertyTypes": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strict": true,
"useUnknownInCatchVariables": true,
"resolveJsonModule": true,
"sourceMap": true,
"skipLibCheck": true,
"esModuleInterop": true,
"baseUrl": "./",
"module": "nodeNext",
"moduleResolution": "NodeNext",
"typeRoots": ["./node_modules/@types"],
"paths": {
"@/*": ["./src/*"],
"@model/*": ["./src/model/*"],
"*": ["node_modules/*", "types/*"]
},
"rootDir": "./"
},
"files": ["./index.ts"],
"include": ["./src/**/*.ts"],
"exclude": ["node_modules", "tests"]
}
Permit a configuration that activate both or one of them; Like and Bookmark. Possiblity to customize further each of those modules.
To consume the configuration, do we want to use zod or just a simple Immutable Map? Or both?
Make possible for the end user to organize bookmarks by categories
The Wp env might not be a good fit for development, expecially if we want to have xdebug support in unit tests.
Not sure if make actually sense rather then doing everything in CI. But I would really like to have xdebug active locally for code coverage while writing tests to ensure the right paths are taken by the tested code.
A list of possibilities
Reading the latest codebase of the WordPress scripts, I'm no longer sure it make sense to inherit all of that configuration.
I have to read it more carefull and understand if what we are adding to our webpack config is valid or not.
By default the rules have to extend WordPress, similar to Wp Entities Search (see first code sample) but I would like to introduce custom rules I have in Assets Artifacts Action (second code sample)
module.exports = {
extends: [ 'plugin:@wordpress/eslint-plugin/recommended' ],
ignorePatterns: [ '**/sources/server/**/*.js' ],
rules: {
'@wordpress/dependency-group': 'error',
'@wordpress/i18n-text-domain': [
'error',
{
allowedTextDomain: 'wp-entities-search',
},
],
'@typescript-eslint/array-type': [ 'error', { default: 'generic' } ],
},
settings: {
'import/resolver': {
typescript: {},
},
},
};
{
"env": {
"browser": false,
"es2023": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"overrides": [
{
"env": {
"node": true
},
"files": [
".eslintrc.{js,cjs}"
],
"parserOptions": {
"sourceType": "script"
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"consistent-return": "off",
"dot-notation": "off",
"init-declarations": "off",
"no-undef-init": "error",
"max-params": "off",
"no-implicit-globals": "error",
"no-throw-literal": "off",
"no-useless-constructor": "off",
"prefer-promise-reject-errors": "off",
"no-return-await": "off",
"@typescript-eslint/consistent-indexed-object-style": "warn",
"@typescript-eslint/prefer-literal-enum-member": "warn",
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/no-useless-template-literals": "error",
"@typescript-eslint/prefer-find": "error",
"@typescript-eslint/non-nullable-type-assertion-style": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-useless-empty-export": "error",
"@typescript-eslint/no-unsafe-unary-minus": "error",
"@typescript-eslint/prefer-promise-reject-errors": "error",
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/prefer-readonly-parameter-types": "error",
"@typescript-eslint/prefer-reduce-type-parameter": "error",
"@typescript-eslint/consistent-return": "error",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/no-array-delete": "error",
"@typescript-eslint/no-dynamic-delete": "error",
"@typescript-eslint/no-confusing-void-expression": "error",
"@typescript-eslint/no-mixed-enums": "error",
"@typescript-eslint/prefer-enum-initializers": "error",
"@typescript-eslint/no-throw-literal": "error",
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/prefer-ts-expect-error": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/restrict-template-expressions": "error",
"@typescript-eslint/return-await": "error",
"@typescript-eslint/strict-boolean-expressions": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/init-declarations": [
"error",
"always"
],
"@typescript-eslint/consistent-generic-constructors": [
"error",
"type-annotation"
],
"@typescript-eslint/array-type": [
"warn",
{
"default": "generic"
}
],
"@typescript-eslint/parameter-properties": [
"warn",
{
"prefer": "parameter-property"
}
],
"@typescript-eslint/max-params": [
"error",
{
"max": 3
}
],
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports",
"fixStyle": "separate-type-imports"
}
],
"@typescript-eslint/method-signature-style": [
"error",
"property"
]
}
}
If Inpsyde or WordPress coding standard
We need the scheleton where to place the configuration options.
I imagine a classic Wp Setting Page where the control are React Controls and the options are stored via REST.
@wordpress/interactivity
modulewp-api-fetch
script when necessary.findLike
if possible to findItem->filter('like')
or something similar. Highly depends on how we can generalize the implementation on top of it and how can we assume we're working with the right data format.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.