96 lines
2.6 KiB
JavaScript
96 lines
2.6 KiB
JavaScript
module.exports = {
|
|
env: {
|
|
browser: true,
|
|
es2022: true,
|
|
node: true,
|
|
},
|
|
parserOptions: {
|
|
ecmaVersion: 2022,
|
|
},
|
|
parser: '@typescript-eslint/parser',
|
|
extends: [
|
|
'next',
|
|
'turbo',
|
|
'prettier',
|
|
'airbnb',
|
|
'airbnb-typescript',
|
|
'plugin:@typescript-eslint/recommended',
|
|
'plugin:unicorn/recommended',
|
|
],
|
|
plugins: ['react', 'prettier', '@typescript-eslint', 'unicorn', 'testing-library'],
|
|
settings: {
|
|
react: {
|
|
version: 'detect',
|
|
},
|
|
},
|
|
rules: {
|
|
'linebreak-style': ['error', 'windows'],
|
|
'comma-dangle': 'off',
|
|
'@typescript-eslint/comma-dangle': ['off'],
|
|
'react/react-in-jsx-scope': 'off',
|
|
'react/jsx-props-no-spreading': 'off',
|
|
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
|
|
'react/forbid-prop-types': 'off',
|
|
'react/require-default-props': [
|
|
'error',
|
|
{
|
|
ignoreFunctionalComponents: true,
|
|
},
|
|
],
|
|
'import/extensions': 'off',
|
|
'object-curly-newline': [
|
|
'warn',
|
|
{
|
|
ObjectExpression: 'always',
|
|
ObjectPattern: { multiline: true },
|
|
ImportDeclaration: 'never',
|
|
ExportDeclaration: { multiline: true, minProperties: 3 },
|
|
},
|
|
],
|
|
'lines-between-class-members': 'off',
|
|
'@typescript-eslint/lines-between-class-members': ['off'],
|
|
indent: 'off',
|
|
'@typescript-eslint/indent': ['off'],
|
|
'react/jsx-no-bind': [
|
|
'error',
|
|
{
|
|
ignoreDOMComponents: false,
|
|
ignoreRefs: false,
|
|
allowArrowFunctions: false,
|
|
allowFunctions: true,
|
|
allowBind: false,
|
|
},
|
|
],
|
|
'newline-before-return': 'warn',
|
|
'@typescript-eslint/consistent-type-imports': 'error',
|
|
'react/prop-types': 'off',
|
|
// Airbnb prefers forEach
|
|
'unicorn/no-array-for-each': 'off',
|
|
'unicorn/prevent-abbreviations': 'off',
|
|
'unicorn/no-null': 'off',
|
|
'unicorn/prefer-node-protocol': 'off',
|
|
'unicorn/no-array-reduce': 'off',
|
|
'unicorn/prefer-module': 'off',
|
|
'unicorn/text-encoding-identifier-case': 'off',
|
|
'unicorn/filename-case': [
|
|
'error',
|
|
{
|
|
case: 'kebabCase',
|
|
ignore: ['^.*.(jsx|tsx)$'],
|
|
},
|
|
],
|
|
'import/no-unresolved': 'warn',
|
|
'implicit-arrow-linebreak': 'warn',
|
|
'operator-linebreak': 'warn',
|
|
'function-paren-newline': 'warn',
|
|
'turbo/no-undeclared-env-vars': 'warn',
|
|
},
|
|
overrides: [
|
|
// Only uses Testing Library lint rules in test files
|
|
{
|
|
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
|
|
extends: ['plugin:testing-library/react'],
|
|
},
|
|
],
|
|
};
|