From 18711e3218dba50828c3ed1f03435a12ad7b1c4c Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins Date: Sat, 26 Aug 2023 14:06:27 +0100 Subject: [PATCH 1/3] :wrench: (eslint) convert rules from ERROR to WARN to improve devX --- .eslintrc.js | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 85e9ec47f58..0cfa2c01080 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -44,10 +44,10 @@ module.exports = { parserOptions: { project: [path.join(__dirname, './tsconfig.json')] }, reportUnusedDisableDirectives: true, rules: { - 'prettier/prettier': 'error', + 'prettier/prettier': 'warn', 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': [ - 'error', + 'warn', { args: 'none', varsIgnorePattern: '^_', @@ -55,17 +55,17 @@ module.exports = { }, ], - curly: ['error', 'multi-line', 'consistent'], + curly: ['warn', 'multi-line', 'consistent'], - 'no-restricted-globals': ['error'].concat( + 'no-restricted-globals': ['warn'].concat( require('confusing-browser-globals').filter(g => g !== 'self'), ), - 'react/jsx-no-useless-fragment': 'error', - 'react/self-closing-comp': 'error', + 'react/jsx-no-useless-fragment': 'warn', + 'react/self-closing-comp': 'warn', - 'rulesdir/typography': 'error', - 'rulesdir/prefer-if-statement': 'error', + 'rulesdir/typography': 'warn', + 'rulesdir/prefer-if-statement': 'warn', // https://github.com/eslint/eslint/issues/16954 // https://github.com/eslint/eslint/issues/16953 @@ -80,24 +80,24 @@ module.exports = { 'react/display-name': 'off', 'react/react-in-jsx-scope': 'off', // 'react-hooks/exhaustive-deps': [ - // 'error', + // 'warn', // { // additionalHooks: 'useLiveQuery', // }, // ], 'import/extensions': [ - 'error', + 'warn', 'never', { json: 'always', }, ], - 'import/no-useless-path-segments': 'error', - 'import/no-duplicates': ['error', { 'prefer-inline': true }], - 'import/no-unused-modules': ['error', { unusedExports: true }], + 'import/no-useless-path-segments': 'warn', + 'import/no-duplicates': ['warn', { 'prefer-inline': true }], + 'import/no-unused-modules': ['warn', { unusedExports: true }], 'import/order': [ - 'error', + 'warn', { alphabetize: { caseInsensitive: true, @@ -126,7 +126,7 @@ module.exports = { ], 'no-restricted-syntax': [ - 'error', + 'warn', { // forbid React.* as they are legacy https://twitter.com/dan_abramov/status/1308739731551858689 selector: @@ -142,7 +142,7 @@ module.exports = { }, ], 'no-restricted-imports': [ - 'error', + 'warn', { patterns: [...restrictedImportPatterns, ...restrictedImportColors] }, ], @@ -167,14 +167,14 @@ module.exports = { ], rules: { // enforce type over interface - '@typescript-eslint/consistent-type-definitions': ['error', 'type'], + '@typescript-eslint/consistent-type-definitions': ['warn', 'type'], // enforce import type '@typescript-eslint/consistent-type-imports': [ - 'error', + 'warn', { prefer: 'type-imports', fixStyle: 'inline-type-imports' }, ], '@typescript-eslint/ban-types': [ - 'error', + 'warn', { types: { // forbid FC as superflous @@ -190,7 +190,7 @@ module.exports = { files: ['./packages/loot-core/src/**/*'], rules: { 'no-restricted-imports': [ - 'error', + 'warn', { patterns: [ ...restrictedImportPatterns, From 0dbbb08fc4ff76516f7e3a749030c30da5ebb581 Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins Date: Sat, 26 Aug 2023 14:07:37 +0100 Subject: [PATCH 2/3] Release notes --- upcoming-release-notes/1598.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 upcoming-release-notes/1598.md diff --git a/upcoming-release-notes/1598.md b/upcoming-release-notes/1598.md new file mode 100644 index 00000000000..fb2c2f2c45b --- /dev/null +++ b/upcoming-release-notes/1598.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [MatissJanis] +--- + +Convert eslint rules from "error" to "warn" to improve dev-experience; CI jobs treat warnings as errors, so we still have the same level of protection, but the local-dev experience is slightly improved From a9602704e23afcc51542bed85c8c976386dbc96e Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins Date: Sat, 26 Aug 2023 14:11:04 +0100 Subject: [PATCH 3/3] Rename 1598.md to 1599.md --- upcoming-release-notes/{1598.md => 1599.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename upcoming-release-notes/{1598.md => 1599.md} (100%) diff --git a/upcoming-release-notes/1598.md b/upcoming-release-notes/1599.md similarity index 100% rename from upcoming-release-notes/1598.md rename to upcoming-release-notes/1599.md