Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new exports, add biomejs, and update deps #598

Merged
merged 4 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .eslintrc.json

This file was deleted.

13 changes: 1 addition & 12 deletions .ncurc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,5 @@ module.exports = {
reject: [
'pnpm',
'iframe-resizer'
],
filterResults: (name, { upgradedVersionSemver }) => {
if (
name === '@types/node' && parseInt(upgradedVersionSemver?.major) >= 22 ||
name === 'eslint' && parseInt(upgradedVersionSemver?.major) >= 9 ||
name === 'rapid-form' && parseInt(upgradedVersionSemver?.major) >= 3
) {
return false
}

return true
}
]
}
142 changes: 142 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
"files": { "ignoreUnknown": false, "ignore": [] },
"formatter": { "enabled": true, "indentStyle": "space" },
"organizeImports": { "enabled": true },
"linter": {
"enabled": true,
"rules": {
"recommended": false,
"a11y": { "noBlankTarget": "error" },
"complexity": {
"noBannedTypes": "error",
"noExtraBooleanCast": "error",
"noMultipleSpacesInRegularExpressionLiterals": "error",
"noStaticOnlyClass": "error",
"noUselessCatch": "error",
"noUselessConstructor": "error",
"noUselessLoneBlockStatements": "error",
"noUselessRename": "error",
"noUselessTernary": "error",
"noUselessThisAlias": "error",
"noUselessTypeConstraint": "error",
"noUselessUndefinedInitialization": "error",
"noVoid": "error",
"noWith": "error",
"useLiteralKeys": "error",
"useOptionalChain": "error",
"useRegexLiterals": "error"
},
"correctness": {
"noChildrenProp": "error",
"noConstAssign": "error",
"noConstantCondition": "error",
"noEmptyCharacterClassInRegex": "error",
"noEmptyPattern": "error",
"noGlobalObjectCalls": "error",
"noInvalidConstructorSuper": "error",
"noInvalidUseBeforeDeclaration": "error",
"noNewSymbol": "error",
"noPrecisionLoss": "error",
"noSelfAssign": "error",
"noSwitchDeclarations": "error",
"noUndeclaredVariables": "off",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnusedVariables": "error",
"useArrayLiterals": "off",
"useIsNan": "error",
"useJsxKeyInIterable": "error"
},
"security": {
"noDangerouslySetInnerHtmlWithChildren": "error",
"noGlobalEval": "error"
},
"style": {
"noCommaOperator": "error",
"noImplicitBoolean": "error",
"noNamespace": "error",
"noNonNullAssertion": "error",
"noVar": "warn",
"noYodaExpression": "error",
"useBlockStatements": "off",
"useConsistentArrayType": {
"level": "error",
"options": { "syntax": "shorthand" }
},
"useConsistentBuiltinInstantiation": "error",
"useConst": "error",
"useExportType": "error",
"useFragmentSyntax": "error",
"useImportType": "error",
"useNamingConvention": {
"level": "off",
"options": {
"strictCase": false,
"conventions": [
{
"selector": { "kind": "variable" },
"match": "_?([^_]*)_?",
"formats": ["camelCase", "PascalCase", "CONSTANT_CASE"]
},
{
"selector": { "kind": "function" },
"match": "_?([^_]*)_?",
"formats": ["camelCase", "PascalCase", "CONSTANT_CASE"]
},
{
"selector": { "kind": "functionParameter" },
"match": "_?([^_]*)_?",
"formats": ["camelCase", "PascalCase", "CONSTANT_CASE"]
}
]
}
},
"useShorthandFunctionType": "error",
"useSingleVarDeclarator": "error",
"useThrowOnlyError": "off"
},
"suspicious": {
"noAssignInExpressions": "error",
"noAsyncPromiseExecutor": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCommentText": "error",
"noCompareNegZero": "error",
"noConfusingLabels": "error",
"noConfusingVoidType": "error",
"noControlCharactersInRegex": "error",
"noDebugger": "error",
"noDoubleEquals": "error",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateJsxProps": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noEmptyBlockStatements": "error",
"noEmptyInterface": "error",
"noExtraNonNullAssertion": "error",
"noFallthroughSwitchClause": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noImportAssign": "error",
"noMisleadingCharacterClass": "error",
"noMisleadingInstantiator": "error",
"noPrototypeBuiltins": "error",
"noRedeclare": "error",
"noSelfCompare": "error",
"noShadowRestrictedNames": "error",
"noSparseArray": "error",
"noUnsafeNegation": "error",
"useDefaultSwitchClauseLast": "error",
"useValidTypeof": "error"
}
}
},
"javascript": {
"formatter": { "quoteStyle": "double" },
"globals": ["document", "navigator", "window"]
}
}
93 changes: 46 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
{
"name": "root",
"private": true,
"author": {
"name": "Alessandro Casazza",
"email": "alessandro@commercelayer.io"
},
"scripts": {
"preinstall": "npx only-allow pnpm",
"build": "pnpm -r build",
"prepare": "husky",
"test": "pnpm -r test",
"docs:dev": "pnpm --filter docs storybook",
"docs:build": "pnpm --filter docs build-storybook",
"components:build:dev": "pnpm --filter react-components build:dev",
"components:build": "pnpm --filter react-components build",
"make:version": "lerna version --no-private",
"make:version:force": "lerna version --no-private --force-publish",
"dep:major": "pnpm dlx npm-check-updates --packageFile '**/package.json' -u -i",
"dep:minor": "pnpm dep:major -t minor -i"
},
"devDependencies": {
"@commercelayer/eslint-config-ts-react": "^1.4.5",
"husky": "^9.1.7",
"lerna": "^8.1.9",
"typescript": "^5.7.2"
},
"pnpm": {
"overrides": {
"postcss@<8.4.31": ">=8.4.31",
"graphql@>=16.3.0 <16.8.1": ">=16.8.1",
"vite@>=4.4.0 <4.4.12": ">=4.4.12",
"@babel/traverse@<7.23.2": ">=7.23.2",
"vite@>=4.0.0 <=4.5.1": ">=4.5.2",
"follow-redirects@<1.15.4": ">=1.15.4",
"express@<4.19.2": ">=4.19.2",
"vite@>=5.1.0 <=5.1.6": ">=5.1.7",
"tar@<6.2.1": ">=6.2.1",
"ejs@<3.1.10": ">=3.1.10",
"braces@<3.0.3": ">=3.0.3",
"ws@>=8.0.0 <8.17.1": ">=8.17.1",
"micromatch@<4.0.8": ">=4.0.8",
"rollup@>=4.0.0 <4.22.4": ">=4.22.4",
"cross-spawn@>=7.0.0 <7.0.5": ">=7.0.5",
"@eslint/plugin-kit@<0.2.3": ">=0.2.3"
}
}
}
"name": "root",
"private": true,
"author": {
"name": "Alessandro Casazza",
"email": "alessandro@commercelayer.io"
},
"scripts": {
"preinstall": "npx only-allow pnpm",
"build": "pnpm -r build",
"prepare": "husky",
"test": "pnpm -r test",
"docs:dev": "pnpm --filter docs storybook",
"docs:build": "pnpm --filter docs build-storybook",
"components:build:dev": "pnpm --filter react-components build:dev",
"components:build": "pnpm --filter react-components build",
"make:version": "lerna version --no-private",
"make:version:force": "lerna version --no-private --force-publish",
"dep:major": "pnpm dlx npm-check-updates --packageFile '**/package.json' -u -i",
"dep:minor": "pnpm dep:major -t minor -i"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"husky": "^9.1.7",
"lerna": "^8.1.9",
"typescript": "^5.7.3"
},
"pnpm": {
"overrides": {
"postcss@<8.4.31": ">=8.4.31",
"graphql@>=16.3.0 <16.8.1": ">=16.8.1",
"vite@>=4.4.0 <4.4.12": ">=4.4.12",
"@babel/traverse@<7.23.2": ">=7.23.2",
"vite@>=4.0.0 <=4.5.1": ">=4.5.2",
"follow-redirects@<1.15.4": ">=1.15.4",
"express@<4.19.2": ">=4.19.2",
"vite@>=5.1.0 <=5.1.6": ">=5.1.7",
"tar@<6.2.1": ">=6.2.1",
"ejs@<3.1.10": ">=3.1.10",
"braces@<3.0.3": ">=3.0.3",
"ws@>=8.0.0 <8.17.1": ">=8.17.1",
"micromatch@<4.0.8": ">=4.0.8",
"rollup@>=4.0.0 <4.22.4": ">=4.22.4",
"cross-spawn@>=7.0.0 <7.0.5": ">=7.0.5"
}
}
}
1 change: 0 additions & 1 deletion packages/docs/.eslintignore

This file was deleted.

19 changes: 0 additions & 19 deletions packages/docs/.eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion packages/docs/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if (typeof global.process === 'undefined') {
// Start the mocking when each story is loaded.
// Repetitive calls to the `.start()` method do not register a new worker,
// but check whether there's an existing once, reusing it, if so.
void worker.start({
worker.start({
serviceWorker: {
url: `${import.meta.env.BASE_URL}mockServiceWorker.js`
},
Expand Down
Loading