mirror of
https://github.com/pdfme/pdfme.git
synced 2026-05-19 04:11:18 -04:00
Fix eslint (#780)
* Refactor ESLint configuration: remove legacy .eslintrc.cjs files and replace with new .mjs configurations * Remove unnecessary TypeScript ignore comments and simplify async calls in barcode tests * Refactor date helper: remove TypeScript ignore comments and simplify AirDatepicker usage * Enhance date helper: add AirDatepickerDate type and improve type annotations for onSelect callback * Update TypeScript and ESLint configurations: change module to NodeNext, refine file patterns, and enhance lint command * Refactor ESLint configuration: remove unnecessary language options for TypeScript files
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
es2020: true,
|
||||
node: true,
|
||||
browser: true,
|
||||
jest: true,
|
||||
},
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@typescript-eslint/recommended-requiring-type-checking"
|
||||
],
|
||||
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.ts'],
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.esm.json'],
|
||||
},
|
||||
},
|
||||
],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
parser: 'typescript-eslint-parser',
|
||||
ecmaVersion: 2020,
|
||||
sourceType: 'module',
|
||||
},
|
||||
};
|
||||
43
eslint.config.mjs
Normal file
43
eslint.config.mjs
Normal file
@@ -0,0 +1,43 @@
|
||||
import typescriptParser from '@typescript-eslint/parser';
|
||||
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
|
||||
|
||||
export default [
|
||||
{
|
||||
ignores: ['dist/**', '**/node_modules/**'],
|
||||
},
|
||||
{
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
sourceType: 'module',
|
||||
parser: typescriptParser,
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020,
|
||||
sourceType: 'module',
|
||||
},
|
||||
globals: {
|
||||
// Browser globals
|
||||
window: 'readonly',
|
||||
document: 'readonly',
|
||||
// Node globals
|
||||
process: 'readonly',
|
||||
// Jest globals
|
||||
jest: 'readonly',
|
||||
describe: 'readonly',
|
||||
test: 'readonly',
|
||||
it: 'readonly',
|
||||
expect: 'readonly',
|
||||
beforeEach: 'readonly',
|
||||
afterEach: 'readonly',
|
||||
beforeAll: 'readonly',
|
||||
afterAll: 'readonly',
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
'@typescript-eslint': typescriptPlugin,
|
||||
},
|
||||
rules: {
|
||||
...typescriptPlugin.configs['recommended'].rules,
|
||||
...typescriptPlugin.configs['recommended-requiring-type-checking'].rules,
|
||||
},
|
||||
}
|
||||
];
|
||||
582
package-lock.json
generated
582
package-lock.json
generated
@@ -19,6 +19,7 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.16.7",
|
||||
"@humanwhocodes/config-array": "^0.13.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/jest-image-snapshot": "^6.4.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.25.0",
|
||||
@@ -1272,30 +1273,6 @@
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/config-array/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/config-array/node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/core": {
|
||||
"version": "0.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz",
|
||||
@@ -1333,17 +1310,6 @@
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/eslintrc/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/eslintrc/node_modules/globals": {
|
||||
"version": "14.0.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
|
||||
@@ -1357,19 +1323,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/eslintrc/node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/js": {
|
||||
"version": "9.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.21.0.tgz",
|
||||
@@ -1442,6 +1395,22 @@
|
||||
"url": "https://github.com/sponsors/nzakas"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/config-array": {
|
||||
"version": "0.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz",
|
||||
"integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==",
|
||||
"deprecated": "Use @eslint/config-array instead",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@humanwhocodes/object-schema": "^2.0.3",
|
||||
"debug": "^4.3.1",
|
||||
"minimatch": "^3.0.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/module-importer": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
|
||||
@@ -1456,6 +1425,14 @@
|
||||
"url": "https://github.com/sponsors/nzakas"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/object-schema": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz",
|
||||
"integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==",
|
||||
"deprecated": "Use @eslint/object-schema instead",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/@humanwhocodes/retry": {
|
||||
"version": "0.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.2.tgz",
|
||||
@@ -2820,30 +2797,6 @@
|
||||
"path-browserify": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@ts-morph/common/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@ts-morph/common/node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/aria-query": {
|
||||
"version": "5.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz",
|
||||
@@ -3036,13 +2989,6 @@
|
||||
"undici-types": "~6.20.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/offscreencanvas": {
|
||||
"version": "2019.7.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.7.3.tgz",
|
||||
"integrity": "sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/parse-json": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz",
|
||||
@@ -3285,6 +3231,32 @@
|
||||
"typescript": ">=4.8.4 <5.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
|
||||
"version": "9.0.5",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
|
||||
"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16 || 14 >=14.17"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree/node_modules/semver": {
|
||||
"version": "7.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz",
|
||||
@@ -3353,6 +3325,13 @@
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/@ungap/structured-clone": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz",
|
||||
"integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/@vitejs/plugin-react": {
|
||||
"version": "4.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.3.4.tgz",
|
||||
@@ -4270,13 +4249,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||
"dev": true,
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"devOptional": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0"
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/braces": {
|
||||
@@ -5765,28 +5745,17 @@
|
||||
"eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-react/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"node_modules/eslint-plugin-react-hooks": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.2.0.tgz",
|
||||
"integrity": "sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-react/node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
"node": ">=10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-react/node_modules/resolve": {
|
||||
@@ -5837,17 +5806,6 @@
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint/node_modules/eslint-visitor-keys": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",
|
||||
@@ -5861,19 +5819,6 @@
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint/node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/espree": {
|
||||
"version": "10.3.0",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz",
|
||||
@@ -6144,6 +6089,16 @@
|
||||
"minimatch": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/filelist/node_modules/brace-expansion": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/filelist/node_modules/minimatch": {
|
||||
"version": "5.1.6",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
||||
@@ -6693,30 +6648,6 @@
|
||||
"license": "BSD-2-Clause",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/glob/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"devOptional": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/glob/node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"devOptional": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/globals": {
|
||||
"version": "11.12.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
|
||||
@@ -7394,6 +7325,16 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-path-inside": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz",
|
||||
"integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/is-potential-custom-element-name": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz",
|
||||
@@ -7739,30 +7680,6 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/jake/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/jake/node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/jest": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz",
|
||||
@@ -8971,19 +8888,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "9.0.5",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
|
||||
"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
|
||||
"dev": true,
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"devOptional": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16 || 14 >=14.17"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/minipass": {
|
||||
@@ -9265,17 +9179,6 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all/node_modules/chalk": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||
@@ -9345,19 +9248,6 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all/node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-all/node_modules/path-key": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
|
||||
@@ -11320,6 +11210,16 @@
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/rimraf/node_modules/brace-expansion": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rimraf/node_modules/glob": {
|
||||
"version": "11.0.1",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-11.0.1.tgz",
|
||||
@@ -12492,30 +12392,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/test-exclude/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/test-exclude/node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/throttle-debounce": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-5.0.2.tgz",
|
||||
@@ -14259,7 +14135,6 @@
|
||||
"@pdfme/common": "file:../common",
|
||||
"@types/bwip-js": "^3.2.1",
|
||||
"@types/fontkit": "^2.0.4",
|
||||
"@types/offscreencanvas": "^2019.7.3",
|
||||
"@types/pngjs": "^6.0.2",
|
||||
"jsqr": "^1.4.0",
|
||||
"pngjs": "^7.0.0"
|
||||
@@ -14301,11 +14176,13 @@
|
||||
"@testing-library/react": "^12.1.2",
|
||||
"@types/react": "^17.0.52",
|
||||
"@types/react-dom": "^17.0.18",
|
||||
"@ungap/structured-clone": "^1.3.0",
|
||||
"@vitejs/plugin-react": "^4.2.0",
|
||||
"csstype": "^3.1.2",
|
||||
"esbuild": "^0.25.0",
|
||||
"eslint-plugin-react": "^7.28.0",
|
||||
"eslint-plugin-react-hooks": "^4.3.0",
|
||||
"eslint-plugin-react": "^7.37.4",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"is-path-inside": "^3.0.3",
|
||||
"jest-canvas-mock": "^2.3.1",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"process": "^0.11.10",
|
||||
@@ -14318,40 +14195,10 @@
|
||||
"@pdfme/schemas": "latest"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/@eslint/eslintrc": {
|
||||
"version": "2.1.4",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"ajv": "^6.12.4",
|
||||
"debug": "^4.3.2",
|
||||
"espree": "^9.6.0",
|
||||
"globals": "^13.19.0",
|
||||
"ignore": "^5.2.0",
|
||||
"import-fresh": "^3.2.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"minimatch": "^3.1.2",
|
||||
"strip-json-comments": "^3.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/@eslint/js": {
|
||||
"version": "8.57.1",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/@testing-library/react": {
|
||||
"version": "12.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@testing-library/react/-/react-12.1.5.tgz",
|
||||
"integrity": "sha512-OfTXCJUFgjd/digLUuPxa0+/3ZxsQmE7ub9kcbW/wi96Bh3o/p5vrETcBGfP17NWPGqeYYl5LTRpwyGoMC4ysg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -14366,207 +14213,6 @@
|
||||
"react": "<18.0.0",
|
||||
"react-dom": "<18.0.0"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/doctrine": {
|
||||
"version": "3.0.0",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"esutils": "^2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/eslint": {
|
||||
"version": "8.57.1",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.2.0",
|
||||
"@eslint-community/regexpp": "^4.6.1",
|
||||
"@eslint/eslintrc": "^2.1.4",
|
||||
"@eslint/js": "8.57.1",
|
||||
"@humanwhocodes/config-array": "^0.13.0",
|
||||
"@humanwhocodes/module-importer": "^1.0.1",
|
||||
"@nodelib/fs.walk": "^1.2.8",
|
||||
"@ungap/structured-clone": "^1.2.0",
|
||||
"ajv": "^6.12.4",
|
||||
"chalk": "^4.0.0",
|
||||
"cross-spawn": "^7.0.2",
|
||||
"debug": "^4.3.2",
|
||||
"doctrine": "^3.0.0",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"eslint-scope": "^7.2.2",
|
||||
"eslint-visitor-keys": "^3.4.3",
|
||||
"espree": "^9.6.1",
|
||||
"esquery": "^1.4.2",
|
||||
"esutils": "^2.0.2",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"file-entry-cache": "^6.0.1",
|
||||
"find-up": "^5.0.0",
|
||||
"glob-parent": "^6.0.2",
|
||||
"globals": "^13.19.0",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.2.0",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"is-glob": "^4.0.0",
|
||||
"is-path-inside": "^3.0.3",
|
||||
"js-yaml": "^4.1.0",
|
||||
"json-stable-stringify-without-jsonify": "^1.0.1",
|
||||
"levn": "^0.4.1",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"minimatch": "^3.1.2",
|
||||
"natural-compare": "^1.4.0",
|
||||
"optionator": "^0.9.3",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"text-table": "^0.2.0"
|
||||
},
|
||||
"bin": {
|
||||
"eslint": "bin/eslint.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/eslint-plugin-react-hooks": {
|
||||
"version": "4.6.2",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/eslint-scope": {
|
||||
"version": "7.2.2",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"esrecurse": "^4.3.0",
|
||||
"estraverse": "^5.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/espree": {
|
||||
"version": "9.6.1",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"acorn": "^8.9.0",
|
||||
"acorn-jsx": "^5.3.2",
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/eslint"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/file-entry-cache": {
|
||||
"version": "6.0.1",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"flat-cache": "^3.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10.12.0 || >=12.0.0"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/flat-cache": {
|
||||
"version": "3.2.0",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"flatted": "^3.2.9",
|
||||
"keyv": "^4.5.3",
|
||||
"rimraf": "^3.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10.12.0 || >=12.0.0"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/globals": {
|
||||
"version": "13.24.0",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"type-fest": "^0.20.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/rimraf": {
|
||||
"version": "3.0.2",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"bin": {
|
||||
"rimraf": "bin.js"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"packages/ui/node_modules/type-fest": {
|
||||
"version": "0.20.2",
|
||||
"dev": true,
|
||||
"license": "(MIT OR CC0-1.0)",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.16.7",
|
||||
"@humanwhocodes/config-array": "^0.13.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/jest-image-snapshot": "^6.4.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.25.0",
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
extends: ['../../eslint.base.js'],
|
||||
};
|
||||
22
packages/common/eslint.config.mjs
Normal file
22
packages/common/eslint.config.mjs
Normal file
@@ -0,0 +1,22 @@
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname, resolve } from 'path';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
// Import the root config
|
||||
const rootConfigPath = resolve(__dirname, '../../eslint.config.mjs');
|
||||
const rootConfig = await import(rootConfigPath);
|
||||
|
||||
export default [
|
||||
...rootConfig.default,
|
||||
{
|
||||
files: ['src/**/*.ts'],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.esm.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -42,7 +42,7 @@
|
||||
"build:esm": "tsc -p tsconfig.esm.json",
|
||||
"build:node": "tsc -p tsconfig.node.json",
|
||||
"clean": "rimraf dist",
|
||||
"lint": "eslint --ext .ts src",
|
||||
"lint": "eslint --ext .ts src --config eslint.config.mjs --no-error-on-unmatched-pattern",
|
||||
"test": "jest",
|
||||
"prune": "ts-prune src",
|
||||
"prettier": "prettier --write 'src/**/*.ts'"
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { z } from 'zod';
|
||||
import type { PDFPage, PDFDocument } from '@pdfme/pdf-lib';
|
||||
/** @ts-ignore -- optional interface, will gracefully degrade to `any` if `antd` isn't installed **/
|
||||
import type { ThemeConfig, GlobalToken } from 'antd';
|
||||
/** @ts-ignore -- optional interface, will gracefully degrade to `any` if `form-render` isn't installed*/
|
||||
import type { WidgetProps as _PropPanelWidgetProps, Schema as _PropPanelSchema } from 'form-render';
|
||||
import {
|
||||
Lang,
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
extends: ['../../eslint.base.js'],
|
||||
};
|
||||
22
packages/converter/eslint.config.mjs
Normal file
22
packages/converter/eslint.config.mjs
Normal file
@@ -0,0 +1,22 @@
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname, resolve } from 'path';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
// Import the root config
|
||||
const rootConfigPath = resolve(__dirname, '../../eslint.config.mjs');
|
||||
const rootConfig = await import(rootConfigPath);
|
||||
|
||||
export default [
|
||||
...rootConfig.default,
|
||||
{
|
||||
files: ['src/**/*.ts'],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.esm.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -38,7 +38,7 @@
|
||||
"build:cjs": "tsc -p tsconfig.cjs.json",
|
||||
"build:esm": "tsc -p tsconfig.esm.json",
|
||||
"clean": "rimraf dist",
|
||||
"lint": "eslint --ext .ts src",
|
||||
"lint": "eslint --ext .ts src --config eslint.config.mjs --no-error-on-unmatched-pattern",
|
||||
"test": "jest",
|
||||
"prune": "ts-prune src",
|
||||
"prettier": "prettier --write 'src/**/*.ts'"
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
extends: ['../../eslint.base.js'],
|
||||
};
|
||||
22
packages/generator/eslint.config.mjs
Normal file
22
packages/generator/eslint.config.mjs
Normal file
@@ -0,0 +1,22 @@
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname, resolve } from 'path';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
// Import the root config
|
||||
const rootConfigPath = resolve(__dirname, '../../eslint.config.mjs');
|
||||
const rootConfig = await import(rootConfigPath);
|
||||
|
||||
export default [
|
||||
...rootConfig.default,
|
||||
{
|
||||
files: ['src/**/*.ts'],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.esm.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -41,7 +41,7 @@
|
||||
"build:esm": "tsc -p tsconfig.esm.json",
|
||||
"build:node": "tsc -p tsconfig.node.json",
|
||||
"clean": "rimraf dist",
|
||||
"lint": "eslint --ext .ts src",
|
||||
"lint": "eslint --ext .ts src --config eslint.config.mjs --no-error-on-unmatched-pattern",
|
||||
"test": "jest",
|
||||
"test:update-snapshots": "jest --updateSnapshot",
|
||||
"prune": "ts-prune src",
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
extends: ['../../eslint.base.js'],
|
||||
};
|
||||
22
packages/manipulator/eslint.config.mjs
Normal file
22
packages/manipulator/eslint.config.mjs
Normal file
@@ -0,0 +1,22 @@
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname, resolve } from 'path';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
// Import the root config
|
||||
const rootConfigPath = resolve(__dirname, '../../eslint.config.mjs');
|
||||
const rootConfig = await import(rootConfigPath);
|
||||
|
||||
export default [
|
||||
...rootConfig.default,
|
||||
{
|
||||
files: ['src/**/*.ts'],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.esm.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -37,7 +37,7 @@
|
||||
"build:cjs": "tsc -p tsconfig.cjs.json",
|
||||
"build:esm": "tsc -p tsconfig.esm.json",
|
||||
"clean": "rimraf dist",
|
||||
"lint": "eslint --ext .ts src",
|
||||
"lint": "eslint --ext .ts src --config eslint.config.mjs",
|
||||
"test": "jest",
|
||||
"test:update-snapshots": "jest --updateSnapshot",
|
||||
"prune": "ts-prune src",
|
||||
@@ -78,4 +78,4 @@
|
||||
"^(\\.{1,2}/(?:src|__tests__)/.*)\\.js$": "$1.ts"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
module.exports = {
|
||||
extends: ['../../eslint.base.js'],
|
||||
};
|
||||
@@ -272,22 +272,19 @@ describe('createBarCode', () => {
|
||||
['タイ語', 'สวัสดีปีใหม่', 'สวัสดีปีใหม่'],
|
||||
];
|
||||
|
||||
const upcaCode = '416000336108';
|
||||
|
||||
describe('generate qrcode with default colours', () => {
|
||||
for (const t of tests) {
|
||||
// eslint-disable-next-line no-loop-func
|
||||
test(`${t[0]}: ${t[1]}`, async () => {
|
||||
const buffer = (await createBarCode({
|
||||
const buffer = await createBarCode({
|
||||
type: 'qrcode',
|
||||
input: t[1],
|
||||
width: 10, // mm
|
||||
height: 10, // mm
|
||||
backgroundColor: '00000000', // 背景色を指定しないとjsQRでうまく解析できない
|
||||
})) as Buffer;
|
||||
});
|
||||
const png = PNG.sync.read(buffer);
|
||||
const pngData = new Uint8ClampedArray(png.data);
|
||||
// @ts-ignore
|
||||
const qr = jsQR(pngData, png.width, png.height) as QRCode;
|
||||
expect(qr).not.toBeNull();
|
||||
const dataBuffer = Buffer.from(qr.binaryData);
|
||||
@@ -300,17 +297,16 @@ describe('createBarCode', () => {
|
||||
for (const t of tests) {
|
||||
// eslint-disable-next-line no-loop-func
|
||||
test(`${t[0]}: ${t[1]}`, async () => {
|
||||
const buffer = (await createBarCode({
|
||||
const buffer = await createBarCode({
|
||||
type: 'qrcode',
|
||||
input: t[1],
|
||||
width: 10, // mm
|
||||
height: 10, // mm
|
||||
backgroundColor: 'ffffff',
|
||||
barColor: 'f50505',
|
||||
})) as Buffer;
|
||||
});
|
||||
const png = PNG.sync.read(buffer);
|
||||
const pngData = new Uint8ClampedArray(png.data);
|
||||
// @ts-ignore
|
||||
const qr = jsQR(pngData, png.width, png.height) as QRCode;
|
||||
expect(qr).not.toBeNull();
|
||||
const dataBuffer = Buffer.from(qr.binaryData);
|
||||
|
||||
22
packages/schemas/eslint.config.mjs
Normal file
22
packages/schemas/eslint.config.mjs
Normal file
@@ -0,0 +1,22 @@
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname, resolve } from 'path';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
// Import the root config
|
||||
const rootConfigPath = resolve(__dirname, '../../eslint.config.mjs');
|
||||
const rootConfig = await import(rootConfigPath);
|
||||
|
||||
export default [
|
||||
...rootConfig.default,
|
||||
{
|
||||
files: ['src/**/*.ts'],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.esm.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -49,7 +49,7 @@
|
||||
"build:esm": "tsc -p tsconfig.esm.json",
|
||||
"build:node": "tsc -p tsconfig.node.json",
|
||||
"clean": "rimraf dist",
|
||||
"lint": "eslint --ext .ts src",
|
||||
"lint": "eslint --ext .ts src --config eslint.config.mjs --no-error-on-unmatched-pattern",
|
||||
"test": "jest",
|
||||
"prune": "ts-prune src",
|
||||
"prettier": "prettier --write 'src/**/*.ts'"
|
||||
|
||||
@@ -1,82 +1,40 @@
|
||||
import type * as CSS from 'csstype';
|
||||
|
||||
import AirDatepicker from 'air-datepicker';
|
||||
import type { AirDatepickerLocale, AirDatepickerButton } from 'air-datepicker';
|
||||
|
||||
// Define custom interfaces for AirDatepicker types
|
||||
interface AirDatepickerDate extends Date {}
|
||||
interface AirDatepickerInstance {
|
||||
selectedDates: Date[];
|
||||
hide: () => void;
|
||||
destroy: () => void;
|
||||
show: () => void;
|
||||
}
|
||||
// @ts-ignore
|
||||
import localeAr from 'air-datepicker/locale/ar.js';
|
||||
// @ts-ignore
|
||||
import localeBg from 'air-datepicker/locale/bg.js';
|
||||
// @ts-ignore
|
||||
import localeCa from 'air-datepicker/locale/ca.js';
|
||||
// @ts-ignore
|
||||
import localeCs from 'air-datepicker/locale/cs.js';
|
||||
// @ts-ignore
|
||||
import localeDa from 'air-datepicker/locale/da.js';
|
||||
// @ts-ignore
|
||||
import localeDe from 'air-datepicker/locale/de.js';
|
||||
// @ts-ignore
|
||||
import localeEl from 'air-datepicker/locale/el.js';
|
||||
// @ts-ignore
|
||||
import localeEn from 'air-datepicker/locale/en.js';
|
||||
// @ts-ignore
|
||||
import localeEs from 'air-datepicker/locale/es.js';
|
||||
// @ts-ignore
|
||||
import localeEu from 'air-datepicker/locale/eu.js';
|
||||
// @ts-ignore
|
||||
import localeFi from 'air-datepicker/locale/fi.js';
|
||||
// @ts-ignore
|
||||
import localeFr from 'air-datepicker/locale/fr.js';
|
||||
// @ts-ignore
|
||||
import localeHr from 'air-datepicker/locale/hr.js';
|
||||
// @ts-ignore
|
||||
import localeHu from 'air-datepicker/locale/hu.js';
|
||||
// @ts-ignore
|
||||
import localeId from 'air-datepicker/locale/id.js';
|
||||
// @ts-ignore
|
||||
import localeIt from 'air-datepicker/locale/it.js';
|
||||
// @ts-ignore
|
||||
import localeJa from 'air-datepicker/locale/ja.js';
|
||||
// @ts-ignore
|
||||
import localeKo from 'air-datepicker/locale/ko.js';
|
||||
// @ts-ignore
|
||||
import localeNb from 'air-datepicker/locale/nb.js';
|
||||
// @ts-ignore
|
||||
import localeNl from 'air-datepicker/locale/nl.js';
|
||||
// @ts-ignore
|
||||
import localeTh from 'air-datepicker/locale/th.js';
|
||||
// @ts-ignore
|
||||
import localePl from 'air-datepicker/locale/pl.js';
|
||||
// @ts-ignore
|
||||
import localePtBR from 'air-datepicker/locale/pt-BR.js';
|
||||
// @ts-ignore
|
||||
import localePt from 'air-datepicker/locale/pt.js';
|
||||
// @ts-ignore
|
||||
import localeRo from 'air-datepicker/locale/ro.js';
|
||||
// @ts-ignore
|
||||
import localeRu from 'air-datepicker/locale/ru.js';
|
||||
// @ts-ignore
|
||||
import localeSi from 'air-datepicker/locale/si.js';
|
||||
// @ts-ignore
|
||||
import localeSk from 'air-datepicker/locale/sk.js';
|
||||
// @ts-ignore
|
||||
import localeSl from 'air-datepicker/locale/sl.js';
|
||||
// @ts-ignore
|
||||
import localeSv from 'air-datepicker/locale/sv.js';
|
||||
// @ts-ignore
|
||||
import localeTr from 'air-datepicker/locale/tr.js';
|
||||
// @ts-ignore
|
||||
import localeUk from 'air-datepicker/locale/uk.js';
|
||||
// @ts-ignore
|
||||
import localeZh from 'air-datepicker/locale/zh.js';
|
||||
import type { AirDatepickerLocale, AirDatepickerButton, AirDatepickerDate } from 'air-datepicker';
|
||||
import localeAr from 'air-datepicker/locale/ar';
|
||||
import localeBg from 'air-datepicker/locale/bg';
|
||||
import localeCa from 'air-datepicker/locale/ca';
|
||||
import localeCs from 'air-datepicker/locale/cs';
|
||||
import localeDa from 'air-datepicker/locale/da';
|
||||
import localeDe from 'air-datepicker/locale/de';
|
||||
import localeEl from 'air-datepicker/locale/el';
|
||||
import localeEn from 'air-datepicker/locale/en';
|
||||
import localeEs from 'air-datepicker/locale/es';
|
||||
import localeEu from 'air-datepicker/locale/eu';
|
||||
import localeFi from 'air-datepicker/locale/fi';
|
||||
import localeFr from 'air-datepicker/locale/fr';
|
||||
import localeHr from 'air-datepicker/locale/hr';
|
||||
import localeHu from 'air-datepicker/locale/hu';
|
||||
import localeId from 'air-datepicker/locale/id';
|
||||
import localeIt from 'air-datepicker/locale/it';
|
||||
import localeJa from 'air-datepicker/locale/ja';
|
||||
import localeKo from 'air-datepicker/locale/ko';
|
||||
import localeNb from 'air-datepicker/locale/nb';
|
||||
import localeNl from 'air-datepicker/locale/nl';
|
||||
import localeTh from 'air-datepicker/locale/th';
|
||||
import localePl from 'air-datepicker/locale/pl';
|
||||
import localePtBR from 'air-datepicker/locale/pt-BR';
|
||||
import localePt from 'air-datepicker/locale/pt';
|
||||
import localeRo from 'air-datepicker/locale/ro';
|
||||
import localeRu from 'air-datepicker/locale/ru';
|
||||
import localeSi from 'air-datepicker/locale/si';
|
||||
import localeSk from 'air-datepicker/locale/sk';
|
||||
import localeSl from 'air-datepicker/locale/sl';
|
||||
import localeSv from 'air-datepicker/locale/sv';
|
||||
import localeTr from 'air-datepicker/locale/tr';
|
||||
import localeUk from 'air-datepicker/locale/uk';
|
||||
import localeZh from 'air-datepicker/locale/zh';
|
||||
|
||||
import * as dateFns from 'date-fns/locale';
|
||||
import { format } from 'date-fns';
|
||||
@@ -97,6 +55,13 @@ import { DateSchema } from './types.js';
|
||||
import { getExtraFormatterSchema, Formatter } from '../text/extraFormatter.js';
|
||||
import { isEditable } from '../utils.js';
|
||||
|
||||
interface AirDatepickerInstance {
|
||||
selectedDates: Date[];
|
||||
hide: () => void;
|
||||
destroy: () => void;
|
||||
show: () => void;
|
||||
}
|
||||
|
||||
type PickerType = 'date' | 'time' | 'dateTime';
|
||||
|
||||
interface Locale {
|
||||
@@ -301,11 +266,11 @@ export const getPlugin = ({ type, icon }: { type: PickerType; icon: string }) =>
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const airDatepicker = new (AirDatepicker as any)(input, {
|
||||
const airDatepicker = new AirDatepicker(input, {
|
||||
locale: locale.adLocale,
|
||||
selectedDates: [strDateToDate(value, type)],
|
||||
dateFormat: (date: AirDatepickerDate) => format(date, schema.format, { locale: locale.formatLocale }),
|
||||
dateFormat: (date: AirDatepickerDate) =>
|
||||
format(date, schema.format, { locale: locale.formatLocale }),
|
||||
timepicker: type !== 'date',
|
||||
onlyTimepicker: type === 'time',
|
||||
isMobile: window.innerWidth < 768,
|
||||
@@ -471,6 +436,7 @@ export const getPlugin = ({ type, icon }: { type: PickerType; icon: string }) =>
|
||||
format: defaultFormat,
|
||||
type,
|
||||
content: getFmtContent(new Date(), type),
|
||||
position: { x: 0, y: 0 },
|
||||
width: 50,
|
||||
height: 10,
|
||||
rotate: 0,
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
module.exports = {
|
||||
extends: ['../../eslint.base.js', "plugin:react/recommended", 'plugin:react-hooks/recommended'],
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.ts', '*.tsx'],
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
},
|
||||
},
|
||||
],
|
||||
settings: {
|
||||
react: {
|
||||
version: 'detect',
|
||||
},
|
||||
},
|
||||
};
|
||||
41
packages/ui/eslint.config.mjs
Normal file
41
packages/ui/eslint.config.mjs
Normal file
@@ -0,0 +1,41 @@
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname, resolve } from 'path';
|
||||
import reactPlugin from 'eslint-plugin-react';
|
||||
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
// Import the root config
|
||||
const rootConfigPath = resolve(__dirname, '../../eslint.config.mjs');
|
||||
const rootConfig = await import(rootConfigPath);
|
||||
|
||||
export default [
|
||||
...rootConfig.default,
|
||||
{
|
||||
files: ['src/**/*.ts', 'src/**/*.tsx'],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json'],
|
||||
tsconfigRootDir: __dirname,
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
react: reactPlugin,
|
||||
'react-hooks': reactHooksPlugin,
|
||||
},
|
||||
settings: {
|
||||
react: {
|
||||
version: 'detect',
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
...reactPlugin.configs.recommended.rules,
|
||||
'react-hooks/rules-of-hooks': 'error',
|
||||
'react-hooks/exhaustive-deps': 'warn',
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -30,7 +30,7 @@
|
||||
"devBuildType:watch": "tsc --emitDeclarationOnly --watch",
|
||||
"build": "vite build && tsc --emitDeclarationOnly",
|
||||
"clean": "rimraf dist",
|
||||
"lint": "eslint --ext .ts,.tsx src",
|
||||
"lint": "eslint --ext .ts,.tsx src --config eslint.config.mjs --no-error-on-unmatched-pattern",
|
||||
"test": "jest",
|
||||
"prune": "ts-prune src",
|
||||
"prettier": "prettier --write 'src/**/*.{ts,tsx}'"
|
||||
@@ -56,11 +56,13 @@
|
||||
"@testing-library/react": "^12.1.2",
|
||||
"@types/react": "^17.0.52",
|
||||
"@types/react-dom": "^17.0.18",
|
||||
"@ungap/structured-clone": "^1.3.0",
|
||||
"@vitejs/plugin-react": "^4.2.0",
|
||||
"csstype": "^3.1.2",
|
||||
"esbuild": "^0.25.0",
|
||||
"eslint-plugin-react": "^7.28.0",
|
||||
"eslint-plugin-react-hooks": "^4.3.0",
|
||||
"eslint-plugin-react": "^7.37.4",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"is-path-inside": "^3.0.3",
|
||||
"jest-canvas-mock": "^2.3.1",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"process": "^0.11.10",
|
||||
|
||||
@@ -275,7 +275,6 @@ Check this document: https://pdfme.com/docs/custom-schemas`);
|
||||
overflowX: 'hidden',
|
||||
}}
|
||||
>
|
||||
{/* @ts-ignore */}
|
||||
<FormRenderComponent
|
||||
form={form}
|
||||
schema={propPanelSchema}
|
||||
|
||||
@@ -17,13 +17,11 @@ const Root = ({ size, scale, children }: Props, ref: Ref<HTMLDivElement>) => {
|
||||
display: 'swap',
|
||||
})
|
||||
);
|
||||
// @ts-ignore
|
||||
const newFontFaces = fontFaces.filter((fontFace) => !document.fonts.has(fontFace));
|
||||
|
||||
Promise.allSettled(newFontFaces.map((f) => f.load())).then((loadedFontFaces) => {
|
||||
loadedFontFaces.forEach((loadedFontFace) => {
|
||||
if (loadedFontFace.status === 'fulfilled') {
|
||||
// @ts-ignore
|
||||
document.fonts.add(loadedFontFace.value);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"isolatedModules": true,
|
||||
"declaration": true,
|
||||
"declarationDir": "dist/types",
|
||||
"module": "ESNext",
|
||||
"module": "NodeNext",
|
||||
"lib": [
|
||||
"ES2020",
|
||||
"DOM",
|
||||
|
||||
Reference in New Issue
Block a user