From 2248b55037f10bdee41ea44e9ad95f9464b0830b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 14:27:27 +0000 Subject: [PATCH 1/3] chore(deps): update dependency eslint to v9 --- package.json | 2 +- yarn.lock | 122 +++++++++++++++++++++------------------------------ 2 files changed, 51 insertions(+), 73 deletions(-) diff --git a/package.json b/package.json index 58949b8030..11cf01fca1 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "custom-elements-manifest": "^2.0.0", "date-fns": "3.6.0", "esbuild-sass-plugin": "^3.1.0", - "eslint": "8.57.0", + "eslint": "9.0.0", "eslint-config-prettier": "9.1.0", "eslint-import-resolver-typescript": "3.6.1", "eslint-plugin-import": "npm:eslint-plugin-i@latest", diff --git a/yarn.lock b/yarn.lock index 33b4a642db..7372a4c571 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1528,25 +1528,25 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== -"@eslint/eslintrc@^2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad" - integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== +"@eslint/eslintrc@^3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.0.2.tgz#36180f8e85bf34d2fe3ccc2261e8e204a411ab4e" + integrity sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.6.0" - globals "^13.19.0" + espree "^10.0.1" + globals "^14.0.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" -"@eslint/js@8.57.0": - version "8.57.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" - integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== +"@eslint/js@9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.0.0.tgz#1a9e4b4c96d8c7886e0110ed310a0135144a1691" + integrity sha512-RThY/MnKrhubF6+s1JflwUjPEsnCEmYCWwqa/aRISKWNXGZ9epUwft4bUMM35SdKF9xvBrLydAM1RDHd1Z//ZQ== "@esm-bundle/chai@^4.3.4-fix.0": version "4.3.4-fix.0" @@ -1565,12 +1565,12 @@ resolved "https://registry.yarnpkg.com/@github/catalyst/-/catalyst-1.6.0.tgz#378734d1d2b6a85af169d7e66c1a2a604bf1e82c" integrity sha512-u8A+DameixqpeyHzvnJWTGj+wfiskQOYHzSiJscCWVfMkIT3rxnbHMtGh3lMthaRY21nbUOK71WcsCnCrXhBJQ== -"@humanwhocodes/config-array@^0.11.14": - version "0.11.14" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" - integrity sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg== +"@humanwhocodes/config-array@^0.12.3": + version "0.12.3" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.12.3.tgz#a6216d90f81a30bedd1d4b5d799b47241f318072" + integrity sha512-jsNnTBlMWuTpDkeE3on7+dWJi0D6fdDfeANj/w7MpS8ztROCoLvIO2nG0CcFj+E4k8j4QrSTh4Oryi3i2G669g== dependencies: - "@humanwhocodes/object-schema" "^2.0.2" + "@humanwhocodes/object-schema" "^2.0.3" debug "^4.3.1" minimatch "^3.0.5" @@ -1579,7 +1579,7 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== -"@humanwhocodes/object-schema@^2.0.2": +"@humanwhocodes/object-schema@^2.0.3": version "2.0.3" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== @@ -3229,7 +3229,7 @@ "@typescript-eslint/types" "7.6.0" eslint-visitor-keys "^3.4.3" -"@ungap/structured-clone@^1.0.0", "@ungap/structured-clone@^1.2.0": +"@ungap/structured-clone@^1.0.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== @@ -3682,7 +3682,7 @@ acorn@^7.0.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.11.3, acorn@^8.9.0: +acorn@^8.11.3: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== @@ -5725,54 +5725,55 @@ eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-scope@^7.2.2: - version "7.2.2" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" - integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== +eslint-scope@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.0.1.tgz#a9601e4b81a0b9171657c343fb13111688963cfc" + integrity sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint@8.57.0: - version "8.57.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.0.tgz#c786a6fd0e0b68941aaf624596fb987089195668" - integrity sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ== +eslint-visitor-keys@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz#e3adc021aa038a2a8e0b2f8b0ce8f66b9483b1fb" + integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw== + +eslint@9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.0.0.tgz#6270548758e390343f78c8afd030566d86927d40" + integrity sha512-IMryZ5SudxzQvuod6rUdIUz29qFItWx281VhtFVc2Psy/ZhlCeD/5DT6lBIJ4H3G+iamGJoTln1v+QSuPw0p7Q== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.4" - "@eslint/js" "8.57.0" - "@humanwhocodes/config-array" "^0.11.14" + "@eslint/eslintrc" "^3.0.2" + "@eslint/js" "9.0.0" + "@humanwhocodes/config-array" "^0.12.3" "@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" + eslint-scope "^8.0.1" + eslint-visitor-keys "^4.0.0" + espree "^10.0.1" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" + file-entry-cache "^8.0.0" 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" @@ -5782,14 +5783,14 @@ eslint@8.57.0: strip-ansi "^6.0.1" text-table "^0.2.0" -espree@^9.6.0, espree@^9.6.1: - version "9.6.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" - integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== +espree@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-10.0.1.tgz#600e60404157412751ba4a6f3a2ee1a42433139f" + integrity sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww== dependencies: - acorn "^8.9.0" + acorn "^8.11.3" acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.4.1" + eslint-visitor-keys "^4.0.0" esprima@^4.0.0, esprima@^4.0.1, esprima@~4.0.0: version "4.0.1" @@ -5998,13 +5999,6 @@ fetch-retry@^5.0.2: resolved "https://registry.yarnpkg.com/fetch-retry/-/fetch-retry-5.0.6.tgz#17d0bc90423405b7a88b74355bf364acd2a7fa56" integrity sha512-3yurQZ2hD9VISAhJJP9bpYFNQrHHBXE2JxxjY5aLEcDi46RmAzJE2OC9FAde0yis5ElW0jTTzs0zfg/Cca4XqQ== -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== - dependencies: - flat-cache "^3.0.4" - file-entry-cache@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" @@ -6122,15 +6116,6 @@ find-up@^7.0.0: path-exists "^5.0.0" unicorn-magic "^0.1.0" -flat-cache@^3.0.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" - integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== - dependencies: - flatted "^3.2.9" - keyv "^4.5.3" - rimraf "^3.0.2" - flat-cache@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c" @@ -6445,12 +6430,10 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globals@^13.19.0: - version "13.24.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" - integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== - dependencies: - type-fest "^0.20.2" +globals@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" + integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== globalthis@^1.0.3: version "1.0.3" @@ -7424,7 +7407,7 @@ keygrip@~1.1.0: dependencies: tsscmp "1.0.6" -keyv@^4.5.3, keyv@^4.5.4: +keyv@^4.5.4: version "4.5.4" resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== @@ -10843,11 +10826,6 @@ type-fest@^0.16.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.16.0.tgz#3240b891a78b0deae910dbeb86553e552a148860" integrity sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg== -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - type-fest@^0.21.3: version "0.21.3" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" From ee915666f6f64512b31c9439e0c09fee67f2d0b7 Mon Sep 17 00:00:00 2001 From: Jeremias Peier Date: Tue, 9 Apr 2024 14:11:25 +0200 Subject: [PATCH 2/3] build: update eslint.config.js --- .eslintignore | 6 - .eslintrc.json | 135 ----------- eslint.config.js | 137 +++++++++++ package.json | 23 +- .../link/common/block-link-common.ts | 2 +- .../link/common/inline-link-common.ts | 2 +- .../eslint/custom-element-class-name-rule.ts | 2 +- .../custom-element-decorator-position-rule.ts | 2 +- tools/eslint/import-extension-rule.ts | 2 +- tools/eslint/index.ts | 33 ++- tools/eslint/link/index.js | 4 - tools/eslint/link/package.json | 5 - .../missing-component-documentation-rule.ts | 2 +- yarn.lock | 218 ++++++------------ 14 files changed, 246 insertions(+), 327 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.json create mode 100644 eslint.config.js delete mode 100644 tools/eslint/link/index.js delete mode 100644 tools/eslint/link/package.json diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 88155ca4e6..0000000000 --- a/.eslintignore +++ /dev/null @@ -1,6 +0,0 @@ -dist/ -tools/generate-component/boilerplate/ -**/__snapshots__/ - -# not ignored folders/files -!.github/ diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index e71721656c..0000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "root": true, - "env": { - "browser": true, - "es2020": true, - "node": true - }, - "extends": ["eslint:recommended"], - "ignorePatterns": ["**/*.chromatic.stories.*"], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 2020 - }, - "settings": { - "import/resolver": { - "typescript": true - } - }, - "overrides": [ - { - "files": ["*.js"], - "extends": ["prettier"], - "rules": { - "no-unused-vars": [ - "error", - { - "vars": "all", - "varsIgnorePattern": "h" - } - ] - } - }, - { - "files": ["*.ts"], - "extends": [ - "plugin:@typescript-eslint/recommended", - "plugin:import/recommended", - "plugin:import/typescript", - "plugin:lit/recommended", - "plugin:lyne/all", - "prettier" - ], - "rules": { - "@typescript-eslint/array-type": "error", - "@typescript-eslint/consistent-type-imports": "error", - "@typescript-eslint/explicit-function-return-type": ["warn", { "allowExpressions": true }], - "@typescript-eslint/explicit-member-accessibility": "error", - "@typescript-eslint/naming-convention": [ - "error", - { - "format": ["PascalCase"], - "selector": "interface" - }, - { - "format": ["camelCase"], - "selector": "default" - }, - { - "format": ["camelCase", "UPPER_CASE"], - "selector": "variable" - }, - { - "format": ["camelCase"], - "leadingUnderscore": "allow", - "selector": "parameter" - }, - { - "format": ["camelCase"], - "leadingUnderscore": "require", - "modifiers": ["private"], - "selector": "memberLike" - }, - { - "format": ["PascalCase"], - "selector": "typeLike" - }, - { - "format": null, - "selector": "objectLiteralProperty" - } - ], - // TODO: Remove this after fixing issues - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unused-vars": [ - "error", - { - "args": "all", - "argsIgnorePattern": "^_" - } - ], - "@typescript-eslint/no-use-before-define": "error", - // TODO: Evaluate this rule - "@typescript-eslint/semi": "error", - - "import/first": "error", - "import/no-absolute-path": "error", - "import/no-cycle": "error", - "import/no-self-import": "error", - "import/no-unresolved": [ - "error", - { - "ignore": [ - "\\.md\\?raw$", - "\\.svg\\?raw$", - "\\.scss\\?lit\\&inline", - // Broken. Maybe due to commonjs? - "@storybook/addon-actions/decorator" - ] - } - ], - "import/no-useless-path-segments": "error", - "import/order": [ - "error", - { - "alphabetize": { "order": "asc", "caseInsensitive": true }, - "newlines-between": "always" - } - ], - // TODO Discuss this with the team - "lit/no-invalid-html": "off", - "camelcase": "off" - } - }, - { - "files": ["*.yaml", "*.yml"], - "plugins": ["yaml"] - }, - { - "files": ["*.stories.ts"], - "rules": { - "@typescript-eslint/naming-convention": "off" - } - } - ] -} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000000..30adaeb109 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,137 @@ +// @ts-check +import 'tsx'; + +import { FlatCompat } from '@eslint/eslintrc'; + +import globals from 'globals'; +import tseslint from 'typescript-eslint'; +import eslintConfigPrettier from 'eslint-config-prettier'; +import eslintPluginYml from 'eslint-plugin-yml'; +import eslint from '@eslint/js'; +import { parse, parseForESLint } from '@typescript-eslint/parser'; +const eslintPluginLyne = await import('./tools/eslint/index.ts'); + +const compat = new FlatCompat({ + baseDirectory: import.meta.resolve('.'), +}); + +/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigFile} */ +export default [ + { + settings: { + 'import-x/resolver': { + typescript: true, + }, + }, + }, + { + languageOptions: { + globals: { ...globals.browser }, + ecmaVersion: 2020, + parser: { parse, parseForESLint }, + }, + }, + { + ignores: [ + '**/*.chromatic.stories.*', + 'dist/**/*', + 'tools/generate-component/boilerplate/**/*', + '**/__snapshots__/**/*', + ], + }, + eslint.configs.recommended, + ...tseslint.configs.recommended, + ...eslintPluginYml.configs['flat/standard'], + ...eslintPluginYml.configs['flat/prettier'], + ...compat.extends( + 'plugin:lit/recommended', + 'plugin:import-x/recommended', + 'plugin:import-x/typescript', + ), + eslintPluginLyne.default.configs.recommended, + { + files: ['**/*.ts'], + rules: { + '@typescript-eslint/array-type': 'error', + '@typescript-eslint/consistent-type-imports': 'error', + '@typescript-eslint/explicit-function-return-type': ['warn', { allowExpressions: true }], + '@typescript-eslint/explicit-member-accessibility': 'error', + '@typescript-eslint/naming-convention': [ + 'error', + { + format: ['PascalCase'], + selector: 'interface', + }, + { + format: ['camelCase'], + selector: 'default', + }, + { + format: ['camelCase', 'UPPER_CASE'], + selector: 'variable', + }, + { + format: ['camelCase'], + leadingUnderscore: 'allow', + selector: 'parameter', + }, + { + format: ['camelCase'], + leadingUnderscore: 'require', + modifiers: ['private'], + selector: 'memberLike', + }, + { + format: ['PascalCase'], + selector: 'typeLike', + }, + { + format: null, + selector: 'objectLiteralProperty', + }, + ], + // TODO: Remove this after fixing issues + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': [ + 'error', + { + args: 'all', + argsIgnorePattern: '^_', + }, + ], + '@typescript-eslint/no-use-before-define': 'error', + // TODO: Evaluate this rule + '@typescript-eslint/semi': 'error', + + 'import-x/first': 'error', + 'import-x/no-absolute-path': 'error', + 'import-x/no-cycle': 'error', + 'import-x/no-self-import': 'error', + 'import-x/no-unresolved': [ + 'error', + { + ignore: [ + '\\.md\\?raw$', + '\\.svg\\?raw$', + '\\.scss\\?lit\\&inline', + // Broken. Maybe due to commonjs? + '@storybook/addon-actions/decorator', + ], + }, + ], + 'import-x/no-useless-path-segments': 'error', + 'import-x/order': [ + 'error', + { + alphabetize: { order: 'asc', caseInsensitive: true }, + 'newlines-between': 'always', + }, + ], + // TODO Discuss this with the team + 'lit/no-invalid-html': 'off', + camelcase: 'off', + }, + }, + + eslintConfigPrettier, +]; diff --git a/package.json b/package.json index 11cf01fca1..5e37bd56bd 100644 --- a/package.json +++ b/package.json @@ -63,8 +63,10 @@ "@commitlint/config-conventional": "19.1.0", "@custom-elements-manifest/analyzer": "0.9.4", "@custom-elements-manifest/to-markdown": "0.1.0", + "@eslint/eslintrc": "3.0.2", + "@eslint/js": "9.0.0", "@lit-labs/testing": "0.2.3", - "@lit/react": "^1.0.1", + "@lit/react": "1.0.4", "@open-wc/lit-helpers": "0.7.0", "@open-wc/testing": "4.0.0", "@sbb-esta/lyne-design-tokens": "0.5.0", @@ -78,10 +80,10 @@ "@storybook/web-components": "8.0.6", "@storybook/web-components-vite": "8.0.6", "@types/glob": "8.1.0", - "@types/mocha": "^10.0.4", + "@types/mocha": "10.0.6", "@types/node": "20.12.6", "@types/react": "18.2.75", - "@types/react-dom": "^18.2.15", + "@types/react-dom": "18.2.24", "@typescript-eslint/eslint-plugin": "7.6.0", "@typescript-eslint/parser": "7.6.0", "@web/test-runner": "0.18.1", @@ -89,29 +91,29 @@ "@web/test-runner-playwright": "0.11.0", "@web/test-runner-puppeteer": "0.16.0", "chromatic": "11.3.0", - "custom-elements-manifest": "^2.0.0", + "custom-elements-manifest": "2.0.0", "date-fns": "3.6.0", - "esbuild-sass-plugin": "^3.1.0", + "esbuild-sass-plugin": "3.2.0", "eslint": "9.0.0", "eslint-config-prettier": "9.1.0", "eslint-import-resolver-typescript": "3.6.1", - "eslint-plugin-import": "npm:eslint-plugin-i@latest", + "eslint-plugin-import-x": "0.5.0", "eslint-plugin-lit": "1.11.0", - "eslint-plugin-lyne": "file:tools/eslint/link/", "eslint-plugin-react": "7.34.1", "eslint-plugin-storybook": "0.8.0", - "eslint-plugin-yaml": "0.5.0", + "eslint-plugin-yml": "1.14.0", "glob": "10.3.12", + "globals": "15.0.0", "husky": "9.0.11", "lint-staged": "15.2.2", "lit-analyzer": "2.0.3", "madge": "7.0.0", "npm-run-all2": "6.1.2", - "playwright": "^1.41.1", + "playwright": "1.43.0", "postcss": "8.4.38", "prettier": "3.2.5", "react": "18.2.0", - "react-dom": "^18.2.0", + "react-dom": "18.2.0", "rollup-plugin-postcss-lit": "2.1.0", "sass": "1.74.1", "sinon": "17.0.1", @@ -123,6 +125,7 @@ "ts-lit-plugin": "2.0.2", "tsx": "4.7.2", "typescript": "5.4.4", + "typescript-eslint": "7.6.0", "vite": "5.2.8", "vite-plugin-dts": "3.8.1" }, diff --git a/src/components/link/common/block-link-common.ts b/src/components/link/common/block-link-common.ts index 5b92ab5a9a..8493248f43 100644 --- a/src/components/link/common/block-link-common.ts +++ b/src/components/link/common/block-link-common.ts @@ -8,7 +8,7 @@ import type { AbstractConstructor } from '../../core/mixins/index.js'; import { SbbIconNameMixin } from '../../icon/index.js'; import { SbbLinkCommonElementMixin, type SbbLinkCommonElementMixinType } from './link-common.js'; -// eslint-disable-next-line import/order +// eslint-disable-next-line import-x/order import blockStyle from './block-link.scss?lit&inline'; import style from './link.scss?lit&inline'; diff --git a/src/components/link/common/inline-link-common.ts b/src/components/link/common/inline-link-common.ts index 0411aa1caf..1e408634ba 100644 --- a/src/components/link/common/inline-link-common.ts +++ b/src/components/link/common/inline-link-common.ts @@ -4,7 +4,7 @@ import type { SbbActionBaseElement } from '../../core/base-elements/index.js'; import type { AbstractConstructor } from '../../core/mixins/index.js'; import { SbbLinkCommonElementMixin, type SbbLinkCommonElementMixinType } from './link-common.js'; -// eslint-disable-next-line import/order +// eslint-disable-next-line import-x/order import inlineStyle from './inline-link.scss?lit&inline'; import style from './link.scss?lit&inline'; diff --git a/tools/eslint/custom-element-class-name-rule.ts b/tools/eslint/custom-element-class-name-rule.ts index 642d4ef31a..2bb2c013d2 100644 --- a/tools/eslint/custom-element-class-name-rule.ts +++ b/tools/eslint/custom-element-class-name-rule.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/naming-convention, import/no-unresolved */ +/* eslint-disable @typescript-eslint/naming-convention, import-x/no-unresolved */ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils'; diff --git a/tools/eslint/custom-element-decorator-position-rule.ts b/tools/eslint/custom-element-decorator-position-rule.ts index d45d8de1dd..187e40746c 100644 --- a/tools/eslint/custom-element-decorator-position-rule.ts +++ b/tools/eslint/custom-element-decorator-position-rule.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/naming-convention, import/no-unresolved */ +/* eslint-disable @typescript-eslint/naming-convention, import-x/no-unresolved */ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import { ESLintUtils } from '@typescript-eslint/utils'; diff --git a/tools/eslint/import-extension-rule.ts b/tools/eslint/import-extension-rule.ts index 6e8d4ddc2f..284a55e68a 100644 --- a/tools/eslint/import-extension-rule.ts +++ b/tools/eslint/import-extension-rule.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/naming-convention, import/no-unresolved */ +/* eslint-disable @typescript-eslint/naming-convention, import-x/no-unresolved */ import { existsSync, statSync } from 'fs'; import { dirname, resolve } from 'path'; diff --git a/tools/eslint/index.ts b/tools/eslint/index.ts index a7b37db408..84190b6b02 100644 --- a/tools/eslint/index.ts +++ b/tools/eslint/index.ts @@ -3,22 +3,33 @@ import * as customElementDecoratorPosition from './custom-element-decorator-posi import * as importExtensionRule from './import-extension-rule.js'; import * as missingComponentDocumentation from './missing-component-documentation-rule.js'; -export default { +const plugin = { + meta: { + name: 'lyne', + }, + configs: {}, rules: { [missingComponentDocumentation.name]: missingComponentDocumentation.rule, [customElementClassName.name]: customElementClassName.rule, [importExtensionRule.name]: importExtensionRule.rule, [customElementDecoratorPosition.name]: customElementDecoratorPosition.rule, }, - configs: { - all: { - plugins: ['lyne'], - rules: { - [`lyne/${customElementClassName.name}`]: 'error', - [`lyne/${customElementDecoratorPosition.name}`]: 'error', - [`lyne/${importExtensionRule.name}`]: 'error', - [`lyne/${missingComponentDocumentation.name}`]: 'error', - }, +}; + +// assign configs here so we can reference `plugin` +Object.assign(plugin.configs, { + recommended: { + plugins: { + lyne: plugin, + }, + rules: { + [`lyne/${customElementClassName.name}`]: 'error', + [`lyne/${customElementDecoratorPosition.name}`]: 'error', + [`lyne/${importExtensionRule.name}`]: 'error', + [`lyne/${missingComponentDocumentation.name}`]: 'error', }, }, -}; +}); + +// for ESM +export default plugin; diff --git a/tools/eslint/link/index.js b/tools/eslint/link/index.js deleted file mode 100644 index e044c3cc82..0000000000 --- a/tools/eslint/link/index.js +++ /dev/null @@ -1,4 +0,0 @@ -require('tsx/cjs'); -const lyneConfig = require('../../tools/eslint/index.ts'); - -module.exports = lyneConfig.default ?? lyneConfig; diff --git a/tools/eslint/link/package.json b/tools/eslint/link/package.json deleted file mode 100644 index 994c9d3e87..0000000000 --- a/tools/eslint/link/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "eslint-plugin-lyne", - "version": "0.0.0", - "main": "index.js" -} diff --git a/tools/eslint/missing-component-documentation-rule.ts b/tools/eslint/missing-component-documentation-rule.ts index 4b1b76bc58..0ab2d7e70a 100644 --- a/tools/eslint/missing-component-documentation-rule.ts +++ b/tools/eslint/missing-component-documentation-rule.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/naming-convention, import/no-unresolved */ +/* eslint-disable @typescript-eslint/naming-convention, import-x/no-unresolved */ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import { ESLintUtils } from '@typescript-eslint/utils'; import { parse, stringify } from 'comment-parser'; diff --git a/yarn.lock b/yarn.lock index 7372a4c571..8655774a5b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1528,7 +1528,7 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== -"@eslint/eslintrc@^3.0.2": +"@eslint/eslintrc@3.0.2", "@eslint/eslintrc@^3.0.2": version "3.0.2" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.0.2.tgz#36180f8e85bf34d2fe3ccc2261e8e204a411ab4e" integrity sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg== @@ -1665,7 +1665,7 @@ "@webcomponents/template-shadowroot" "^0.1.0" lit "^2.0.0 || ^3.0.0" -"@lit/react@^1.0.1": +"@lit/react@1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@lit/react/-/react-1.0.4.tgz#85538bea5c04b812903122e597f33b652e302576" integrity sha512-6HBvk3AwF46z17fTkZp5F7/EdCJW9xqqQgYKr3sQGgoEJv0TKV1voWydG4UQQA2RWkoD4SHjy08snSpzyoyd0w== @@ -2944,7 +2944,7 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== -"@types/mocha@^10.0.4": +"@types/mocha@10.0.6": version "10.0.6" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.6.tgz#818551d39113081048bdddbef96701b4e8bb9d1b" integrity sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg== @@ -2991,7 +2991,7 @@ resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.7.tgz#50ae4353eaaddc04044279812f52c8c65857dbcb" integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ== -"@types/react-dom@^18.2.15": +"@types/react-dom@18.2.24": version "18.2.24" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.24.tgz#8dda8f449ae436a7a6e91efed8035d4ab03ff759" integrity sha512-cN6upcKd8zkGy4HU9F1+/s98Hrp6D4MOcippK4PoE8OZRngohHZpbJn1GsaDLz87MqvHNoT13nHvNqM9ocRHZg== @@ -3186,7 +3186,7 @@ semver "^7.6.0" ts-api-utils "^1.3.0" -"@typescript-eslint/utils@7.6.0": +"@typescript-eslint/utils@7.6.0", "@typescript-eslint/utils@^7.4.0": version "7.6.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.6.0.tgz#e400d782280b6f724c8a1204269d984c79202282" integrity sha512-x54gaSsRRI+Nwz59TXpCsr6harB98qjXYzsRxGqvA5Ue3kQH+FxS7FYU81g/omn22ML2pZJkisy6Q+ElK8pBCA== @@ -4484,14 +4484,6 @@ cli-truncate@^4.0.0: slice-ansi "^5.0.0" string-width "^7.0.0" -cli@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cli/-/cli-1.0.1.tgz#22817534f24bfa4950c34d532d48ecbc621b8c14" - integrity sha512-41U72MB56TfUMGndAKK8vJ78eooOD4Z5NOL4xEfjc0c23s+6EYKXlXsmACBVclLP1yOfWCgEganVzddVrSNoTg== - dependencies: - exit "0.1.2" - glob "^7.1.1" - cliui@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" @@ -4672,13 +4664,6 @@ consola@^3.2.3: resolved "https://registry.yarnpkg.com/consola/-/consola-3.2.3.tgz#0741857aa88cfa0d6fd53f1cff0375136e98502f" integrity sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ== -console-browserify@1.1.x: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" - integrity sha512-duS7VP5pvfsNLDvL1O4VOEbw37AI3A4ZUQYemvDlnpGrNu9tprR7BYWpDYwC0Xia0Zxz5ZupdiIrUp0GH1aXfg== - dependencies: - date-now "^0.1.4" - content-disposition@0.5.4, content-disposition@~0.5.2: version "0.5.4" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" @@ -4819,7 +4804,7 @@ custom-elements-manifest@1.0.0: resolved "https://registry.yarnpkg.com/custom-elements-manifest/-/custom-elements-manifest-1.0.0.tgz#b35c2129076a1dc9f95d720c6f7b5b71a857274b" integrity sha512-j59k0ExGCKA8T6Mzaq+7axc+KVHwpEphEERU7VZ99260npu/p/9kd+Db+I3cGKxHkM5y6q5gnlXn00mzRQkX2A== -custom-elements-manifest@^2.0.0: +custom-elements-manifest@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/custom-elements-manifest/-/custom-elements-manifest-2.0.0.tgz#6b234f7a57c68ecda291ea70882555729617de6d" integrity sha512-1MmhBRszwnNYqn56nkMeHXn/Zlh998+6Yal3wedbXI7NzKPG02GDgjspdN1NiuDtt2yb5n94JvFwPOF7Prnocg== @@ -4876,11 +4861,6 @@ date-fns@3.6.0: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-3.6.0.tgz#f20ca4fe94f8b754951b24240676e8618c0206bf" integrity sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww== -date-now@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" - integrity sha512-AsElvov3LoNB7tf5k37H2jYSB+ZZPMT5sG2QjJCcdlV5chIv6htBUBUui2IKRjgtKAKtCBN7Zbwa+MtwLjSeNw== - de-indent@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d" @@ -5216,39 +5196,6 @@ dom-accessibility-api@^0.6.3: resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz#993e925cc1d73f2c662e7d75dd5a5445259a8fd8" integrity sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w== -dom-serializer@0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51" - integrity sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g== - dependencies: - domelementtype "^2.0.1" - entities "^2.0.0" - -domelementtype@1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" - integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== - -domelementtype@^2.0.1: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" - integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== - -domhandler@2.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.3.0.tgz#2de59a0822d5027fabff6f032c2b25a2a8abe738" - integrity sha512-q9bUwjfp7Eif8jWxxxPSykdRZAb6GkguBGSgvvCrhI9wB71W2K/Kvv4E61CF/mcCfnVJDeDWx/Vb/uAqbDj6UQ== - dependencies: - domelementtype "1" - -domutils@1.5: - version "1.5.1" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" - integrity sha512-gSu5Oi/I+3wDENBsOWBiRK1eoGxcywYSqg3rR960/+EfY0CF4EX1VPkgHOZ3WiS/Jg2DtliF6BhWcHlfpYUcGw== - dependencies: - dom-serializer "0" - domelementtype "1" - dot-prop@^5.1.0: version "5.3.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" @@ -5323,16 +5270,6 @@ enhanced-resolve@^5.10.0, enhanced-resolve@^5.12.0, enhanced-resolve@^5.14.1: graceful-fs "^4.2.4" tapable "^2.2.0" -entities@1.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-1.0.0.tgz#b2987aa3821347fcde642b24fdfc9e4fb712bf26" - integrity sha512-LbLqfXgJMmy81t+7c14mnulFHJ170cM6E+0vMXR9k/ZiZwgX8i5pNgjTCX3SO4VeUsFLV+8InixoretwU+MjBQ== - -entities@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" - integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== - entities@^4.4.0, entities@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" @@ -5513,7 +5450,7 @@ esbuild-register@^3.5.0: dependencies: debug "^4.3.4" -esbuild-sass-plugin@^3.1.0: +esbuild-sass-plugin@3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/esbuild-sass-plugin/-/esbuild-sass-plugin-3.2.0.tgz#9ea19331bda6f0c12ab75a7b829f7a2078a8c8c5" integrity sha512-a+e7rYx4sDHgtKWN2n6/7lH5fgfvJaT6AMHmFhBKZy2ZTSN91X5q12l+DNVYJ8cWViEjJNWEd7k7UVcCg/2S/Q== @@ -5615,6 +5552,13 @@ escodegen@^2.0.0, escodegen@^2.1.0: optionalDependencies: source-map "~0.6.1" +eslint-compat-utils@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/eslint-compat-utils/-/eslint-compat-utils-0.5.0.tgz#f7b2eb2befec25a370fac76934d3f9189f312a65" + integrity sha512-dc6Y8tzEcSYZMHa+CMPLi/hyo1FzNeonbhJL7Ol0ccuKQkwopJcJBA9YL/xmMTLU1eKigXo9vj9nALElWYSowg== + dependencies: + semver "^7.5.4" + eslint-config-prettier@9.1.0: version "9.1.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz#31af3d94578645966c082fcb71a5846d3c94867f" @@ -5642,26 +5586,26 @@ eslint-import-resolver-typescript@3.6.1: is-core-module "^2.11.0" is-glob "^4.0.3" -eslint-module-utils@^2.7.4, eslint-module-utils@^2.8.0: +eslint-module-utils@^2.7.4: version "2.8.1" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz#52f2404300c3bd33deece9d7372fb337cc1d7c34" integrity sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q== dependencies: debug "^3.2.7" -"eslint-plugin-import@npm:eslint-plugin-i@latest": - version "2.29.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-i/-/eslint-plugin-i-2.29.1.tgz#97e4a055b6b2040cec0842700dd1d2066773b5a4" - integrity sha512-ORizX37MelIWLbMyqI7hi8VJMf7A0CskMmYkB+lkCX3aF4pkGV7kwx5bSEb4qx7Yce2rAf9s34HqDRPjGRZPNQ== +eslint-plugin-import-x@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import-x/-/eslint-plugin-import-x-0.5.0.tgz#e0b26584d1c166368d7fd9e338cb4edea8832443" + integrity sha512-C7R8Z4IzxmsoOPMtSzwuOBW5FH6iRlxHR6iTks+MzVlrk3r3TUxokkWTx3ypdj9nGOEP+CG/5e6ebZzHbxgbbQ== dependencies: + "@typescript-eslint/utils" "^7.4.0" debug "^4.3.4" doctrine "^3.0.0" eslint-import-resolver-node "^0.3.9" - eslint-module-utils "^2.8.0" - get-tsconfig "^4.7.2" + get-tsconfig "^4.7.3" is-glob "^4.0.3" - minimatch "^3.1.2" - semver "^7.5.4" + minimatch "^9.0.3" + semver "^7.6.0" eslint-plugin-lit@1.11.0: version "1.11.0" @@ -5672,9 +5616,6 @@ eslint-plugin-lit@1.11.0: parse5-htmlparser2-tree-adapter "^6.0.1" requireindex "^1.2.0" -"eslint-plugin-lyne@file:tools/eslint/link": - version "0.0.0" - eslint-plugin-react@7.34.1: version "7.34.1" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.34.1.tgz#6806b70c97796f5bbfb235a5d3379ece5f4da997" @@ -5709,13 +5650,16 @@ eslint-plugin-storybook@0.8.0: requireindex "^1.2.0" ts-dedent "^2.2.0" -eslint-plugin-yaml@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-yaml/-/eslint-plugin-yaml-0.5.0.tgz#8c79d9d6389b67cbcf58ef6f970c4c086665a63a" - integrity sha512-Z6km4HEiRptSuvzc96nXBND1Vlg57b7pzRmIJOgb9+3PAE+XpaBaiMx+Dg+3Y15tSrEMKCIZ9WoZMwkwUbPI8A== +eslint-plugin-yml@1.14.0: + version "1.14.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-yml/-/eslint-plugin-yml-1.14.0.tgz#98a019dfe4eb6837f881fb80d564df79cb05d8d9" + integrity sha512-ESUpgYPOcAYQO9czugcX5OqRvn/ydDVwGCPXY4YjPqc09rHaUVUA6IE6HLQys4rXk/S+qx3EwTd1wHCwam/OWQ== dependencies: - js-yaml "^4.1.0" - jshint "^2.13.0" + debug "^4.3.2" + eslint-compat-utils "^0.5.0" + lodash "^4.17.21" + natural-compare "^1.4.0" + yaml-eslint-parser "^1.2.1" eslint-scope@^5.1.1: version "5.1.1" @@ -5733,7 +5677,7 @@ eslint-scope@^8.0.1: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: +eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== @@ -5878,11 +5822,6 @@ execa@^5.0.0, execa@^5.1.1: signal-exit "^3.0.3" strip-final-newline "^2.0.0" -exit@0.1.2, exit@0.1.x: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== - express@^4.17.3: version "4.19.2" resolved "https://registry.yarnpkg.com/express/-/express-4.19.2.tgz#e25437827a3aa7f2a827bc8171bbbb664a356465" @@ -6315,7 +6254,7 @@ get-symbol-description@^1.0.2: es-errors "^1.3.0" get-intrinsic "^1.2.4" -get-tsconfig@^4.5.0, get-tsconfig@^4.7.2: +get-tsconfig@^4.5.0, get-tsconfig@^4.7.2, get-tsconfig@^4.7.3: version "4.7.3" resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.3.tgz#0498163d98f7b58484dd4906999c0c9d5f103f83" integrity sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg== @@ -6390,7 +6329,7 @@ glob@10.3.12, glob@^10.0.0: minipass "^7.0.4" path-scurry "^1.10.2" -glob@^7.1.1, glob@^7.1.3, glob@^7.2.3: +glob@^7.1.3, glob@^7.2.3: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -6425,6 +6364,11 @@ global-prefix@^3.0.0: kind-of "^6.0.2" which "^1.3.1" +globals@15.0.0: + version "15.0.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-15.0.0.tgz#9c6cd4e54327ceaab563b4c17ee5e9d181c03fd2" + integrity sha512-m/C/yR4mjO6pXDTm9/R/SpYTAIyaUB4EOzcaaMEl7mds7Mshct9GfejiJNQGjHHbdMPey13Kpu4TMbYi9ex1pw== + globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" @@ -6613,17 +6557,6 @@ html-tags@^3.3.1: resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.3.1.tgz#a04026a18c882e4bba8a01a3d39cfe465d40b5ce" integrity sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ== -htmlparser2@3.8.x: - version "3.8.3" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.8.3.tgz#996c28b191516a8be86501a7d79757e5c70c1068" - integrity sha512-hBxEg3CYXe+rPIua8ETe7tmG3XDn9B0edOE/e9wH2nLczxzgdu0m0aNHY+5wFZiviLWLdANPJTssa92dMcXQ5Q== - dependencies: - domelementtype "1" - domhandler "2.3" - domutils "1.5" - entities "1.0" - readable-stream "1.1" - http-assert@^1.3.0: version "1.5.0" resolved "https://registry.yarnpkg.com/http-assert/-/http-assert-1.5.0.tgz#c389ccd87ac16ed2dfa6246fd73b926aa00e6b8f" @@ -6758,7 +6691,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -7171,11 +7104,6 @@ is-wsl@^2.2.0: dependencies: is-docker "^2.0.0" -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== - isarray@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" @@ -7316,19 +7244,6 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== -jshint@^2.13.0: - version "2.13.6" - resolved "https://registry.yarnpkg.com/jshint/-/jshint-2.13.6.tgz#3679a2687a3066fa9034ef85d8c305613a31eec6" - integrity sha512-IVdB4G0NTTeQZrBoM8C5JFVLjV2KtZ9APgybDA1MK73xb09qFs0jCXyQLnCOp1cSZZZbvhq/6mfXHUTaDkffuQ== - dependencies: - cli "~1.0.0" - console-browserify "1.1.x" - exit "0.1.x" - htmlparser2 "3.8.x" - lodash "~4.17.21" - minimatch "~3.0.2" - strip-json-comments "1.0.x" - json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" @@ -7722,7 +7637,7 @@ lodash.upperfirst@^4.3.1: resolved "https://registry.yarnpkg.com/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz#1365edf431480481ef0d1c68957a5ed99d49f7ce" integrity sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg== -lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21, lodash@~4.17.15, lodash@~4.17.21: +lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.21, lodash@~4.17.15: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -8446,7 +8361,7 @@ minimatch@^9.0.0, minimatch@^9.0.1, minimatch@^9.0.3, minimatch@^9.0.4: dependencies: brace-expansion "^2.0.1" -minimatch@~3.0.2, minimatch@~3.0.3: +minimatch@~3.0.3: version "3.0.8" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.8.tgz#5e6a59bd11e2ab0de1cfb843eb2d82e546c321c1" integrity sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q== @@ -9147,7 +9062,7 @@ playwright-core@1.43.0: resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.43.0.tgz#d8079acb653abebb0b63062e432479647a4e1271" integrity sha512-iWFjyBUH97+pUFiyTqSLd8cDMMOS0r2ZYz2qEsPjH8/bX++sbIJT35MSwKnp1r/OQBAqC5XO99xFbJ9XClhf4w== -playwright@^1.22.2, playwright@^1.41.1: +playwright@1.43.0, playwright@^1.22.2: version "1.43.0" resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.43.0.tgz#2c2efd4ee2a25defd8c24c98ccb342bdd9d435f5" integrity sha512-SiOKHbVjTSf6wHuGCbqrEyzlm6qvXcv7mENP+OZon1I07brfZLGdfWV0l/efAzVx7TF3Z45ov1gPEkku9q25YQ== @@ -9465,7 +9380,7 @@ react-colorful@^5.1.2: resolved "https://registry.yarnpkg.com/react-colorful/-/react-colorful-5.6.1.tgz#7dc2aed2d7c72fac89694e834d179e32f3da563b" integrity sha512-1exovf0uGTGyq5mXQT0zgQ80uvj2PCwvF8zY1RN9/vbJVSjSo3fsB/4L3ObbF7u70NduSiK4xu4Y6q1MHoUGEw== -"react-dom@^16.8.0 || ^17.0.0 || ^18.0.0", react-dom@^18.2.0: +react-dom@18.2.0, "react-dom@^16.8.0 || ^17.0.0 || ^18.0.0": version "18.2.0" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g== @@ -9522,16 +9437,6 @@ read-pkg@^5.2.0: parse-json "^5.0.0" type-fest "^0.6.0" -readable-stream@1.1: - version "1.1.13" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.13.tgz#f6eef764f514c89e2b9e23146a75ba106756d23e" - integrity sha512-E98tWzqShvKDGpR2MbjsDkDQWLW2TfWUC15H4tNQhIJ5Lsta84l8nUGL9/ybltGwe+wZzWPpc1Kmd2wQP4bdCA== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - readable-stream@^2.0.0, readable-stream@~2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" @@ -10323,11 +10228,6 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ== - string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -10387,11 +10287,6 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" -strip-json-comments@1.0.x: - version "1.0.4" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" - integrity sha512-AOPG8EBc5wAikaG1/7uFCNFJwnKOuQwFTpYBdTW6OvWHeZBQBrAA/amefHGrEiOnCPcLFZK6FUPtWVKpQVIRgg== - strip-json-comments@^3.0.1, strip-json-comments@^3.1.1, strip-json-comments@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -10898,6 +10793,15 @@ typed-array-length@^1.0.6: is-typed-array "^1.1.13" possible-typed-array-names "^1.0.0" +typescript-eslint@7.6.0: + version "7.6.0" + resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-7.6.0.tgz#12dd1de864bedc39df8180ea44a585571586291b" + integrity sha512-LY6vH6F1l5jpGqRtU+uK4+mOecIb4Cd4kaz1hAiJrgnNiHUA8wiw8BkJyYS+MRLM69F1QuSKwtGlQqnGl1Rc6w== + dependencies: + "@typescript-eslint/eslint-plugin" "7.6.0" + "@typescript-eslint/parser" "7.6.0" + "@typescript-eslint/utils" "7.6.0" + typescript@5.4.2: version "5.4.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.2.tgz#0ae9cebcfae970718474fe0da2c090cad6577372" @@ -11514,11 +11418,25 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yaml-eslint-parser@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/yaml-eslint-parser/-/yaml-eslint-parser-1.2.2.tgz#1a9673ebe254328cfc2fa99f297f6d8c9364ccd8" + integrity sha512-pEwzfsKbTrB8G3xc/sN7aw1v6A6c/pKxLAkjclnAyo5g5qOh6eL9WGu0o3cSDQZKrTNk4KL4lQSwZW+nBkANEg== + dependencies: + eslint-visitor-keys "^3.0.0" + lodash "^4.17.21" + yaml "^2.0.0" + yaml@2.3.4: version "2.3.4" resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2" integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA== +yaml@^2.0.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.4.1.tgz#2e57e0b5e995292c25c75d2658f0664765210eed" + integrity sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg== + yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" From cc5415428c26153bb03a6535b1ee0344e9d40509 Mon Sep 17 00:00:00 2001 From: Lukas Spirig Date: Tue, 9 Apr 2024 17:09:00 +0200 Subject: [PATCH 3/3] fix: linting --- .github/ISSUE_TEMPLATE/bug-report.yml | 24 ++++++++--------- .../ISSUE_TEMPLATE/contributing-request.yml | 10 +++---- .../feature-request-or-enhancement.yml | 10 +++---- .github/ISSUE_TEMPLATE/question.yml | 6 ++--- .github/ISSUE_TEMPLATE/story.yml | 2 +- .github/workflows/codeql-analysis.yml | 6 ++--- .../continuous-integration-secure.yml | 4 +-- .github/workflows/continuous-integration.yml | 22 ++++++++-------- .github/workflows/pr-title-lint.yml | 4 +-- .github/workflows/preview-image-cleanup.yml | 4 +-- .github/workflows/release-please.yml | 8 +++--- .storybook/main.ts | 2 +- .storybook/manager.js | 2 +- .storybook/preview.ts | 3 ++- eslint.config.js | 21 +++++++++++---- scripts/chromatic-stories-generator.ts | 2 +- scripts/clean-storybook-files.cjs | 1 + scripts/docs_generate.ts | 1 + scripts/migrate-ssr-e2e.ts | 2 +- scripts/migrate-toggle-data-entry.ts | 2 +- .../alert/alert-group/alert-group.ts | 1 - .../autocomplete/autocomplete.stories.ts | 2 +- .../button/common/common-stories.ts | 2 +- src/components/calendar/calendar.stories.ts | 2 +- src/components/clock/clock.stories.ts | 2 +- .../sticky-bar/sticky-bar.stories.ts | 2 +- .../core/observers/mutation-observer.ts | 1 - .../core/testing/private/fixture.ts | 16 +++++++++++- .../datepicker-toggle.stories.ts | 2 +- .../datepicker/datepicker.stories.ts | 2 +- src/components/dialog/dialog.stories.ts | 2 +- .../expansion-panel/expansion-panel.ts | 1 - src/components/file-selector/file-selector.ts | 1 - src/components/footer/footer.stories.ts | 2 +- .../header/header/header.stories.ts | 2 +- src/components/image/image.stories.ts | 2 +- .../journey-summary.stories.ts | 2 +- .../loading-indicator.stories.ts | 2 +- src/components/menu/menu/menu.stories.ts | 2 +- .../navigation-section.stories.ts | 2 +- .../navigation/navigation.stories.ts | 2 +- src/components/overlay/overlay.stories.ts | 2 +- .../pearl-chain-time.stories.ts | 2 +- .../pearl-chain-vertical.stories.ts | 2 +- .../pearl-chain/pearl-chain.stories.ts | 2 +- .../popover/popover/popover.stories.ts | 2 +- .../selection-panel.stories.ts | 2 +- .../skiplink-list/skiplink-list.stories.ts | 2 +- src/components/tabs/tab-title/tab-title.ts | 1 - ...a.js => timetable-duration.sample-data.ts} | 0 .../timetable-row/timetable-row.stories.ts | 2 +- src/components/toast/toast.stories.ts | 2 +- .../toggle/toggle/toggle.stories.ts | 2 +- .../train/train-wagon/train-wagon.ts | 1 - src/components/train/train/train.ts | 1 - src/components/vite.config.ts | 1 - src/react/core/create-component.ts | 12 ++++++--- src/react/core/ssr-extensions.ts | 1 + .../pages/home/home--logged-in.stories.ts | 2 +- src/storybook/pages/home/home.common.ts | 2 +- src/vite-env.d.ts | 1 - .../eslint/custom-element-class-name-rule.ts | 1 - .../custom-element-decorator-position-rule.ts | 1 - tools/eslint/import-extension-rule.ts | 1 - tools/eslint/index.ts | 26 ++++++++----------- .../missing-component-documentation-rule.ts | 2 +- tools/vite/custom-elements-manifest.ts | 1 + tools/web-test-runner/index.js | 1 + 68 files changed, 141 insertions(+), 122 deletions(-) rename src/components/timetable-duration/{timetable-duration.sample-data.js => timetable-duration.sample-data.ts} (100%) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 1f7b203056..79992defb9 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -30,11 +30,11 @@ body: attributes: label: Bug type options: - - 'Functionality' - - 'Accessibility' - - 'Performance' - - 'Security vulnerability' - - 'Other' + - Functionality + - Accessibility + - Performance + - Security vulnerability + - Other validations: required: true - type: dropdown @@ -42,10 +42,10 @@ body: attributes: label: It affects the following packages options: - - 'Design Tokens' - - 'Components' - - 'Both' - - 'Other' + - Design Tokens + - Components + - Both + - Other validations: required: true - type: input @@ -78,9 +78,9 @@ body: attributes: label: Input mode options: - - 'Mouse/Keyboard' - - 'Touch' - - 'Other' + - Mouse/Keyboard + - Touch + - Other validations: required: false - type: input diff --git a/.github/ISSUE_TEMPLATE/contributing-request.yml b/.github/ISSUE_TEMPLATE/contributing-request.yml index 656e4f12fd..6d7d499d8e 100644 --- a/.github/ISSUE_TEMPLATE/contributing-request.yml +++ b/.github/ISSUE_TEMPLATE/contributing-request.yml @@ -25,8 +25,8 @@ body: attributes: label: Contribution type options: - - 'Contribute a new component' - - 'Contribute an enhancement of a component' + - Contribute a new component + - Contribute an enhancement of a component validations: required: true - type: dropdown @@ -34,10 +34,10 @@ body: attributes: label: It affects the following packages options: - - 'Design Tokens' - - 'Components' + - Design Tokens + - Components - 'Design Tokens & Components' - - 'Other' + - Other validations: required: true - type: textarea diff --git a/.github/ISSUE_TEMPLATE/feature-request-or-enhancement.yml b/.github/ISSUE_TEMPLATE/feature-request-or-enhancement.yml index 6e96309805..cc8ba44309 100644 --- a/.github/ISSUE_TEMPLATE/feature-request-or-enhancement.yml +++ b/.github/ISSUE_TEMPLATE/feature-request-or-enhancement.yml @@ -25,8 +25,8 @@ body: attributes: label: Request type options: - - 'Request for a new component' - - 'Request for enhancement of a component' + - Request for a new component + - Request for enhancement of a component validations: required: true - type: dropdown @@ -34,10 +34,10 @@ body: attributes: label: It affects the following packages options: - - 'Design Tokens' - - 'Components' + - Design Tokens + - Components - 'Design Tokens & Components' - - 'Other' + - Other validations: required: true - type: textarea diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index 4e94fd1545..c07a0c8f92 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -25,10 +25,10 @@ body: attributes: label: It affects the following packages options: - - 'Design Tokens' - - 'Components' + - Design Tokens + - Components - 'Design Tokens & Components' - - 'Other' + - Other validations: required: true - type: input diff --git a/.github/ISSUE_TEMPLATE/story.yml b/.github/ISSUE_TEMPLATE/story.yml index 546f5d2d44..3a29b83af5 100644 --- a/.github/ISSUE_TEMPLATE/story.yml +++ b/.github/ISSUE_TEMPLATE/story.yml @@ -1,7 +1,7 @@ name: '[Internal] Story' description: An internal story for lyne-components title: 'story(COMPONENT): TITLE' -labels: ['story', 'to-refine'] +labels: [story, to-refine] body: - type: textarea id: description diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1e3d5bd69a..5ba4456c20 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -9,7 +9,7 @@ # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. # -name: 'CodeQL' +name: CodeQL on: push: @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - language: ['javascript'] + language: [javascript] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] # Learn more: # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed @@ -63,7 +63,7 @@ jobs: # and modify them (or add more) to build your code if your project # uses a compiled language - #- run: | + # - run: | # make bootstrap # make release diff --git a/.github/workflows/continuous-integration-secure.yml b/.github/workflows/continuous-integration-secure.yml index 59f75244fe..13262d420b 100644 --- a/.github/workflows/continuous-integration-secure.yml +++ b/.github/workflows/continuous-integration-secure.yml @@ -5,7 +5,7 @@ name: Continuous Integration Secure # https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ on: workflow_run: - workflows: ['Continuous Integration'] + workflows: [Continuous Integration] types: [completed] permissions: @@ -73,7 +73,7 @@ jobs: # This label is used for filtering deployments in ArgoCD uses: actions-ecosystem/action-add-labels@v1 with: - labels: 'preview-available' + labels: preview-available number: ${{ env.PR_NUMBER }} codecov: diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4ce6272a57..2beaf55455 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -14,8 +14,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' - cache: 'yarn' + node-version-file: .nvmrc + cache: yarn - run: yarn install --frozen-lockfile --non-interactive - name: Run eslint @@ -27,8 +27,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' - cache: 'yarn' + node-version-file: .nvmrc + cache: yarn - run: yarn install --frozen-lockfile --non-interactive - name: 'Integrity: Verify workspace integrity' @@ -42,8 +42,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' - cache: 'yarn' + node-version-file: .nvmrc + cache: yarn - run: yarn install --frozen-lockfile --non-interactive - name: Install browser dependencies @@ -52,7 +52,7 @@ jobs: run: yarn test env: NODE_ENV: production - - name: 'Assert no new snapshots (run `yarn test --ci` if this fails)' + - name: Assert no new snapshots (run `yarn test --ci` if this fails) run: git diff --exit-code - name: Store coverage if: github.event_name == 'pull_request' @@ -67,8 +67,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' - cache: 'yarn' + node-version-file: .nvmrc + cache: yarn - run: yarn install --frozen-lockfile --non-interactive - name: Run build @@ -124,8 +124,8 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' - cache: 'yarn' + node-version-file: .nvmrc + cache: yarn - run: yarn install --frozen-lockfile --non-interactive - name: Generate chromatic stories run: yarn generate:chromatic-stories diff --git a/.github/workflows/pr-title-lint.yml b/.github/workflows/pr-title-lint.yml index 899464c057..0df1b2d696 100644 --- a/.github/workflows/pr-title-lint.yml +++ b/.github/workflows/pr-title-lint.yml @@ -12,8 +12,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' - cache: 'yarn' + node-version-file: .nvmrc + cache: yarn - run: yarn install --frozen-lockfile --non-interactive - name: 'Lint: Pull request title' diff --git a/.github/workflows/preview-image-cleanup.yml b/.github/workflows/preview-image-cleanup.yml index 2fc3e88cf7..3a9a8df931 100644 --- a/.github/workflows/preview-image-cleanup.yml +++ b/.github/workflows/preview-image-cleanup.yml @@ -56,6 +56,6 @@ jobs: } - uses: actions/delete-package-versions@v4 with: - package-name: 'lyne-components/storybook-preview' - package-type: 'container' + package-name: lyne-components/storybook-preview + package-type: container delete-only-untagged-versions: 'true' diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index edc545ff6b..21720da636 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -43,8 +43,8 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' - cache: 'yarn' + node-version-file: .nvmrc + cache: yarn registry-url: 'https://registry.npmjs.org' scope: sbb-esta - run: yarn install --frozen-lockfile --non-interactive @@ -106,8 +106,8 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' - cache: 'yarn' + node-version-file: .nvmrc + cache: yarn - run: yarn install --frozen-lockfile --non-interactive - name: Run build diff --git a/.storybook/main.ts b/.storybook/main.ts index 58377756ca..3def8b8f00 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -18,7 +18,7 @@ const config: StorybookConfig = { sourcemap: false, rollupOptions: { output: { - manualChunks(id) { + manualChunks(_id) { return 'main'; }, }, diff --git a/.storybook/manager.js b/.storybook/manager.js index 4f0c473d27..2367745518 100644 --- a/.storybook/manager.js +++ b/.storybook/manager.js @@ -1,5 +1,5 @@ import { addons } from '@storybook/manager-api'; -import theme from './theme'; +import theme from './theme.js'; addons.setConfig({ enableShortcuts: false, diff --git a/.storybook/preview.ts b/.storybook/preview.ts index faf16444f9..a04d97448f 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -1,7 +1,8 @@ import * as tokens from '@sbb-esta/lyne-design-tokens'; import '../src/components/core/styles/global.scss'; -const getViewportName = (key: string) => key.replace(/(^SbbBreakpoint|Min$)/g, '').toLowerCase(); +const getViewportName = (key: string): string => + key.replace(/(^SbbBreakpoint|Min$)/g, '').toLowerCase(); const breakpoints = Object.entries(tokens) .filter(([key]) => key.startsWith('SbbBreakpoint') && key.endsWith('Min')) .map(([key, value]) => ({ key: getViewportName(key), value: value as number })) diff --git a/eslint.config.js b/eslint.config.js index 30adaeb109..0fbd0b8950 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -8,7 +8,6 @@ import tseslint from 'typescript-eslint'; import eslintConfigPrettier from 'eslint-config-prettier'; import eslintPluginYml from 'eslint-plugin-yml'; import eslint from '@eslint/js'; -import { parse, parseForESLint } from '@typescript-eslint/parser'; const eslintPluginLyne = await import('./tools/eslint/index.ts'); const compat = new FlatCompat({ @@ -26,9 +25,7 @@ export default [ }, { languageOptions: { - globals: { ...globals.browser }, - ecmaVersion: 2020, - parser: { parse, parseForESLint }, + globals: { ...globals.browser, ...globals.node }, }, }, { @@ -132,6 +129,20 @@ export default [ camelcase: 'off', }, }, - + { + files: ['**/*.stories.ts'], + rules: { + '@typescript-eslint/naming-convention': 'off', + }, + }, + { + files: ['**/*.js'], + rules: { + 'import-x/namespace': 'off', + 'import-x/default': 'off', + 'import-x/no-named-as-default': 'off', + 'import-x/no-named-as-default-member': 'off', + }, + }, eslintConfigPrettier, ]; diff --git a/scripts/chromatic-stories-generator.ts b/scripts/chromatic-stories-generator.ts index 0151c631b8..e6d9e004e6 100644 --- a/scripts/chromatic-stories-generator.ts +++ b/scripts/chromatic-stories-generator.ts @@ -2,7 +2,7 @@ import { readdirSync, readFileSync, writeFileSync } from 'fs'; import { basename, dirname, join, relative } from 'path'; import { fileURLToPath } from 'url'; -import ts from 'typescript'; +import * as ts from 'typescript'; const chromaticFile = join( dirname(fileURLToPath(import.meta.url)), diff --git a/scripts/clean-storybook-files.cjs b/scripts/clean-storybook-files.cjs index fa2782a4d3..a873ad0ff9 100644 --- a/scripts/clean-storybook-files.cjs +++ b/scripts/clean-storybook-files.cjs @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ const fs = require('fs'), path = require('path'), allowedExtensions = diff --git a/scripts/docs_generate.ts b/scripts/docs_generate.ts index 050cded5d1..6736f5be46 100644 --- a/scripts/docs_generate.ts +++ b/scripts/docs_generate.ts @@ -1,6 +1,7 @@ /** * Docs: https://github.com/open-wc/custom-elements-manifest/tree/master/packages/to-markdown */ +/* eslint-disable import-x/namespace, import-x/default, import-x/no-named-as-default, import-x/no-named-as-default-member */ import fs from 'fs'; import { customElementsManifestToMarkdown } from '@custom-elements-manifest/to-markdown'; diff --git a/scripts/migrate-ssr-e2e.ts b/scripts/migrate-ssr-e2e.ts index 14e4250c35..48faf0b77e 100644 --- a/scripts/migrate-ssr-e2e.ts +++ b/scripts/migrate-ssr-e2e.ts @@ -4,7 +4,7 @@ import { basename, dirname, join, relative } from 'path'; import * as glob from 'glob'; // eslint-disable-next-line @typescript-eslint/naming-convention import MagicString from 'magic-string'; -import ts from 'typescript'; +import * as ts from 'typescript'; /* * Convert e2e test files to use the lit fixture, to enable ssr testing. diff --git a/scripts/migrate-toggle-data-entry.ts b/scripts/migrate-toggle-data-entry.ts index 3dcc4083c1..16a34e8bc9 100644 --- a/scripts/migrate-toggle-data-entry.ts +++ b/scripts/migrate-toggle-data-entry.ts @@ -3,7 +3,7 @@ import { readFileSync, writeFileSync } from 'fs'; import * as glob from 'glob'; // eslint-disable-next-line @typescript-eslint/naming-convention import MagicString from 'magic-string'; -import ts from 'typescript'; +import * as ts from 'typescript'; function* iterate(node: ts.Node): Generator { yield node; diff --git a/src/components/alert/alert-group/alert-group.ts b/src/components/alert/alert-group/alert-group.ts index e912000579..117078cd45 100644 --- a/src/components/alert/alert-group/alert-group.ts +++ b/src/components/alert/alert-group/alert-group.ts @@ -111,7 +111,6 @@ export class SbbAlertGroupElement extends LitElement { this._slotChanged(event)}> `; - /* eslint-disable lit/binding-positions */ } } diff --git a/src/components/autocomplete/autocomplete.stories.ts b/src/components/autocomplete/autocomplete.stories.ts index 4e61cda39c..e413b2defc 100644 --- a/src/components/autocomplete/autocomplete.stories.ts +++ b/src/components/autocomplete/autocomplete.stories.ts @@ -9,7 +9,7 @@ import type { Decorator, StoryContext, } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; diff --git a/src/components/button/common/common-stories.ts b/src/components/button/common/common-stories.ts index c9f1b3ef1a..382c235e4a 100644 --- a/src/components/button/common/common-stories.ts +++ b/src/components/button/common/common-stories.ts @@ -8,7 +8,7 @@ import type { StoryObj, WebComponentsRenderer, } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; import { html, unsafeStatic } from 'lit/static-html.js'; diff --git a/src/components/calendar/calendar.stories.ts b/src/components/calendar/calendar.stories.ts index e55ce2fdc0..9dd8acae59 100644 --- a/src/components/calendar/calendar.stories.ts +++ b/src/components/calendar/calendar.stories.ts @@ -1,7 +1,7 @@ import { withActions } from '@storybook/addon-actions/decorator'; import type { InputType } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args, Decorator } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; diff --git a/src/components/clock/clock.stories.ts b/src/components/clock/clock.stories.ts index 3181969336..70df338b8b 100644 --- a/src/components/clock/clock.stories.ts +++ b/src/components/clock/clock.stories.ts @@ -1,6 +1,6 @@ import type { InputType } from '@storybook/types'; import type { Args, Meta, StoryObj } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; diff --git a/src/components/container/sticky-bar/sticky-bar.stories.ts b/src/components/container/sticky-bar/sticky-bar.stories.ts index 548686a6b5..c4a3295a8d 100644 --- a/src/components/container/sticky-bar/sticky-bar.stories.ts +++ b/src/components/container/sticky-bar/sticky-bar.stories.ts @@ -1,6 +1,6 @@ import type { InputType } from '@storybook/types'; import type { ArgTypes, Args, Meta, StoryObj } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import { html, nothing, type TemplateResult } from 'lit'; import { sbbSpread } from '../../../storybook/helpers/spread.js'; diff --git a/src/components/core/observers/mutation-observer.ts b/src/components/core/observers/mutation-observer.ts index 477bd0101f..0ad99dcac4 100644 --- a/src/components/core/observers/mutation-observer.ts +++ b/src/components/core/observers/mutation-observer.ts @@ -3,7 +3,6 @@ export class NodeMutationObserver implements MutationObserver { // Noop } - // eslint-disable-next-line @typescript-eslint/no-unused-vars public observe(_target: Node, _options?: MutationObserverInit): void { // Noop } diff --git a/src/components/core/testing/private/fixture.ts b/src/components/core/testing/private/fixture.ts index ddaac0d4f4..7e3788ee48 100644 --- a/src/components/core/testing/private/fixture.ts +++ b/src/components/core/testing/private/fixture.ts @@ -1,9 +1,23 @@ -import type { FixtureOptions } from '@lit-labs/testing/lib/fixtures/fixture-options'; import type { TemplateResult } from 'lit'; import { isHydratedSsr, isNonHydratedSsr } from '../platform.js'; import { waitForLitRender } from '../wait-for-render.js'; +// Copied from @lit-labs/testing/lib/fixtures/fixture-options.d.ts +interface FixtureOptions { + /** + * Array of relative module paths to be imported before rendering. Normally + * would contain custom element definitions. + */ + modules: string[]; + /** + * Base url for resolving module paths. If not provided, will guess the + * location based on call stack to have the same effect as passing in + * `import.meta.url`. + */ + base?: string; +} + /** * We want to dynamically use the correct fixture from Lit testing for the current context. * However, currently @lit-labs/testing/fixtures.js also loads the Lit hydration logic diff --git a/src/components/datepicker/datepicker-toggle/datepicker-toggle.stories.ts b/src/components/datepicker/datepicker-toggle/datepicker-toggle.stories.ts index d7d0c4630c..658a1f526d 100644 --- a/src/components/datepicker/datepicker-toggle/datepicker-toggle.stories.ts +++ b/src/components/datepicker/datepicker-toggle/datepicker-toggle.stories.ts @@ -9,7 +9,7 @@ import type { Decorator, StoryContext, } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html, nothing } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; diff --git a/src/components/datepicker/datepicker/datepicker.stories.ts b/src/components/datepicker/datepicker/datepicker.stories.ts index 8ae063084c..f4304f4f8d 100644 --- a/src/components/datepicker/datepicker/datepicker.stories.ts +++ b/src/components/datepicker/datepicker/datepicker.stories.ts @@ -9,7 +9,7 @@ import type { StoryObj, StoryContext, } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import { nothing, type TemplateResult } from 'lit'; import { html } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; diff --git a/src/components/dialog/dialog.stories.ts b/src/components/dialog/dialog.stories.ts index 5b955bebaa..70f66ba68a 100644 --- a/src/components/dialog/dialog.stories.ts +++ b/src/components/dialog/dialog.stories.ts @@ -9,7 +9,7 @@ import type { Decorator, StoryContext, } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; diff --git a/src/components/expansion-panel/expansion-panel/expansion-panel.ts b/src/components/expansion-panel/expansion-panel/expansion-panel.ts index f514919bd8..c50df4ddf2 100644 --- a/src/components/expansion-panel/expansion-panel/expansion-panel.ts +++ b/src/components/expansion-panel/expansion-panel/expansion-panel.ts @@ -218,7 +218,6 @@ export class SbbExpansionPanelElement extends SbbHydrationMixin(LitElement) { `; - /* eslint-disable lit/binding-positions */ } } diff --git a/src/components/file-selector/file-selector.ts b/src/components/file-selector/file-selector.ts index ff303f6efa..7b17566ecb 100644 --- a/src/components/file-selector/file-selector.ts +++ b/src/components/file-selector/file-selector.ts @@ -269,7 +269,6 @@ export class SbbFileSelectorElement extends SbbDisabledMixin(LitElement) { )} `; - /* eslint-disable lit/binding-positions */ } protected override render(): TemplateResult { diff --git a/src/components/footer/footer.stories.ts b/src/components/footer/footer.stories.ts index c43fe7fd1b..2ec14e2fa8 100644 --- a/src/components/footer/footer.stories.ts +++ b/src/components/footer/footer.stories.ts @@ -1,6 +1,6 @@ import type { InputType } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; diff --git a/src/components/header/header/header.stories.ts b/src/components/header/header/header.stories.ts index 0c7a13b6e4..c1112d3061 100644 --- a/src/components/header/header/header.stories.ts +++ b/src/components/header/header/header.stories.ts @@ -9,7 +9,7 @@ import type { Decorator, StoryContext, } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; diff --git a/src/components/image/image.stories.ts b/src/components/image/image.stories.ts index d60a9eee38..ac9cbdf4c6 100644 --- a/src/components/image/image.stories.ts +++ b/src/components/image/image.stories.ts @@ -1,6 +1,6 @@ import type { InputType } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; diff --git a/src/components/journey-summary/journey-summary.stories.ts b/src/components/journey-summary/journey-summary.stories.ts index 3b749b963b..5d51882956 100644 --- a/src/components/journey-summary/journey-summary.stories.ts +++ b/src/components/journey-summary/journey-summary.stories.ts @@ -1,6 +1,6 @@ import type { InputType } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; diff --git a/src/components/loading-indicator/loading-indicator.stories.ts b/src/components/loading-indicator/loading-indicator.stories.ts index 62cea278b4..a5f7737fd0 100644 --- a/src/components/loading-indicator/loading-indicator.stories.ts +++ b/src/components/loading-indicator/loading-indicator.stories.ts @@ -1,7 +1,7 @@ import { userEvent, within } from '@storybook/test'; import type { InputType } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args, StoryContext } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; diff --git a/src/components/menu/menu/menu.stories.ts b/src/components/menu/menu/menu.stories.ts index ab9f295f79..7cc77e7b3a 100644 --- a/src/components/menu/menu/menu.stories.ts +++ b/src/components/menu/menu/menu.stories.ts @@ -9,7 +9,7 @@ import type { Decorator, StoryContext, } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; diff --git a/src/components/navigation/navigation-section/navigation-section.stories.ts b/src/components/navigation/navigation-section/navigation-section.stories.ts index c4f887f796..202443b69f 100644 --- a/src/components/navigation/navigation-section/navigation-section.stories.ts +++ b/src/components/navigation/navigation-section/navigation-section.stories.ts @@ -1,7 +1,7 @@ import { userEvent, waitFor, within } from '@storybook/test'; import type { InputType } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; diff --git a/src/components/navigation/navigation/navigation.stories.ts b/src/components/navigation/navigation/navigation.stories.ts index a50b10f6ae..c50e380ccb 100644 --- a/src/components/navigation/navigation/navigation.stories.ts +++ b/src/components/navigation/navigation/navigation.stories.ts @@ -9,7 +9,7 @@ import type { Decorator, StoryContext, } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html, nothing } from 'lit'; diff --git a/src/components/overlay/overlay.stories.ts b/src/components/overlay/overlay.stories.ts index 5e800d78e6..982882cbe2 100644 --- a/src/components/overlay/overlay.stories.ts +++ b/src/components/overlay/overlay.stories.ts @@ -9,7 +9,7 @@ import type { Decorator, StoryContext, } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; import { styleMap, type StyleInfo } from 'lit/directives/style-map.js'; diff --git a/src/components/pearl-chain-time/pearl-chain-time.stories.ts b/src/components/pearl-chain-time/pearl-chain-time.stories.ts index 4066a01558..89091ce40b 100644 --- a/src/components/pearl-chain-time/pearl-chain-time.stories.ts +++ b/src/components/pearl-chain-time/pearl-chain-time.stories.ts @@ -1,6 +1,6 @@ import type { InputType } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; diff --git a/src/components/pearl-chain-vertical/pearl-chain-vertical.stories.ts b/src/components/pearl-chain-vertical/pearl-chain-vertical.stories.ts index c00b035ff8..56514d4aaf 100644 --- a/src/components/pearl-chain-vertical/pearl-chain-vertical.stories.ts +++ b/src/components/pearl-chain-vertical/pearl-chain-vertical.stories.ts @@ -1,6 +1,6 @@ import type { InputType } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; diff --git a/src/components/pearl-chain/pearl-chain.stories.ts b/src/components/pearl-chain/pearl-chain.stories.ts index 78d87e14f6..8e41921982 100644 --- a/src/components/pearl-chain/pearl-chain.stories.ts +++ b/src/components/pearl-chain/pearl-chain.stories.ts @@ -1,6 +1,6 @@ import type { InputType } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; diff --git a/src/components/popover/popover/popover.stories.ts b/src/components/popover/popover/popover.stories.ts index f8910aa402..b0b3f4f5de 100644 --- a/src/components/popover/popover/popover.stories.ts +++ b/src/components/popover/popover/popover.stories.ts @@ -9,7 +9,7 @@ import type { StoryContext, StoryObj, } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; diff --git a/src/components/selection-panel/selection-panel.stories.ts b/src/components/selection-panel/selection-panel.stories.ts index d46c8912fa..f9e899995a 100644 --- a/src/components/selection-panel/selection-panel.stories.ts +++ b/src/components/selection-panel/selection-panel.stories.ts @@ -1,7 +1,7 @@ import { withActions } from '@storybook/addon-actions/decorator'; import type { InputType } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args, Decorator } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; import type { StyleInfo } from 'lit/directives/style-map.js'; diff --git a/src/components/skiplink-list/skiplink-list.stories.ts b/src/components/skiplink-list/skiplink-list.stories.ts index 390befd070..eaa2fc5e6c 100644 --- a/src/components/skiplink-list/skiplink-list.stories.ts +++ b/src/components/skiplink-list/skiplink-list.stories.ts @@ -1,7 +1,7 @@ import { userEvent, within } from '@storybook/test'; import type { InputType } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args, StoryContext } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; diff --git a/src/components/tabs/tab-title/tab-title.ts b/src/components/tabs/tab-title/tab-title.ts index 63aca482c8..79d8e3c5d0 100644 --- a/src/components/tabs/tab-title/tab-title.ts +++ b/src/components/tabs/tab-title/tab-title.ts @@ -57,7 +57,6 @@ export class SbbTabTitleElement extends SbbDisabledMixin(SbbIconNameMixin(LitEle `; - /* eslint-disable lit/binding-positions */ } } diff --git a/src/components/timetable-duration/timetable-duration.sample-data.js b/src/components/timetable-duration/timetable-duration.sample-data.ts similarity index 100% rename from src/components/timetable-duration/timetable-duration.sample-data.js rename to src/components/timetable-duration/timetable-duration.sample-data.ts diff --git a/src/components/timetable-row/timetable-row.stories.ts b/src/components/timetable-row/timetable-row.stories.ts index 7d18737ba0..6ee51720ca 100644 --- a/src/components/timetable-row/timetable-row.stories.ts +++ b/src/components/timetable-row/timetable-row.stories.ts @@ -1,7 +1,7 @@ import { withActions } from '@storybook/addon-actions/decorator'; import type { InputType } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args, Decorator } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; diff --git a/src/components/toast/toast.stories.ts b/src/components/toast/toast.stories.ts index c5cb5035d1..7b0db264f0 100644 --- a/src/components/toast/toast.stories.ts +++ b/src/components/toast/toast.stories.ts @@ -9,7 +9,7 @@ import type { Decorator, StoryContext, } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html, nothing } from 'lit'; diff --git a/src/components/toggle/toggle/toggle.stories.ts b/src/components/toggle/toggle/toggle.stories.ts index 081fd612b3..e2dae90c19 100644 --- a/src/components/toggle/toggle/toggle.stories.ts +++ b/src/components/toggle/toggle/toggle.stories.ts @@ -1,7 +1,7 @@ import { withActions } from '@storybook/addon-actions/decorator'; import type { InputType } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args, Decorator } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; diff --git a/src/components/train/train-wagon/train-wagon.ts b/src/components/train/train-wagon/train-wagon.ts index a8a51b7728..358dc823d9 100644 --- a/src/components/train/train-wagon/train-wagon.ts +++ b/src/components/train/train-wagon/train-wagon.ts @@ -126,7 +126,6 @@ export class SbbTrainWagonElement extends SbbNamedSlotListMixin `; - /* eslint-disable lit/binding-positions */ }; const sectorString = `${i18nSector[this._language.current]}, ${this.sector}`; diff --git a/src/components/train/train/train.ts b/src/components/train/train/train.ts index 4ff83bdd2b..26e2d5e895 100644 --- a/src/components/train/train/train.ts +++ b/src/components/train/train/train.ts @@ -128,7 +128,6 @@ export class SbbTrainElement extends SbbNamedSlotListMixin< } `; - /* eslint-disable lit/binding-positions */ } } diff --git a/src/components/vite.config.ts b/src/components/vite.config.ts index a0b9656607..cda7f88bb5 100644 --- a/src/components/vite.config.ts +++ b/src/components/vite.config.ts @@ -24,7 +24,6 @@ const barrelExports = Object.keys(entryPoints) .filter((v, _i, a) => a.some((e) => e.startsWith(`${v}/`))) .map((e) => `${e}/index.ts`); -/* eslint-disable @typescript-eslint/no-use-before-define */ export default defineConfig((config) => mergeConfig(rootConfig, { root: packageRoot.pathname, diff --git a/src/react/core/create-component.ts b/src/react/core/create-component.ts index 41609a49f2..1e944108e9 100644 --- a/src/react/core/create-component.ts +++ b/src/react/core/create-component.ts @@ -1,6 +1,11 @@ -/* eslint-disable @typescript-eslint/explicit-function-return-type */ -/* eslint-disable @typescript-eslint/ban-types */ -/* eslint-disable @typescript-eslint/naming-convention */ +/* eslint-disable + @typescript-eslint/explicit-function-return-type, + @typescript-eslint/ban-types, + @typescript-eslint/naming-convention, + @typescript-eslint/naming-convention, + import-x/default, + import-x/no-named-as-default-member +*/ /** * Copied from https://github.com/lit/lit/blob/main/packages/react/src/create-component.ts * TODO: Can be removed once https://github.com/lit/lit/issues/4023 or https://github.com/lit/lit/pull/4476 is solved. @@ -21,7 +26,6 @@ import type React from 'react'; const NODE_MODE = isServer; const DEV_MODE = import.meta.env.DEV; -// eslint-disable-next-line @typescript-eslint/no-explicit-any type DistributiveOmit = T extends any ? K extends keyof T ? Omit diff --git a/src/react/core/ssr-extensions.ts b/src/react/core/ssr-extensions.ts index 0c350e53b2..7d5a1ba219 100644 --- a/src/react/core/ssr-extensions.ts +++ b/src/react/core/ssr-extensions.ts @@ -1,3 +1,4 @@ +/* eslint-disable import-x/default, import-x/no-named-as-default-member */ import { isServer } from 'lit'; import type { ComponentType, JSXElementConstructor, ReactNode } from 'react'; import react, { Children, isValidElement } from 'react'; diff --git a/src/storybook/pages/home/home--logged-in.stories.ts b/src/storybook/pages/home/home--logged-in.stories.ts index 03eb4c864a..730524a370 100644 --- a/src/storybook/pages/home/home--logged-in.stories.ts +++ b/src/storybook/pages/home/home--logged-in.stories.ts @@ -1,6 +1,6 @@ import type { InputType } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; import { styleMap } from 'lit/directives/style-map.js'; diff --git a/src/storybook/pages/home/home.common.ts b/src/storybook/pages/home/home.common.ts index 2fe46c9386..e331bb6e57 100644 --- a/src/storybook/pages/home/home.common.ts +++ b/src/storybook/pages/home/home.common.ts @@ -1,5 +1,5 @@ import type { Args, StoryContext } from '@storybook/web-components'; -import isChromatic from 'chromatic'; +import isChromatic from 'chromatic/isChromatic'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 055705f788..9848f7e607 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ /* eslint-disable @typescript-eslint/consistent-type-imports */ /// diff --git a/tools/eslint/custom-element-class-name-rule.ts b/tools/eslint/custom-element-class-name-rule.ts index 2bb2c013d2..379e6b4409 100644 --- a/tools/eslint/custom-element-class-name-rule.ts +++ b/tools/eslint/custom-element-class-name-rule.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention, import-x/no-unresolved */ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils'; diff --git a/tools/eslint/custom-element-decorator-position-rule.ts b/tools/eslint/custom-element-decorator-position-rule.ts index 187e40746c..65c8ee5e6c 100644 --- a/tools/eslint/custom-element-decorator-position-rule.ts +++ b/tools/eslint/custom-element-decorator-position-rule.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention, import-x/no-unresolved */ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import { ESLintUtils } from '@typescript-eslint/utils'; diff --git a/tools/eslint/import-extension-rule.ts b/tools/eslint/import-extension-rule.ts index 284a55e68a..fdcddca635 100644 --- a/tools/eslint/import-extension-rule.ts +++ b/tools/eslint/import-extension-rule.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention, import-x/no-unresolved */ import { existsSync, statSync } from 'fs'; import { dirname, resolve } from 'path'; diff --git a/tools/eslint/index.ts b/tools/eslint/index.ts index 84190b6b02..5329ceff94 100644 --- a/tools/eslint/index.ts +++ b/tools/eslint/index.ts @@ -1,9 +1,11 @@ +import type { TSESLint } from '@typescript-eslint/utils'; + import * as customElementClassName from './custom-element-class-name-rule.js'; import * as customElementDecoratorPosition from './custom-element-decorator-position-rule.js'; import * as importExtensionRule from './import-extension-rule.js'; import * as missingComponentDocumentation from './missing-component-documentation-rule.js'; -const plugin = { +const plugin: Omit, 'processors'> = { meta: { name: 'lyne', }, @@ -16,20 +18,14 @@ const plugin = { }, }; -// assign configs here so we can reference `plugin` -Object.assign(plugin.configs, { - recommended: { - plugins: { - lyne: plugin, - }, - rules: { - [`lyne/${customElementClassName.name}`]: 'error', - [`lyne/${customElementDecoratorPosition.name}`]: 'error', - [`lyne/${importExtensionRule.name}`]: 'error', - [`lyne/${missingComponentDocumentation.name}`]: 'error', - }, +plugin.configs!.recommended = { + plugins: { + lyne: plugin, }, -}); + rules: Object.keys(plugin.rules!).reduce( + (current, next) => Object.assign(current, { [`lyne/${next}`]: 'error' }), + {} as TSESLint.FlatConfig.Rules, + ), +}; -// for ESM export default plugin; diff --git a/tools/eslint/missing-component-documentation-rule.ts b/tools/eslint/missing-component-documentation-rule.ts index 0ab2d7e70a..3f13ae3c47 100644 --- a/tools/eslint/missing-component-documentation-rule.ts +++ b/tools/eslint/missing-component-documentation-rule.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/naming-convention, import-x/no-unresolved */ +/* eslint-disable @typescript-eslint/naming-convention, import-x/namespace */ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import { ESLintUtils } from '@typescript-eslint/utils'; import { parse, stringify } from 'comment-parser'; diff --git a/tools/vite/custom-elements-manifest.ts b/tools/vite/custom-elements-manifest.ts index a6fdd85a82..7dd9bf8888 100644 --- a/tools/vite/custom-elements-manifest.ts +++ b/tools/vite/custom-elements-manifest.ts @@ -1,3 +1,4 @@ +/* eslint-disable import-x/namespace */ import { cli } from '@custom-elements-manifest/analyzer/cli'; import type { PluginOption } from 'vite'; diff --git a/tools/web-test-runner/index.js b/tools/web-test-runner/index.js index c61fb7ec0d..0eb5bcd92d 100644 --- a/tools/web-test-runner/index.js +++ b/tools/web-test-runner/index.js @@ -1,3 +1,4 @@ +/* eslint-disable import-x/export */ export * from './minimal-reporter.js'; export * from './patched-summary-reporter.js'; export * from './ssr-plugin.js';