2017-04-27 16:09:40 +00:00
|
|
|
env:
|
|
|
|
browser: true
|
|
|
|
jquery: true
|
2019-03-21 05:46:49 +00:00
|
|
|
node: true
|
2019-05-24 06:04:58 +00:00
|
|
|
es6: true
|
2019-03-21 05:46:49 +00:00
|
|
|
|
|
|
|
globals:
|
|
|
|
angular: true
|
2017-04-27 16:09:40 +00:00
|
|
|
|
|
|
|
extends:
|
|
|
|
- 'eslint:recommended'
|
2021-12-16 18:52:54 +00:00
|
|
|
- 'plugin:storybook/recommended'
|
2024-02-15 15:46:03 +00:00
|
|
|
- 'plugin:import/typescript'
|
2020-04-14 23:46:34 +00:00
|
|
|
- prettier
|
|
|
|
|
|
|
|
plugins:
|
|
|
|
- import
|
2017-04-27 16:09:40 +00:00
|
|
|
|
2019-03-21 05:46:49 +00:00
|
|
|
parserOptions:
|
|
|
|
ecmaVersion: 2018
|
|
|
|
sourceType: module
|
2021-11-03 10:41:59 +00:00
|
|
|
project: './tsconfig.json'
|
2019-03-21 05:46:49 +00:00
|
|
|
ecmaFeatures:
|
|
|
|
modules: true
|
|
|
|
|
2017-04-27 16:09:40 +00:00
|
|
|
rules:
|
2024-01-02 06:42:48 +00:00
|
|
|
no-console: error
|
2023-09-25 16:36:50 +00:00
|
|
|
no-alert: error
|
2021-11-03 10:41:59 +00:00
|
|
|
no-control-regex: 'off'
|
2019-03-21 05:46:49 +00:00
|
|
|
no-empty: warn
|
|
|
|
no-empty-function: warn
|
2021-11-03 10:41:59 +00:00
|
|
|
no-useless-escape: 'off'
|
2024-02-15 15:46:03 +00:00
|
|
|
import/named: error
|
2021-11-03 10:41:59 +00:00
|
|
|
import/order:
|
|
|
|
[
|
|
|
|
'error',
|
|
|
|
{
|
2022-06-17 16:18:42 +00:00
|
|
|
pathGroups:
|
|
|
|
[
|
|
|
|
{ pattern: '@@/**', group: 'internal', position: 'after' },
|
|
|
|
{ pattern: '@/**', group: 'internal' },
|
|
|
|
{ pattern: '{Kubernetes,Portainer,Agent,Azure,Docker}/**', group: 'internal' },
|
|
|
|
],
|
2021-11-03 10:41:59 +00:00
|
|
|
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
|
|
|
|
pathGroupsExcludedImportTypes: ['internal'],
|
|
|
|
},
|
|
|
|
]
|
2024-03-10 12:22:01 +00:00
|
|
|
no-restricted-imports:
|
|
|
|
- error
|
|
|
|
- patterns:
|
|
|
|
- group:
|
|
|
|
- '@/react/test-utils/*'
|
|
|
|
message: 'These utils are just for test files'
|
2021-11-03 10:41:59 +00:00
|
|
|
|
|
|
|
settings:
|
|
|
|
'import/resolver':
|
|
|
|
alias:
|
|
|
|
map:
|
2022-06-17 16:18:42 +00:00
|
|
|
- ['@@', './app/react/components']
|
2021-11-03 10:41:59 +00:00
|
|
|
- ['@', './app']
|
|
|
|
extensions: ['.js', '.ts', '.tsx']
|
2024-02-15 15:46:03 +00:00
|
|
|
typescript: true
|
|
|
|
node: true
|
2021-11-03 10:41:59 +00:00
|
|
|
|
|
|
|
overrides:
|
|
|
|
- files:
|
|
|
|
- app/**/*.ts{,x}
|
|
|
|
parserOptions:
|
|
|
|
project: './tsconfig.json'
|
|
|
|
parser: '@typescript-eslint/parser'
|
|
|
|
plugins:
|
|
|
|
- '@typescript-eslint'
|
2022-06-23 06:32:18 +00:00
|
|
|
- 'regex'
|
2021-11-03 10:41:59 +00:00
|
|
|
extends:
|
|
|
|
- airbnb
|
|
|
|
- airbnb-typescript
|
|
|
|
- 'plugin:eslint-comments/recommended'
|
|
|
|
- 'plugin:react-hooks/recommended'
|
|
|
|
- 'plugin:react/jsx-runtime'
|
|
|
|
- 'plugin:@typescript-eslint/recommended'
|
|
|
|
- 'plugin:@typescript-eslint/eslint-recommended'
|
|
|
|
- 'plugin:promise/recommended'
|
2021-12-16 18:52:54 +00:00
|
|
|
- 'plugin:storybook/recommended'
|
2021-11-03 10:41:59 +00:00
|
|
|
- prettier # should be last
|
|
|
|
settings:
|
|
|
|
react:
|
|
|
|
version: 'detect'
|
2024-02-15 15:46:03 +00:00
|
|
|
|
2021-11-03 10:41:59 +00:00
|
|
|
rules:
|
|
|
|
import/order:
|
2022-06-17 16:18:42 +00:00
|
|
|
[
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
pathGroups: [{ pattern: '@@/**', group: 'internal', position: 'after' }, { pattern: '@/**', group: 'internal' }],
|
|
|
|
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
|
|
|
|
'newlines-between': 'always',
|
|
|
|
},
|
|
|
|
]
|
2023-01-19 13:31:49 +00:00
|
|
|
no-plusplus: off
|
2021-11-03 10:41:59 +00:00
|
|
|
func-style: [error, 'declaration']
|
|
|
|
import/prefer-default-export: off
|
2023-09-25 16:36:50 +00:00
|
|
|
no-use-before-define: 'off'
|
|
|
|
'@typescript-eslint/no-use-before-define': ['error', { functions: false, 'allowNamedExports': true }]
|
2021-11-03 10:41:59 +00:00
|
|
|
no-shadow: 'off'
|
|
|
|
'@typescript-eslint/no-shadow': off
|
|
|
|
jsx-a11y/no-autofocus: warn
|
|
|
|
react/forbid-prop-types: off
|
|
|
|
react/require-default-props: off
|
|
|
|
react/no-array-index-key: off
|
2022-01-03 15:49:59 +00:00
|
|
|
no-underscore-dangle: off
|
2021-11-03 10:41:59 +00:00
|
|
|
react/jsx-filename-extension: [0]
|
|
|
|
import/no-extraneous-dependencies: ['error', { devDependencies: true }]
|
|
|
|
'@typescript-eslint/explicit-module-boundary-types': off
|
|
|
|
'@typescript-eslint/no-unused-vars': 'error'
|
|
|
|
'@typescript-eslint/no-explicit-any': 'error'
|
2022-12-13 20:56:09 +00:00
|
|
|
'jsx-a11y/label-has-associated-control': ['error', { 'assert': 'either', controlComponents: ['Input', 'Checkbox'] }]
|
2021-12-16 18:52:54 +00:00
|
|
|
'react/function-component-definition': ['error', { 'namedComponents': 'function-declaration' }]
|
|
|
|
'react/jsx-no-bind': off
|
2022-01-04 12:16:09 +00:00
|
|
|
'no-await-in-loop': 'off'
|
|
|
|
'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }]
|
2022-11-28 02:00:28 +00:00
|
|
|
'regex/invalid': ['error', [{ 'regex': '<Icon icon="(.*)"', 'message': 'Please directly import the `lucide-react` icon instead of using the string' }]]
|
2024-03-10 12:22:01 +00:00
|
|
|
'@typescript-eslint/no-restricted-imports':
|
|
|
|
- error
|
|
|
|
- patterns:
|
|
|
|
- group:
|
|
|
|
- '@/react/test-utils/*'
|
|
|
|
message: 'These utils are just for test files'
|
2022-12-11 06:58:22 +00:00
|
|
|
overrides: # allow props spreading for hoc files
|
|
|
|
- files:
|
|
|
|
- app/**/with*.ts{,x}
|
|
|
|
rules:
|
|
|
|
'react/jsx-props-no-spreading': off
|
2021-11-03 10:41:59 +00:00
|
|
|
- files:
|
|
|
|
- app/**/*.test.*
|
|
|
|
extends:
|
2024-01-23 06:42:52 +00:00
|
|
|
- 'plugin:vitest/recommended'
|
2021-11-03 10:41:59 +00:00
|
|
|
env:
|
2024-01-23 06:42:52 +00:00
|
|
|
'vitest/env': true
|
2021-12-30 15:46:12 +00:00
|
|
|
rules:
|
|
|
|
'react/jsx-no-constructed-context-values': off
|
2024-03-10 12:22:01 +00:00
|
|
|
'@typescript-eslint/no-restricted-imports': off
|
|
|
|
no-restricted-imports: off
|
2024-03-27 07:56:00 +00:00
|
|
|
'react/jsx-props-no-spreading': off
|
2022-01-17 05:53:32 +00:00
|
|
|
- files:
|
|
|
|
- app/**/*.stories.*
|
|
|
|
rules:
|
|
|
|
'no-alert': off
|
2024-03-10 12:22:01 +00:00
|
|
|
'@typescript-eslint/no-restricted-imports': off
|
|
|
|
no-restricted-imports: off
|
2024-03-27 07:56:00 +00:00
|
|
|
'react/jsx-props-no-spreading': off
|