| 1 |
module.exports = { |
| 2 |
env: { |
| 3 |
browser: true, |
| 4 |
es2020: true, |
| 5 |
node: true, |
| 6 |
}, |
| 7 |
parser: '@typescript-eslint/parser', |
| 8 |
parserOptions: { |
| 9 |
ecmaVersion: 2020, |
| 10 |
sourceType: 'module', |
| 11 |
ecmaFeatures: { |
| 12 |
jsx: true, |
| 13 |
}, |
| 14 |
}, |
| 15 |
plugins: [ |
| 16 |
'@typescript-eslint', |
| 17 |
], |
| 18 |
rules: { |
| 19 |
// TypeScript specific rules |
| 20 |
'@typescript-eslint/no-unused-vars': 'off', // Allow unused vars for WordPress patterns |
| 21 |
'@typescript-eslint/no-explicit-any': 'off', // Allow any types for WordPress compatibility |
| 22 |
'@typescript-eslint/explicit-function-return-type': 'off', |
| 23 |
'@typescript-eslint/explicit-module-boundary-types': 'off', |
| 24 |
'@typescript-eslint/no-non-null-assertion': 'off', // Allow for WordPress patterns |
| 25 |
|
| 26 |
// General rules |
| 27 |
'no-console': 'off', // Allow console for debugging |
| 28 |
'no-debugger': 'error', |
| 29 |
'prefer-const': 'off', // Allow let for WordPress patterns |
| 30 |
'no-var': 'error', |
| 31 |
|
| 32 |
// Allow unused variables with underscore prefix |
| 33 |
'no-unused-vars': 'off', |
| 34 |
}, |
| 35 |
}; |
| 36 |
|