Skip to content

Instantly share code, notes, and snippets.

@balthild
Last active September 18, 2024 17:46
Show Gist options
  • Save balthild/ba9b6367c7fca8cf27cef62775547ff2 to your computer and use it in GitHub Desktop.
Save balthild/ba9b6367c7fca8cf27cef62775547ff2 to your computer and use it in GitHub Desktop.
import js from '@eslint/js';
import stylistic from '@stylistic/eslint-plugin';
import react from 'eslint-plugin-react';
import ts from 'typescript-eslint';
/**
* @type { import("eslint").Linter.Config[] }
*/
export default [
js.configs.recommended,
...ts.configs.recommended,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
stylistic.configs.customize({
jsx: true,
semi: true,
arrowParens: true,
braceStyle: '1tbs',
}),
{
settings: {
react: {
version: 'detect',
},
},
rules: {
'prefer-const': 'warn',
'react/prop-types': 'off',
'react/display-name': 'off',
'@stylistic/jsx-one-expression-per-line': ['error', { allow: 'single-line' }],
'@stylistic/jsx-closing-bracket-location': ['error', { selfClosing: 'line-aligned', nonEmpty: 'after-props' }],
'@stylistic/object-curly-newline': ['error', { multiline: true, consistent: true }],
},
},
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment