Skip to content

Commit 515f297

Browse files
committed
chore: finalize ESLint flat config with unicorn rules and compatibility fixes
1 parent 8c96627 commit 515f297

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

eslint.config.mjs

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default [
1010
ignores: ['dist/**', 'node_modules/**', '.github/**', '*.d.ts', '*.config.js', '*.config.cjs', 'tests/types/**/*.ts'],
1111
},
1212
{
13+
// Overwriting this for now because web-e will conflict with this
1314
files: ['**/*.js', '**/*.jsx'],
1415
settings: {
1516
'import/resolver': {
@@ -63,17 +64,28 @@ export default [
6364
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
6465
'no-use-before-define': 'off',
6566
'@typescript-eslint/no-use-before-define': 'off',
66-
'@typescript-eslint/no-unused-vars': ['error', {argsIgnorePattern: '^_'}],
67+
'@typescript-eslint/no-unused-vars': ['error', {argsIgnorePattern: '^_', caughtErrors: 'none'}],
6768
'@typescript-eslint/consistent-type-imports': ['error', {prefer: 'type-imports'}],
6869
'@typescript-eslint/consistent-type-exports': ['error', {fixMixedExportsWithInlineTypeSpecifier: false}],
6970
'@typescript-eslint/no-non-null-assertion': 'off',
7071
'@typescript-eslint/array-type': ['error', {default: 'array-simple'}],
7172
'@typescript-eslint/consistent-type-definitions': 'off',
73+
'@typescript-eslint/no-empty-object-type': 'off',
7274
'rulesdir/no-multiple-onyx-in-file': 'off',
7375
'valid-jsdoc': 'off',
7476
'rulesdir/prefer-import-module-contents': 'off',
7577
'es/no-optional-chaining': 'off',
7678
'es/no-nullish-coalescing-operators': 'off',
79+
// Disable JSDoc type rules for TypeScript files (TypeScript provides the types)
80+
'jsdoc/require-param': 'off',
81+
'jsdoc/require-param-type': 'off',
82+
'jsdoc/check-param-names': 'off',
83+
'jsdoc/check-tag-names': 'off',
84+
'jsdoc/check-types': 'off',
85+
'no-func-assign': 'off',
86+
'no-loop-func': 'off',
87+
'no-redeclare': 'off',
88+
'@typescript-eslint/no-redeclare': 'error',
7789
'import/extensions': [
7890
'error',
7991
'ignorePackages',
@@ -88,7 +100,7 @@ export default [
88100
},
89101
},
90102
{
91-
files: ['tests/**/*.{js,jsx,ts,tsx}', 'jestSetup.js'],
103+
files: ['tests/**/*.{js,jsx,ts,tsx}', 'jestSetup.js', 'lib/**/__mocks__/**/*.{js,ts}'],
92104
languageOptions: {
93105
globals: {
94106
jest: 'readonly',
@@ -109,6 +121,21 @@ export default [
109121
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
110122
'import/extensions': 'off',
111123
'@typescript-eslint/no-require-imports': 'off',
124+
'no-restricted-imports': 'off',
125+
},
126+
},
127+
{
128+
files: ['**/*.native.ts', '**/*.native.tsx'],
129+
rules: {
130+
'@typescript-eslint/no-require-imports': 'off',
131+
},
132+
},
133+
{
134+
files: ['lib/storage/providers/MemoryOnlyProvider.ts'],
135+
languageOptions: {
136+
globals: {
137+
jest: 'readonly',
138+
},
112139
},
113140
},
114141
];

0 commit comments

Comments
 (0)