-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
312 additions
and
488 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import { createSerializer } from '@emotion/jest'; | ||
import { setProjectAnnotations } from '@storybook/react'; | ||
|
||
import globalStorybookConfig from '../.storybook/preview'; | ||
import { createSerializer } from '@emotion/jest'; | ||
|
||
setProjectAnnotations([globalStorybookConfig]); | ||
|
||
expect.addSnapshotSerializer(createSerializer()); |
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,97 @@ | ||
import js from '@eslint/js'; | ||
import globals from 'globals'; | ||
import reactHooks from 'eslint-plugin-react-hooks'; | ||
import reactRefresh from 'eslint-plugin-react-refresh'; | ||
import tseslint from 'typescript-eslint'; | ||
import unusedImports from 'eslint-plugin-unused-imports'; | ||
import eslintPluginImportX from 'eslint-plugin-import-x'; | ||
import eslintConfigPrettier from 'eslint-config-prettier'; | ||
import vitest from '@vitest/eslint-plugin'; | ||
|
||
export default tseslint.config( | ||
{ ignores: ['dist', 'coverage'] }, | ||
{ | ||
extends: [ | ||
js.configs.recommended, | ||
...tseslint.configs.recommended, | ||
eslintPluginImportX.flatConfigs.recommended, | ||
eslintPluginImportX.flatConfigs.typescript, | ||
eslintConfigPrettier, | ||
], | ||
files: ['**/*.{ts,tsx}'], | ||
languageOptions: { | ||
ecmaVersion: 2020, | ||
globals: globals.browser, | ||
}, | ||
plugins: { | ||
'react-hooks': reactHooks, | ||
'react-refresh': reactRefresh, | ||
'unused-imports': unusedImports, | ||
}, | ||
rules: { | ||
...reactHooks.configs.recommended.rules, | ||
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'unused-imports/no-unused-imports': 'error', | ||
'unused-imports/no-unused-vars': [ | ||
'warn', | ||
{ | ||
vars: 'all', | ||
varsIgnorePattern: '^_', | ||
args: 'after-used', | ||
argsIgnorePattern: '^_', | ||
}, | ||
], | ||
'import-x/order': [ | ||
'error', | ||
{ | ||
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'], | ||
'newlines-between': 'always', | ||
alphabetize: { | ||
order: 'asc', | ||
caseInsensitive: true, | ||
}, | ||
pathGroups: [ | ||
{ | ||
pattern: '{react,react-dom/**}', | ||
group: 'builtin', | ||
position: 'before', | ||
}, | ||
{ | ||
pattern: '~/**', | ||
group: 'parent', | ||
position: 'before', | ||
}, | ||
], | ||
pathGroupsExcludedImportTypes: ['builtin'], | ||
}, | ||
], | ||
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }], | ||
}, | ||
settings: { | ||
'import-x/parsers': { | ||
'@typescript-eslint/parser': ['.ts', '.tsx'], | ||
}, | ||
'import-x/resolver': { | ||
typescript: true, | ||
node: true, | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.stories.{ts,tsx}'], | ||
rules: { | ||
'react-hooks/rules-of-hooks': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.test.{ts,tsx}'], // or any other pattern | ||
plugins: { | ||
vitest, | ||
}, | ||
rules: { | ||
...vitest.configs.recommended.rules, // you can also use vitest.configs.all.rules to enable all rules | ||
'vitest/max-nested-describe': ['error', { max: 3 }], // you can also modify rules' behavior using option like this | ||
}, | ||
} | ||
); |
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.