From 97f613ec74eff61139d0a70470488bf246815c4c Mon Sep 17 00:00:00 2001
From: Florian Wendelborn <1133858+FlorianWendelborn@users.noreply.github.com>
Date: Tue, 9 Apr 2024 14:29:27 +0200
Subject: [PATCH] feature(eslint): add reusable eslint config, create
@3yourmind/eslint-config
We could not migrate all existing plugins at this time, see #914
Co-Authored-By: Florian Wendelborn <1133858+FlorianWendelborn@users.noreply.github.com>
---
.eslintrc.js | 138 --
.gitignore | 4 +-
.vscode/settings.json | 5 +-
README.md | 18 +
eslint.config.mjs | 95 +
internals/scripts/package.json | 2 +-
internals/scripts/source/publish.ts | 2 +-
knip.json | 2 +-
package.json | 24 +-
packages/documentation/.unimportedrc.json | 13 -
packages/documentation/README.md | 8 -
.../documentation/components/ActionBar.vue | 3 +-
.../documentation/components/ColorPalette.vue | 72 +-
.../components/ComponentInfo.vue | 17 +-
.../components/LayoutContainer.vue | 1 +
packages/documentation/components/NavBar.vue | 14 +-
.../documentation/components/YocoPreview.vue | 64 +-
.../components/component-info/Slots.vue | 5 +-
packages/documentation/data/menu.ts | 2 +-
packages/documentation/hooks/use-route.ts | 5 +-
packages/documentation/hooks/use-router.ts | 5 +-
packages/documentation/nuxt.config.ts | 10 +-
packages/documentation/package.json | 7 +-
packages/documentation/pages/changelog.vue | 8 +-
.../documentation/pages/examples/layouts.vue | 4 +-
.../pages/foundations/colors/figma.vue | 1 +
.../foundations/colors/list-of-colors.vue | 1 +
.../foundations/colors/list-of-tokens.vue | 12 +-
packages/documentation/pages/index.vue | 1 +
.../pages/usage/components/avatar.vue | 2 +-
.../pages/usage/components/breadcrumb.vue | 10 +-
.../pages/usage/components/button.vue | 5 +-
.../pages/usage/components/comment.vue | 37 +-
.../usage/components/field-inline-edit.vue | 15 +-
.../pages/usage/components/filters.vue | 12 +-
.../pages/usage/components/form-fields.vue | 98 +-
.../pages/usage/components/form.vue | 7 +-
.../pages/usage/components/heading.vue | 1 +
.../pages/usage/components/line.vue | 3 +-
.../pages/usage/components/popover.vue | 2 +-
.../pages/usage/components/table.vue | 99 +-
.../pages/usage/layouts/actionbar.vue | 1 -
.../documentation/plugins/vue-clipboard2.js | 4 -
packages/documentation/tsconfig.json | 9 +-
packages/documentation/utilities/date.ts | 4 +-
packages/documentation/utilities/pages.ts | 77 +-
packages/eslint-config/license.md | 20 +
packages/eslint-config/package.json | 61 +
packages/eslint-config/scripts/build.sh | 16 +
packages/eslint-config/source/index.ts | 461 ++++
.../source/rules/vue-consistent-ref-names.ts | 39 +
.../source/rules/vue-no-v-model-deep.ts | 38 +
.../source/rules/vue-no-v-t-on-components.ts | 40 +
.../rules/vue-no-v-t-without-translation.ts | 83 +
packages/eslint-config/source/shims.d.ts | 18 +
.../source/utils/eslint-helpers.ts | 6 +
.../source/utils/no-restricted-globals.ts | 78 +
packages/eslint-config/tsconfig.cjs.json | 9 +
packages/eslint-config/tsconfig.json | 23 +
packages/eslint-config/tsconfig.mjs.json | 10 +
packages/eslint-config/turbo.json | 11 +
packages/kotti-ui/.unimportedrc.json | 14 -
packages/kotti-ui/package.json | 14 +-
packages/kotti-ui/source/constants.ts | 5 +-
packages/kotti-ui/source/globals.d.ts | 11 +
packages/kotti-ui/source/index.ts | 11 +-
.../source/kotti-accordion/KtAccordion.vue | 4 +-
.../kotti-ui/source/kotti-accordion/hooks.ts | 15 +-
.../source/kotti-actionbar/KtActionbar.vue | 15 +-
.../components/ActionbarMenu.vue | 40 +-
.../kotti-ui/source/kotti-actionbar/index.ts | 6 +-
.../kotti-ui/source/kotti-actionbar/types.ts | 23 +
.../source/kotti-button-group/types.ts | 2 +-
.../kotti-ui/source/kotti-button/KtButton.vue | 4 +-
.../source/kotti-button/KtSplitButton.vue | 10 +-
.../kotti-button/components/ActionsItem.vue | 2 +-
.../kotti-button/hooks/use-actions-tippy.ts | 39 +-
packages/kotti-ui/source/kotti-col/index.ts | 16 +-
packages/kotti-ui/source/kotti-col/types.ts | 2 +-
.../source/kotti-comment/KtComment.vue | 13 +-
.../source/kotti-comment/KtCommentInput.vue | 4 +-
.../components/CommentActions.vue | 12 +-
.../kotti-comment/components/CommentEntry.vue | 8 +-
.../components/CommentTextArea.vue | 14 +-
.../kotti-ui/source/kotti-comment/hooks.ts | 21 +-
.../kotti-ui/source/kotti-comment/index.ts | 2 +-
.../source/kotti-comment/utilities.ts | 13 +-
.../kotti-field-currency/KtFieldCurrency.vue | 18 +-
.../source/kotti-field-currency/constants.ts | 2 +-
.../kotti-field-currency/utilities.test.ts | 4 +-
.../source/kotti-field-currency/utilities.ts | 4 +-
.../source/kotti-field-date/KtFieldDate.vue | 11 +-
.../kotti-field-date/KtFieldDateRange.vue | 20 +-
.../kotti-field-date/KtFieldDateTime.vue | 11 +-
.../kotti-field-date/KtFieldDateTimeRange.vue | 24 +-
.../source/kotti-field-date/constants.ts | 2 +-
.../kotti-ui/source/kotti-field-date/hooks.ts | 58 +-
.../kotti-ui/source/kotti-field-date/index.ts | 2 +-
.../source/kotti-field-date/utilities.ts | 4 +-
.../KtFieldFileUpload.vue | 38 +-
.../KtFieldFileUploadRemote.vue | 52 +-
.../components/DropArea.vue | 4 +-
.../components/ProgressBar.vue | 2 +-
.../components/TakePhoto/Capture.vue | 10 +-
.../components/TakePhoto/Error.vue | 8 +-
.../components/TakePhoto/TakePhoto.vue | 2 +-
.../components/TakePhoto/utils/common.ts | 13 +-
.../components/TakePhoto/utils/web-rtc.ts | 18 +-
.../kotti-field-file-upload/constants.ts | 8 +-
.../kotti-field-file-upload/formatters.ts | 2 +-
.../source/kotti-field-file-upload/types.ts | 6 +-
.../kotti-field-file-upload/utils/common.ts | 4 +-
.../kotti-field-file-upload/utils/remote.ts | 1 -
.../kotti-field-file-upload/validators.ts | 34 +-
.../KtFieldInlineEdit.vue | 12 +-
.../components/ConfirmButton.vue | 4 +-
.../kotti-field-inline-edit/constants.ts | 2 +-
.../source/kotti-field-inline-edit/hooks.ts | 16 +-
.../source/kotti-field-inline-edit/utils.ts | 8 +-
.../kotti-field-number/KtFieldNumber.vue | 20 +-
.../source/kotti-field-number/constants.ts | 6 +-
.../source/kotti-field-number/utilities.ts | 8 +-
.../kotti-field-password/KtFieldPassword.vue | 2 +-
.../source/kotti-field-password/constants.ts | 2 +-
.../KtFieldRadioGroup.vue | 4 +-
.../kotti-field-radio-group/constants.ts | 2 +-
.../components/ActionIcon.vue | 8 +-
.../components/GenericSelectField.vue | 16 +-
.../kotti-field-select/components/Options.vue | 40 +-
.../source/kotti-field-select/constants.ts | 2 +-
.../hooks/use-select-tippy.ts | 24 +-
.../source/kotti-field-select/index.ts | 3 +-
.../kotti-field-select/utils/tippy-utils.ts | 12 +-
.../kotti-field-text-area/KtFieldTextArea.vue | 4 +-
.../source/kotti-field-text-area/constants.ts | 2 +-
.../source/kotti-field-text/KtFieldText.vue | 2 +-
.../source/kotti-field-text/constants.ts | 2 +-
.../kotti-field-toggle/KtFieldToggleGroup.vue | 2 +-
.../components/ToggleInner.vue | 9 +-
.../source/kotti-field-toggle/constants.ts | 2 +-
.../source/kotti-field-toggle/index.ts | 2 +-
.../source/kotti-field-toggle/types.ts | 2 +-
.../source/kotti-field/KtField.test.ts | 61 +-
.../kotti-ui/source/kotti-field/KtField.vue | 10 +-
.../kotti-field/components/FieldHelpText.vue | 5 +-
.../kotti-ui/source/kotti-field/constants.ts | 2 +-
.../kotti-ui/source/kotti-field/errors.ts | 29 +-
packages/kotti-ui/source/kotti-field/hooks.ts | 92 +-
packages/kotti-ui/source/kotti-field/types.ts | 4 +-
.../source/kotti-filters/KtFilters.vue | 34 +-
.../kotti-filters/components/ButtonLink.vue | 6 +-
.../kotti-filters/components/FilterList.vue | 8 +-
.../kotti-filters/components/FilterRow.vue | 13 +-
.../kotti-filters/components/FilterSearch.vue | 10 +-
.../kotti-ui/source/kotti-filters/types.ts | 14 +-
.../kotti-ui/source/kotti-filters/utils.ts | 7 +-
.../KtFormControllerList.test.ts | 11 +-
.../KtFormControllerList.vue | 44 +-
.../components/FormControllerListItem.vue | 18 +-
.../kotti-form-controller-list/index.ts | 2 +-
.../kotti-form-controller-list/types.ts | 4 +-
.../KtFormControllerObject.test.ts | 11 +-
.../KtFormControllerObject.vue | 10 +-
.../source/kotti-form-submit/KtFormSubmit.vue | 10 +-
.../source/kotti-form-submit/errors.ts | 9 +-
.../source/kotti-form-submit/types.ts | 2 +-
.../kotti-ui/source/kotti-form/KtForm.test.ts | 23 +-
.../kotti-ui/source/kotti-form/KtForm.vue | 18 +-
packages/kotti-ui/source/kotti-form/errors.ts | 20 +-
packages/kotti-ui/source/kotti-form/types.ts | 4 +-
.../kotti-ui/source/kotti-form/utilities.ts | 6 +-
.../source/kotti-i18n/KtI18nContext.ts | 6 +-
packages/kotti-ui/source/kotti-i18n/hooks.ts | 14 +-
.../source/kotti-i18n/locales/de-DE.ts | 2 +-
.../source/kotti-i18n/locales/en-US.ts | 2 +-
.../source/kotti-i18n/locales/es-ES.ts | 2 +-
.../source/kotti-i18n/locales/fr-FR.ts | 2 +-
.../source/kotti-i18n/locales/ja-JP.ts | 2 +-
packages/kotti-ui/source/kotti-i18n/types.ts | 24 +-
.../kotti-ui/source/kotti-i18n/utilities.ts | 2 +-
.../kotti-ui/source/kotti-modal/KtModal.vue | 4 +-
.../kotti-ui/source/kotti-navbar/KtNavbar.vue | 8 +-
.../components/NavbarQuickLink.vue | 5 +-
.../kotti-navbar/components/NavbarTooltip.vue | 7 +-
.../kotti-ui/source/kotti-navbar/constants.ts | 4 +-
.../source/kotti-pagination/KtPagination.vue | 6 +
.../components/PaginationExpanded.vue | 43 +-
.../components/PaginationFlexible.vue | 10 +-
.../components/PaginationFractionated.vue | 22 +-
.../source/kotti-popover/KtPopover.vue | 46 +-
.../source/kotti-popover/constants.ts | 2 +-
.../kotti-ui/source/kotti-popover/types.ts | 4 +-
packages/kotti-ui/source/kotti-row/index.ts | 13 +-
packages/kotti-ui/source/kotti-row/types.ts | 4 +-
.../kotti-ui/source/kotti-table/KtTable.vue | 52 +-
.../source/kotti-table/KtTableColumn.d.ts | 2 +-
.../source/kotti-table/KtTableConsumer.d.ts | 2 +-
.../source/kotti-table/KtTableProvider.d.ts | 2 +-
.../kotti-table/components/TableHeader.vue | 1 +
packages/kotti-ui/source/kotti-table/index.ts | 2 +-
.../kotti-ui/source/kotti-table/mixins.d.ts | 1 +
packages/kotti-ui/source/kotti-table/types.ts | 7 +-
.../source/kotti-toaster/KtToaster.vue | 7 +-
.../source/kotti-value-label/KtValueLabel.vue | 16 +-
packages/kotti-ui/source/make-props.test.ts | 10 +-
packages/kotti-ui/source/make-props.ts | 10 +-
packages/kotti-ui/source/test-utils/index.ts | 6 +-
.../source/test-utils/silence-console.ts | 2 +-
packages/kotti-ui/source/types/kotti.ts | 3 +-
packages/kotti-ui/source/utilities.ts | 33 +-
.../source/zod-utilities/refinements.ts | 8 +-
packages/kotti-ui/tokens/colors.js | 1 -
packages/kotti-ui/tsconfig.json | 7 +-
packages/kotti-ui/tsconfig.node.json | 6 +-
packages/kotti-ui/turbo.json | 12 +-
packages/kotti-ui/vite.config.ts | 17 +-
packages/vue-use-tippy/.unimportedrc.json | 8 -
packages/vue-use-tippy/package.json | 2 +-
packages/vue-use-tippy/scripts/build.sh | 2 +-
packages/vue-use-tippy/source/index.ts | 37 +-
packages/vue-use-tippy/tsconfig.cjs.json | 4 +-
packages/vue-use-tippy/tsconfig.json | 1 +
packages/vue-use-tippy/tsconfig.mjs.json | 4 +-
packages/vue-use-tippy/turbo.json | 4 +-
packages/yoco/.unimportedrc.json | 8 -
packages/yoco/package.json | 4 +-
packages/yoco/scripts/build.sh | 2 +-
packages/yoco/source/generate.ts | 6 +-
packages/yoco/source/index.ts | 16 +-
packages/yoco/tsconfig.cjs.json | 4 +-
packages/yoco/tsconfig.json | 1 +
packages/yoco/tsconfig.mjs.json | 4 +-
packages/yoco/turbo.json | 4 +-
tsconfig.json | 5 +-
turbo.json | 8 +-
yarn.lock | 2033 +++++++++++------
236 files changed, 3758 insertions(+), 2069 deletions(-)
delete mode 100644 .eslintrc.js
create mode 100644 eslint.config.mjs
delete mode 100644 packages/documentation/.unimportedrc.json
delete mode 100644 packages/documentation/plugins/vue-clipboard2.js
create mode 100644 packages/eslint-config/license.md
create mode 100644 packages/eslint-config/package.json
create mode 100755 packages/eslint-config/scripts/build.sh
create mode 100644 packages/eslint-config/source/index.ts
create mode 100644 packages/eslint-config/source/rules/vue-consistent-ref-names.ts
create mode 100644 packages/eslint-config/source/rules/vue-no-v-model-deep.ts
create mode 100644 packages/eslint-config/source/rules/vue-no-v-t-on-components.ts
create mode 100644 packages/eslint-config/source/rules/vue-no-v-t-without-translation.ts
create mode 100644 packages/eslint-config/source/shims.d.ts
create mode 100644 packages/eslint-config/source/utils/eslint-helpers.ts
create mode 100644 packages/eslint-config/source/utils/no-restricted-globals.ts
create mode 100644 packages/eslint-config/tsconfig.cjs.json
create mode 100644 packages/eslint-config/tsconfig.json
create mode 100644 packages/eslint-config/tsconfig.mjs.json
create mode 100644 packages/eslint-config/turbo.json
delete mode 100644 packages/kotti-ui/.unimportedrc.json
create mode 100644 packages/kotti-ui/source/globals.d.ts
create mode 100644 packages/kotti-ui/source/kotti-actionbar/types.ts
delete mode 100644 packages/vue-use-tippy/.unimportedrc.json
delete mode 100644 packages/yoco/.unimportedrc.json
diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index 05ea7d28b2..0000000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1,138 +0,0 @@
-const noExtraneousDependenciesOverride = (packageName) => ({
- 'import/no-extraneous-dependencies': [
- 'error',
- {
- packageDir: ['.', `./packages/${packageName}`],
- },
- ],
-})
-
-/**
- * @type {import('eslint').Linter.Config}
- */
-module.exports = {
- root: true,
- env: {
- node: true,
- es6: true,
- browser: true,
- },
- parser: 'vue-eslint-parser',
- parserOptions: {
- parser: '@typescript-eslint/parser',
- allowImportExportEverywhere: true,
- ecmaVersion: 2020,
- sourceType: 'module',
- },
- plugins: ['sonarjs', 'import'],
- extends: [
- 'eslint:recommended',
- 'plugin:vue/recommended',
- 'plugin:sonarjs/recommended',
- 'plugin:@typescript-eslint/recommended',
- 'plugin:prettier/recommended',
- '@vue/typescript',
- 'prettier',
- ],
- rules: {
- 'import/order': [
- 'warn',
- {
- alphabetize: {
- order: 'asc',
- caseInsensitive: true,
- },
- 'newlines-between': 'always',
- },
- ],
- 'no-console': process.env.NODE_ENV === 'development' ? 'off' : 'error',
- 'no-debugger': process.env.NODE_ENV === 'development' ? 'off' : 'error',
- 'no-magic-numbers': [
- 'warn',
- { ignoreArrayIndexes: true, ignore: [0, 1, 2, -1, 10] },
- ],
- '@typescript-eslint/no-restricted-imports': [
- 'error',
- {
- message:
- "Avoid direct imports from lodash; e.g. import foo from 'lodash/foo' instead of import { foo } from 'lodash'",
- name: 'lodash',
- },
- ],
- '@typescript-eslint/explicit-function-return-type': 'off',
- '@typescript-eslint/explicit-module-boundary-types': 'off',
- '@typescript-eslint/member-delimiter-style': 'off',
- '@typescript-eslint/no-extra-semi': 'off', // conflicts with prettier
- '@typescript-eslint/no-namespace': 'off',
- '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
- 'no-param-reassign': 'warn',
- 'sonarjs/no-duplicate-string': 'warn',
- 'prettier/prettier': 'warn',
- 'vue/attribute-hyphenation': ['error', 'never'],
- 'vue/attributes-order': ['error', { alphabetical: true }],
- 'vue/html-indent': 'off',
- 'vue/require-component-is': 'warn',
- 'vue/require-default-prop': 'off',
- },
- overrides: [
- {
- files: ['packages/kotti-ui/**/*.{ts,js,json,vue}'],
- rules: {
- ...noExtraneousDependenciesOverride('kotti-ui'),
- },
- },
- {
- files: ['packages/documentation/**/*.{ts,js,vue}'],
- rules: {
- ...noExtraneousDependenciesOverride('documentation'),
- },
- },
- {
- files: ['packages/vue-use-tippy/**/*.{ts,vue}'],
- rules: {
- ...noExtraneousDependenciesOverride('vue-use-tippy'),
- },
- },
- {
- files: ['packages/yoco/**/*.ts'],
- rules: {
- ...noExtraneousDependenciesOverride('yoco'),
- },
- },
- {
- files: ['**/*.vue', '**/*.js'],
- rules: {},
- },
- {
- extends: ['plugin:vitest/recommended'],
- files: [
- 'packages/**/*.test.ts',
- 'packages/kotti-ui/source/test-utils/**/*.ts',
- ],
- plugins: ['vitest'],
- rules: {
- 'import/order': [
- 'warn',
- {
- alphabetize: {
- order: 'asc',
- caseInsensitive: true,
- },
- 'newlines-between': 'always',
- },
- ],
- 'no-console': 'off',
- 'no-magic-numbers': 'off',
- 'sonarjs/no-duplicate-string': 'off',
- 'vue/one-component-per-file': 'off',
- '@typescript-eslint/ban-ts-comment': 'off',
- },
- },
- {
- files: ['**/*.json'],
- rules: {
- 'sonarjs/no-duplicate-string': 'off',
- },
- },
- ],
-}
diff --git a/.gitignore b/.gitignore
index eb03d325f6..e741892be7 100755
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,6 @@
.nuxt/
.turbo/
dist/
-gh-pages/
node_modules/
packages/kotti-ui/report.*.html
packages/yoco/fonts/
@@ -12,3 +11,6 @@ vite.config.ts.timestamp*
# os:macOS
.DS_Store
+
+# package.json debug:turbo script
+/turbo-graph.png
diff --git a/.vscode/settings.json b/.vscode/settings.json
index db9237694d..577ed87d49 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -3,12 +3,11 @@
"source.fixAll.eslint": "always"
},
"editor.formatOnSave": true,
- "eslint.options": {
- "extensions": [".js", ".vue", ".ts"]
- },
"eslint.validate": [
"javascript",
"javascriptreact",
+ "json",
+ "jsonc",
"typescript",
"typescriptreact",
"vue"
diff --git a/README.md b/README.md
index 82088fd655..5f49a93cea 100644
--- a/README.md
+++ b/README.md
@@ -269,3 +269,21 @@ yarn run build
| Path | Purpose |
| :----------------------- | :------------------------- |
| `packages/documentation` | Nuxt-managed documentation |
+
+### Turborepo Tooling
+
+#### Debugging
+
+The best starting point for debugging turbo is:
+
+1. Figure out what turbo command gets run (e.g. by checking `package.json`)
+2. Check the relevant tasks in `turbo.json` and `packages/*/turbo.json`
+
+The [Turborepo Documentation](https://turbo.build/repo/docs) is an excellent resource, also make sure you have the `@recommended` `Vercel.turbo-vsc` extension installed as it provides autocomplete and linting for `turbo.json`.
+
+It is also possible to [visualize the graph used by `turbo run`](https://turbo.build/repo/docs/reference/command-line-reference/run#--graph)
+
+```sh
+# generate a graph of turbo run build (needs graphviz)
+yarn run debug:turbo
+```
diff --git a/eslint.config.mjs b/eslint.config.mjs
new file mode 100644
index 0000000000..3a662ade3a
--- /dev/null
+++ b/eslint.config.mjs
@@ -0,0 +1,95 @@
+// @ts-check
+
+import tseslint from 'typescript-eslint'
+import eslintConfig3YD from '@3yourmind/eslint-config'
+import { fileURLToPath } from 'url'
+import path from 'node:path'
+
+/**
+ * Find the project root in a way that is compatible with most javascript engines (e.g. node, vscode's node, bun)
+ */
+const root = (() => {
+ const cause = []
+
+ try {
+ const result = __dirname
+ if (result) return result
+ } catch (error) {
+ cause.push(error)
+ }
+
+ try {
+ const result = import.meta.dirname
+ if (result) return result
+ } catch (error) {
+ cause.push(error)
+ }
+
+ try {
+ const result = path.dirname(fileURLToPath(import.meta.url))
+ if (result) return result
+ } catch (error) {
+ cause.push(error)
+ }
+
+ throw new Error('could not determine project root', { cause })
+})()
+
+const config = tseslint.config(
+ /**
+ * DO NOT ADD ANY OTHER KEYS TO THIS FIRST OBJECT
+ *
+ * @see {@link https://eslint.org/docs/latest/use/configure/ignore#ignoring-files}
+ */
+ {
+ ignores: ['**/dist/**', '**/.nuxt/**', '**/.turbo/**', '**/*.js'],
+ },
+ ...eslintConfig3YD.configs.global,
+ {
+ languageOptions: {
+ ecmaVersion: 2022,
+ parserOptions: {
+ debugLevel: 'typescript-eslint',
+ project: [
+ './tsconfig.json',
+ './internals/*/tsconfig.json',
+ './packages/*/tsconfig.json',
+ './packages/kotti-ui/tsconfig.node.json',
+ ],
+ tsconfigRootDir: root,
+ },
+ sourceType: 'module',
+ },
+ },
+ ...eslintConfig3YD.configs.default.map((config) => ({
+ ...config,
+ files: ['packages/**/*.ts', 'packages/**/*.tsx'],
+ })),
+ ...eslintConfig3YD.configs.untyped,
+ ...eslintConfig3YD.configs.json,
+ ...eslintConfig3YD.configs.tests.map((config) => ({
+ ...config,
+ files: [...config.files, 'packages/kotti-ui/source/test-utils/**/*.ts'],
+ })),
+ ...eslintConfig3YD.configs.vue,
+ {
+ rules: {
+ '@typescript-eslint/no-restricted-imports': [
+ 'error',
+ {
+ message:
+ "Avoid direct imports from lodash; e.g. import foo from 'lodash/foo' instead of import { foo } from 'lodash'",
+ name: 'lodash',
+ },
+ ],
+ },
+ },
+ {
+ files: ['packages/kotti-ui/source/*/index.ts'],
+ rules: {
+ '@typescript-eslint/naming-convention': 'off',
+ },
+ },
+)
+
+export default config
diff --git a/internals/scripts/package.json b/internals/scripts/package.json
index 686657afb6..849af418e1 100644
--- a/internals/scripts/package.json
+++ b/internals/scripts/package.json
@@ -8,7 +8,7 @@
"name": "@3yourmind/scripts",
"private": true,
"scripts": {
- "check:eslint": "yarn --cwd ../.. run eslint --max-warnings=0 --ignore-path=.gitignore ./internals/scripts",
+ "check:eslint": "eslint --max-warnings=0 .",
"check:prettier": "yarn --cwd ../.. run prettier --check --ignore-path=.gitignore ./internals/scripts",
"fix:eslint": "yarn run check:eslint --fix",
"fix:prettier": "yarn run check:prettier --write"
diff --git a/internals/scripts/source/publish.ts b/internals/scripts/source/publish.ts
index a0e9a1f7d7..75097b6f58 100644
--- a/internals/scripts/source/publish.ts
+++ b/internals/scripts/source/publish.ts
@@ -2,7 +2,7 @@
import { $, semver } from 'bun'
import { z } from 'zod'
-const packagesToConsider = [] as string[]
+const packagesToConsider = ['packages/eslint-config']
const packageJsonSchema = z.object({ name: z.string(), version: z.string() })
diff --git a/knip.json b/knip.json
index 4004f38bb3..6d8b8a2630 100644
--- a/knip.json
+++ b/knip.json
@@ -1,7 +1,7 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"ignore": ["**/dist/**"],
- "ignoreBinaries": [],
+ "ignoreBinaries": ["dot", "open"],
"ignoreDependencies": ["lerna", "lint-staged"],
"workspaces": {
"packages/*": {
diff --git a/package.json b/package.json
index d220bb90cb..e38afd3b70 100644
--- a/package.json
+++ b/package.json
@@ -47,23 +47,16 @@
}
],
"devDependencies": {
+ "@3yourmind/eslint-config": "*",
+ "@types/eslint__js": "^8.42.3",
"@types/node": "20.11.16",
- "@typescript-eslint/eslint-plugin": "^6.21.0",
- "@typescript-eslint/parser": "^6.21.0",
- "@vue/eslint-config-typescript": "^12.0.0",
- "eslint": "^8.56.0",
- "eslint-config-prettier": "^9.0.0",
- "eslint-plugin-import": "^2.29.1",
- "eslint-plugin-prettier": "^5.0.1",
- "eslint-plugin-sonarjs": "^0.23.0",
- "eslint-plugin-vitest": "^0.3.22",
- "eslint-plugin-vue": "^9.20.1",
+ "eslint": "^9.2.0",
"husky": "^7.0.1",
"knip": "^5.13.0",
"lerna": "^7.4.2",
"lint-staged": "^11.0.1",
"nodemon": "^3.0.3",
- "postcss": "^8.4.34",
+ "postcss": "^8.4.38",
"postcss-html": "^1.6.0",
"prettier": "^3.2.5",
"publint": "^0.2.7",
@@ -74,9 +67,9 @@
"stylelint-config-standard-scss": "^10.0.0",
"stylelint-csstree-validator": "^3.0.0",
"stylelint-prettier": "^4.0.2",
- "turbo": "^1.13.2",
- "typescript": "^5.3",
- "vue-eslint-parser": "9"
+ "turbo": "^1.13.3",
+ "typescript": "^5.4.4",
+ "typescript-eslint": "^7.8.0"
},
"engines": {
"node": ">=18"
@@ -117,6 +110,7 @@
"check:prettier": "turbo run check:prettier",
"check:publint": "turbo run check:publint",
"check:stylelint": "turbo run check:stylelint",
+ "debug:turbo": "turbo run build --graph --dry | dot -Tpng -oturbo-graph.png && open turbo-graph.png",
"fix": "turbo run fix",
"fix:eslint": "turbo run fix:eslint",
"fix:prettier": "turbo run fix:prettier",
@@ -124,7 +118,7 @@
"prepare": "husky install",
"prepublishOnly": "turbo run check build",
"test": "turbo run test",
- "watch": "nodemon -e js,ts,vue,scss,css,json --watch packages/vue-use-tippy/source --watch packages/yoco/source --exec \"turbo run watch\""
+ "watch": "nodemon -e css,js,json,scss,ts,vue --watch packages/vue-use-tippy/source --watch packages/yoco/source --exec \"turbo run watch\""
},
"version": "1.0.0",
"workspaces": [
diff --git a/packages/documentation/.unimportedrc.json b/packages/documentation/.unimportedrc.json
deleted file mode 100644
index 32066bf917..0000000000
--- a/packages/documentation/.unimportedrc.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "entry": [
- "pages/**/*.vue",
- "layouts/**/*.vue",
- "plugins/**/*.js",
- "nuxt.config.ts"
- ],
- "extensions": [".js", ".ts", ".vue"],
- "ignorePatterns": ["**/node_modules/**", "**/dist/**"],
- "ignoreUnimported": ["shims-*"],
- "ignoreUnresolved": [],
- "ignoreUnused": ["core-js"]
-}
diff --git a/packages/documentation/README.md b/packages/documentation/README.md
index e42d80568d..909c7e0ce9 100644
--- a/packages/documentation/README.md
+++ b/packages/documentation/README.md
@@ -1,11 +1,3 @@
# `@3yourmind/documentation`
> TODO: description
-
-## Usage
-
-```
-const documentation = require('@3yourmind/documentation');
-
-// TODO: DEMONSTRATE API
-```
diff --git a/packages/documentation/components/ActionBar.vue b/packages/documentation/components/ActionBar.vue
index 4249885e5e..5655d950e6 100644
--- a/packages/documentation/components/ActionBar.vue
+++ b/packages/documentation/components/ActionBar.vue
@@ -35,7 +35,8 @@