From fa90dbd8eafe3afd575aacd209c35e1021c84c94 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:02:16 +0200 Subject: [PATCH] test: enable all the automatic rules that support FlatConfig --- src/Umbraco.Web.UI.Client/eslint.config.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/eslint.config.js b/src/Umbraco.Web.UI.Client/eslint.config.js index e3bd4118c6..165c101f79 100644 --- a/src/Umbraco.Web.UI.Client/eslint.config.js +++ b/src/Umbraco.Web.UI.Client/eslint.config.js @@ -14,6 +14,9 @@ export default [ js.configs.recommended, ...tseslint.configs.recommended, eslintPluginPrettierRecommended, + wcPlugin.configs['flat/recommended'], + litPlugin.configs['flat/recommended'], + localRules.configs.all, // Global ignores { @@ -40,29 +43,21 @@ export default [ plugins: { import: importPlugin, 'local-rules': localRules, - wc: wcPlugin, - lit: litPlugin, 'lit-a11y': litA11yPlugin, storybook: storybookPlugin, }, rules: { semi: ['warn', 'always'], - "prettier/prettier": ["warn", {"endOfLine": "auto" }], + "prettier/prettier": ["warn", { "endOfLine": "auto" }], 'no-unused-vars': 'off', //Let '@typescript-eslint/no-unused-vars' catch the errors to allow unused function parameters (ex: in interfaces) 'no-var': 'error', + ...importPlugin.configs.recommended.rules, + 'import/namespace': 'off', 'import/no-unresolved': 'off', 'import/order': ['warn', { groups: ['builtin', 'parent', 'sibling', 'index', 'external'] }], 'import/no-self-import': 'error', 'import/no-cycle': ['error', { maxDepth: 6, allowUnsafeDynamicCyclicDependency: true }], - 'local-rules/bad-type-import': 'error', - 'local-rules/enforce-element-suffix-on-element-class-name': 'error', - 'local-rules/enforce-umb-prefix-on-element-name': 'error', - 'local-rules/ensure-relative-import-use-js-extension': 'error', - 'local-rules/no-direct-api-import': 'warn', - 'local-rules/prefer-import-aliases': 'error', 'local-rules/prefer-static-styles-last': 'warn', - 'local-rules/umb-class-prefix': 'error', - 'local-rules/no-relative-import-to-import-map-module': 'error', 'local-rules/enforce-umbraco-external-imports': [ 'error', {