-
Notifications
You must be signed in to change notification settings - Fork 44
[Dashboard] - Refactor linter #3375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
45ebe65
refacor: using modern flat eslint config, add some rules, change a pa…
KirillKirill 46343c1
fix: lint
KirillKirill 0116b3a
fix: install dependencies
KirillKirill c41dacf
refactor: sort and order imports
KirillKirill a4ff8a3
feat: add lint-staged
KirillKirill a10b3de
refactor: eslint config and ts config per feedback
KirillKirill e44dad7
fix: replace with tseslint.config
KirillKirill 1a81772
bump eslint
KirillKirill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| import eslint from '@eslint/js'; | ||
| import tseslint from 'typescript-eslint'; | ||
| import reactPlugin from 'eslint-plugin-react'; | ||
| import reactHooksPlugin from 'eslint-plugin-react-hooks'; | ||
| import prettierPlugin from 'eslint-plugin-prettier'; | ||
| import importPlugin from 'eslint-plugin-import'; | ||
| import globals from 'globals'; | ||
|
|
||
| export default tseslint.config( | ||
| { | ||
| ignores: ['dist/', 'tsconfig.json'], | ||
| }, | ||
| eslint.configs.recommended, | ||
| tseslint.configs.recommended, | ||
| { | ||
| files: ['**/*.ts', '**/*.tsx'], | ||
| languageOptions: { | ||
| ecmaVersion: 2022, | ||
| sourceType: 'module', | ||
| parser: tseslint.parser, | ||
| parserOptions: { | ||
| ecmaFeatures: { | ||
| jsx: true, | ||
| }, | ||
| projectService: true, | ||
| }, | ||
| globals: { | ||
| ...globals.browser, | ||
| ...globals.es2022, | ||
| }, | ||
| }, | ||
| plugins: { | ||
| react: reactPlugin, | ||
| 'react-hooks': reactHooksPlugin, | ||
| prettier: prettierPlugin, | ||
| import: importPlugin, | ||
| }, | ||
| settings: { | ||
| react: { | ||
| version: 'detect', | ||
| }, | ||
| 'import/resolver': { | ||
| typescript: { | ||
| alwaysTryTypes: true, | ||
| }, | ||
| }, | ||
| }, | ||
| rules: { | ||
| 'react/prop-types': 'off', | ||
| 'react/display-name': 'off', | ||
| 'react/react-in-jsx-scope': 'off', | ||
| 'react-hooks/exhaustive-deps': 'warn', | ||
| 'react-hooks/rules-of-hooks': 'error', | ||
| 'import/order': [ | ||
| 'error', | ||
| { | ||
| 'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], | ||
| 'pathGroups': [ | ||
| { | ||
| 'pattern': 'react', | ||
| 'group': 'external', | ||
| 'position': 'before' | ||
| } | ||
| ], | ||
| 'pathGroupsExcludedImportTypes': ['react'], | ||
| 'newlines-between': 'always', | ||
| 'alphabetize': { | ||
| 'order': 'asc', | ||
| 'caseInsensitive': true | ||
| } | ||
| } | ||
| ], | ||
| 'import/no-duplicates': 'error', | ||
| 'import/no-unresolved': 'error', | ||
| '@typescript-eslint/no-unused-vars': ['error', { 'argsIgnorePattern': '^_' }], | ||
| '@typescript-eslint/no-explicit-any': 'error', | ||
| 'no-console': ['error', { allow: ['warn', 'error'] }], | ||
| quotes: [ | ||
| 'error', | ||
| 'single', | ||
| { | ||
| avoidEscape: true, | ||
| }, | ||
| ], | ||
| 'no-restricted-imports': [ | ||
| 'error', | ||
| { | ||
| paths: [ | ||
| { | ||
| name: 'lodash', | ||
| message: | ||
| 'Please import only specific modules from lodash to reduce bundle size. Instead of import {compact} from `lodash`, import compact from lodash/compact', | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }, | ||
| } | ||
| ); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
packages/apps/dashboard/client/src/components/Breadcrumbs/Breadcrumbs.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 9 additions & 7 deletions
16
packages/apps/dashboard/client/src/components/Charts/CustomChartTooltip.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
packages/apps/dashboard/client/src/components/Charts/CustomXAxisTick.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
packages/apps/dashboard/client/src/components/Charts/ToggleCharts.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
packages/apps/dashboard/client/src/components/Clipboard/Clipboard.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
packages/apps/dashboard/client/src/components/DataEntry/DatePicker.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
packages/apps/dashboard/client/src/components/DataEntry/ToggleButtons.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
packages/apps/dashboard/client/src/components/Footer/Footer.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
packages/apps/dashboard/client/src/components/Header/Header.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.