svg-layout-designer-react/.eslintrc.cjs

65 lines
1.7 KiB
JavaScript

module.exports = {
settings: {
react: {
version: "detect"
}
},
env: {
browser: true,
es2021: true
},
extends: [
'plugin:react/recommended',
'standard-with-typescript'
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: __dirname
},
plugins: [
'only-warn',
'react',
'react-hooks',
'@typescript-eslint'
],
rules: {
'prefer-arrow-callback': 'error',
'func-style': ['error', 'declaration'],
'space-before-function-paren': ['error', 'never'],
'max-len': ['error', { 'code': 120 }],
'max-depth': ['error', 4],
'function-paren-newline': ['error', 'multiline-arguments'],
'multiline-ternary': ['error', 'always'],
'prefer-template': "error",
// Import/export
'import/no-default-export': 'error',
'import/no-duplicates': 'error',
'import/newline-after-import': 'error',
'import/order': 'error',
// Typescript overload
indent: 'off',
semi: 'off',
"camelcase": "off",
'no-unused-vars': 'off',
// Typescript
'@typescript-eslint/space-before-function-paren': ['error', 'never'],
'@typescript-eslint/indent': ['warn', 2, {SwitchCase: 1}],
'@typescript-eslint/semi': ['warn', 'always'],
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/ban-types': ['error'],
'@typescript-eslint/no-floating-promises': 'off', // disabled cuz troublesome for SweetAlert since they never reject
// React
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn' // Checks effect dependencies
}
};