64 lines
1.8 KiB
JavaScript
64 lines
1.8 KiB
JavaScript
// 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 { globalIgnores } from 'eslint/config'
|
|
|
|
// export default tseslint.config([
|
|
// globalIgnores(['dist']),
|
|
// {
|
|
// files: ['**/*.{ts,tsx}'],
|
|
// extends: [
|
|
// js.configs.recommended,
|
|
// tseslint.configs.recommended,
|
|
// reactHooks.configs['recommended-latest'],
|
|
// reactRefresh.configs.vite,
|
|
// ],
|
|
// languageOptions: {
|
|
// ecmaVersion: 2020,
|
|
// globals: globals.browser,
|
|
// },
|
|
// },
|
|
// ])
|
|
|
|
import antfu from '@antfu/eslint-config';
|
|
|
|
const lintConfig = antfu(
|
|
{
|
|
lessOpinionated: true,
|
|
|
|
formatters: true,
|
|
ignores: ['**/node_modules', '**/dist'],
|
|
react: true,
|
|
stylistic: {
|
|
indent: 2,
|
|
quotes: 'single',
|
|
semi: true,
|
|
},
|
|
},
|
|
{
|
|
rules: {
|
|
'antfu/if-newline': 'off',
|
|
'antfu/no-top-level-await': 'off',
|
|
'eslint-comments/no-unlimited-disable': ['off'],
|
|
'no-console': ['off'],
|
|
'perfectionist/sort-imports': ['error', {
|
|
tsconfigRootDir: '.',
|
|
}],
|
|
'style/max-statements-per-line': ['error', { max: 2 }],
|
|
'style/brace-style': ['error', '1tbs', { allowSingleLine: true }],
|
|
'style/jsx-quotes': ['error', 'prefer-single'],
|
|
'ts/consistent-type-definitions': ['off'],
|
|
'ts/no-empty-object-type': ['off'],
|
|
// 'no-console': ['warn'],
|
|
// 'no-restricted-syntax': ['error', {
|
|
// selector: 'CallExpression[callee.property.name=\'forEach\'] > :matches(ArrowFunctionExpression, FunctionExpression)[async=true].arguments',
|
|
// message: 'Do not use async functions in .forEach()',
|
|
// }],
|
|
},
|
|
},
|
|
);
|
|
|
|
export default lintConfig;
|