-
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update ESLint configuration and improve code structure (#515)
* chore: update ESLint configuration and improve code structure * chore: comment out ESLint configuration in Rollup config * fix build issues * chore: optimize icon rendering in timeline components using useMemo * refactor: improve list item click handling with useCallback
- Loading branch information
1 parent
e604836
commit 7bb14b8
Showing
24 changed files
with
1,011 additions
and
491 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
|
@@ -47,3 +47,7 @@ react-test-bed | |
|
||
# Ignore Gradle build output directory | ||
build | ||
|
||
## Panda | ||
styled-system | ||
styled-system-studio |
This file contains 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,73 @@ | ||
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat'; | ||
import _import from 'eslint-plugin-import'; | ||
import react from 'eslint-plugin-react'; | ||
import typescriptEslint from '@typescript-eslint/eslint-plugin'; | ||
import jsxA11Y from 'eslint-plugin-jsx-a11y'; | ||
import typescriptSortKeys from 'eslint-plugin-typescript-sort-keys'; | ||
import sortKeysFix from 'eslint-plugin-sort-keys-fix'; | ||
import globals from 'globals'; | ||
import tsParser from '@typescript-eslint/parser'; | ||
import path from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
import js from '@eslint/js'; | ||
import { FlatCompat } from '@eslint/eslintrc'; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
allConfig: js.configs.all, | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
}); | ||
|
||
export default [ | ||
{ | ||
ignores: ['src/demo/*', 'src/assets/*', 'src/examples/*'], | ||
}, | ||
...fixupConfigRules( | ||
compat.extends( | ||
'plugin:import/typescript', | ||
'plugin:react/recommended', | ||
'prettier', | ||
'plugin:react/jsx-runtime', | ||
), | ||
), | ||
{ | ||
languageOptions: { | ||
ecmaVersion: 12, | ||
|
||
globals: { | ||
...globals.browser, | ||
}, | ||
parser: tsParser, | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
|
||
sourceType: 'module', | ||
}, | ||
|
||
plugins: { | ||
'@typescript-eslint': typescriptEslint, | ||
import: fixupPluginRules(_import), | ||
'jsx-a11y': jsxA11Y, | ||
react: fixupPluginRules(react), | ||
'sort-keys-fix': sortKeysFix, | ||
'typescript-sort-keys': typescriptSortKeys, | ||
}, | ||
|
||
rules: { | ||
'sort-keys-fix/sort-keys-fix': 'error', | ||
'typescript-sort-keys/interface': 'error', | ||
'typescript-sort-keys/string-enum': 'error', | ||
}, | ||
|
||
settings: { | ||
react: { | ||
version: '18.1.0', | ||
}, | ||
}, | ||
}, | ||
]; |
This file contains 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.