diff --git a/.eslintrc.yml b/.eslintrc.yml index 6bfe8161b..ec43d0ed4 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -10,6 +10,7 @@ globals: extends: - 'eslint:recommended' - 'plugin:storybook/recommended' + - 'plugin:import/typescript' - prettier plugins: @@ -29,6 +30,7 @@ rules: no-empty: warn no-empty-function: warn no-useless-escape: 'off' + import/named: error import/order: [ 'error', @@ -51,6 +53,8 @@ settings: - ['@@', './app/react/components'] - ['@', './app'] extensions: ['.js', '.ts', '.tsx'] + typescript: true + node: true overrides: - files: @@ -75,6 +79,7 @@ overrides: settings: react: version: 'detect' + rules: import/order: [ diff --git a/app/react/components/ImageConfigFieldset/SimpleForm.tsx b/app/react/components/ImageConfigFieldset/SimpleForm.tsx index 08d473f33..bbb914686 100644 --- a/app/react/components/ImageConfigFieldset/SimpleForm.tsx +++ b/app/react/components/ImageConfigFieldset/SimpleForm.tsx @@ -1,8 +1,8 @@ import { FormikErrors } from 'formik'; import _ from 'lodash'; import { useMemo } from 'react'; -import { trimSHA, trimVersionTag } from 'Docker/filters/utils'; +import { trimSHA, trimVersionTag } from 'Docker/filters/utils'; import DockerIcon from '@/assets/ico/vendor/docker.svg?c'; import { useImages } from '@/react/docker/proxy/queries/images/useImages'; import { diff --git a/app/react/kubernetes/configs/CreateView/options.tsx b/app/react/kubernetes/configs/CreateView/options.tsx index 249faedf6..33368f7ab 100644 --- a/app/react/kubernetes/configs/CreateView/options.tsx +++ b/app/react/kubernetes/configs/CreateView/options.tsx @@ -1,6 +1,7 @@ -import { KubernetesConfigurationKinds } from 'Kubernetes/models/configuration/models'; import { FileCode, Lock } from 'lucide-react'; +import { KubernetesConfigurationKinds } from '@/kubernetes/models/configuration/models'; + import { BoxSelectorOption } from '@@/BoxSelector'; export const typeOptions: ReadonlyArray> = [ diff --git a/app/react/portainer/templates/app-templates/view-model.ts b/app/react/portainer/templates/app-templates/view-model.ts index 5714058c0..1fa9a6802 100644 --- a/app/react/portainer/templates/app-templates/view-model.ts +++ b/app/react/portainer/templates/app-templates/view-model.ts @@ -1,4 +1,5 @@ import _ from 'lodash'; + import { PorImageRegistryModel } from 'Docker/models/porImageRegistry'; import { Pair } from '../../settings/types'; diff --git a/package.json b/package.json index a84249979..e3f47a040 100644 --- a/package.json +++ b/package.json @@ -173,6 +173,7 @@ "eslint-config-airbnb-typescript": "^17.1.0", "eslint-config-prettier": "^9.0.0", "eslint-import-resolver-alias": "^1.1.2", + "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-import": "^2.28.1", "eslint-plugin-jsx-a11y": "^6.7.1", diff --git a/yarn.lock b/yarn.lock index 2941ed1b9..bb1ec9d78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9272,7 +9272,7 @@ endent@^2.0.1: fast-json-parse "^1.0.3" objectorarray "^1.0.5" -enhanced-resolve@^5.15.0: +enhanced-resolve@^5.12.0, enhanced-resolve@^5.15.0: version "5.15.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz#1af946c7d93603eb88e9896cee4904dc012e9c35" integrity sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg== @@ -9640,7 +9640,20 @@ eslint-import-resolver-node@^0.3.7: is-core-module "^2.11.0" resolve "^1.22.1" -eslint-module-utils@^2.8.0: +eslint-import-resolver-typescript@^3.6.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz#7b983680edd3f1c5bce1a5829ae0bc2d57fe9efa" + integrity sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg== + dependencies: + debug "^4.3.4" + enhanced-resolve "^5.12.0" + eslint-module-utils "^2.7.4" + fast-glob "^3.3.1" + get-tsconfig "^4.5.0" + is-core-module "^2.11.0" + is-glob "^4.0.3" + +eslint-module-utils@^2.7.4, eslint-module-utils@^2.8.0: version "2.8.0" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz#e439fee65fc33f6bba630ff621efc38ec0375c49" integrity sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw== @@ -10084,6 +10097,17 @@ fast-glob@^3.2.9: merge2 "^1.3.0" micromatch "^4.0.4" +fast-glob@^3.3.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" + integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-json-parse@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/fast-json-parse/-/fast-json-parse-1.0.3.tgz#43e5c61ee4efa9265633046b770fb682a7577c4d" @@ -10619,6 +10643,13 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" +get-tsconfig@^4.5.0: + version "4.7.2" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.2.tgz#0dcd6fb330391d46332f4c6c1bf89a6514c2ddce" + integrity sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A== + dependencies: + resolve-pkg-maps "^1.0.0" + get-user-locale@^1.2.0, get-user-locale@^1.4.0: version "1.5.1" resolved "https://registry.yarnpkg.com/get-user-locale/-/get-user-locale-1.5.1.tgz#18a9ba2cfeed0e713ea00968efa75d620523a5ea" @@ -15011,6 +15042,11 @@ resolve-from@^5.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== +resolve-pkg-maps@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" + integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== + resolve-url-loader@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/resolve-url-loader/-/resolve-url-loader-5.0.0.tgz#ee3142fb1f1e0d9db9524d539cfa166e9314f795"