2021-01-17 12:54:49 -08:00
|
|
|
module.exports = {
|
|
|
|
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
|
|
|
|
extends: [
|
2023-11-28 00:45:21 +08:00
|
|
|
'airbnb',
|
2021-01-17 12:54:49 -08:00
|
|
|
'airbnb-typescript',
|
|
|
|
'airbnb/hooks',
|
2023-11-28 00:45:21 +08:00
|
|
|
'plugin:@typescript-eslint/recommended',
|
2024-01-03 17:16:16 -05:00
|
|
|
'plugin:vitest/recommended',
|
2021-01-17 12:54:49 -08:00
|
|
|
'prettier',
|
|
|
|
],
|
2025-04-16 16:55:38 -07:00
|
|
|
plugins: ['@typescript-eslint', '@stylistic/js', 'react-refresh', 'import-alias'],
|
2021-01-17 12:54:49 -08:00
|
|
|
parserOptions: {
|
2021-05-28 02:23:09 +08:00
|
|
|
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
|
2021-01-17 12:54:49 -08:00
|
|
|
sourceType: 'module', // Allows for the use of imports
|
|
|
|
ecmaFeatures: {
|
|
|
|
jsx: true, // Allows for the parsing of JSX
|
|
|
|
},
|
|
|
|
project: './tsconfig.json',
|
|
|
|
},
|
|
|
|
rules: {
|
2023-11-28 00:45:21 +08:00
|
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
2025-03-25 14:48:23 -04:00
|
|
|
'@stylistic/js/comma-dangle': ['error', 'always-multiline'],
|
2023-11-28 00:45:21 +08:00
|
|
|
'arrow-body-style': 'off',
|
|
|
|
'class-methods-use-this': 'off',
|
|
|
|
'import/no-extraneous-dependencies': 'off',
|
2025-04-16 16:55:38 -07:00
|
|
|
'import/no-relative-packages': 'error',
|
2021-01-17 12:54:49 -08:00
|
|
|
'import/prefer-default-export': 'off', // TODO: remove this lint rule
|
2023-11-28 00:45:21 +08:00
|
|
|
'no-console': 'off',
|
2021-01-25 13:29:23 -08:00
|
|
|
'no-plusplus': 'off',
|
2021-02-05 14:21:04 -08:00
|
|
|
'no-prototype-builtins': 'off',
|
2023-11-28 00:45:21 +08:00
|
|
|
'no-restricted-exports': ['off', { restrictedNamedExports: ['default', 'then'] }],
|
2021-03-05 17:05:03 -08:00
|
|
|
'no-underscore-dangle': 'off',
|
2023-11-28 00:45:21 +08:00
|
|
|
'no-unsafe-optional-chaining': 'off',
|
|
|
|
'prefer-exponentiation-operator': 'off',
|
|
|
|
'prefer-regex-literals': 'off',
|
|
|
|
'react/destructuring-assignment': 'off',
|
|
|
|
'react/function-component-definition': 'off',
|
|
|
|
'react/jsx-no-bind': 'off',
|
|
|
|
'react/jsx-no-constructed-context-values': 'off',
|
|
|
|
'react/jsx-no-useless-fragment': 'off',
|
|
|
|
'react/jsx-props-no-spreading': 'off',
|
|
|
|
'react/no-unstable-nested-components': 'off',
|
|
|
|
'react/require-default-props': 'off',
|
2021-01-25 13:29:23 -08:00
|
|
|
'@typescript-eslint/no-unused-vars': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
varsIgnorePattern: '^_',
|
|
|
|
argsIgnorePattern: '^_',
|
|
|
|
},
|
|
|
|
],
|
2024-01-03 17:16:16 -05:00
|
|
|
'vitest/prefer-to-be': 'off',
|
2024-02-15 08:58:05 -05:00
|
|
|
'@typescript-eslint/no-use-before-define': ['error', { functions: false, classes: false }],
|
2024-08-19 20:47:07 -07:00
|
|
|
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
|
2025-04-16 16:55:38 -07:00
|
|
|
'import-alias/import-alias': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
aliases: [
|
|
|
|
// Must be kept consistent with tsconfig.json, vite.config.ts, and .prettierrc.js
|
|
|
|
{ alias: '@components/', matcher: '^src/alchemy-components/' },
|
|
|
|
{ alias: '@app/', matcher: '^src/app/' },
|
|
|
|
{ alias: '@conf/', matcher: '^src/conf/' },
|
|
|
|
{ alias: '@graphql/', matcher: '^src/graphql/' },
|
|
|
|
{ alias: '@graphql-mock/', matcher: '^src/graphql-mock/' },
|
|
|
|
{ alias: '@images/', matcher: '^src/images/' },
|
|
|
|
{ alias: '@providers/', matcher: '^src/providers/' },
|
|
|
|
{ alias: '@utils/', matcher: '^src/utils/' },
|
|
|
|
{ alias: '@types', matcher: '^src/types.generated' },
|
|
|
|
{ alias: '@src/', matcher: '^src/' },
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2021-01-17 12:54:49 -08:00
|
|
|
},
|
|
|
|
settings: {
|
|
|
|
react: {
|
|
|
|
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
|
|
|
|
},
|
|
|
|
},
|
2025-04-16 16:55:38 -07:00
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
files: ['src/app/searchV2/**/*.tsx', 'src/app/entityV2/**/*.tsx'],
|
2025-04-22 13:05:16 -07:00
|
|
|
rules: { 'import/no-cycle': 'off' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
files: ['src/alchemy-components/theme/**/*.ts'],
|
|
|
|
rules: { 'import/no-relative-packages': 'off', 'import-alias/import-alias': 'off' },
|
2025-04-16 16:55:38 -07:00
|
|
|
},
|
|
|
|
],
|
2021-01-17 12:54:49 -08:00
|
|
|
};
|