Skip to content

A local-first personal finance app

🔧 (eslint) convert rules from ERROR to WARN to improve devX (#1599)

Matiss Janis Aboltinsfaa4a7c0e28e
diff --git a/.eslintrc.js b/.eslintrc.js
index fb9d445ee5..89ea002f04 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,
diff --git a/upcoming-release-notes/1599.md b/upcoming-release-notes/1599.md
new file mode 100644
index 0000000000..fb2c2f2c45
--- /dev/null
+++ b/upcoming-release-notes/1599.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