-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
4b83223
commit 82e679e
Showing
6 changed files
with
3,004 additions
and
3,074 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import path from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
|
||
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat'; | ||
import { FlatCompat } from '@eslint/eslintrc'; | ||
import js from '@eslint/js'; | ||
import tsParser from '@typescript-eslint/parser'; | ||
import prettierConfig from 'eslint-config-prettier'; | ||
import importPlugin from 'eslint-plugin-import'; | ||
import prettierPlugin from 'eslint-plugin-prettier'; | ||
import reactRefresh from 'eslint-plugin-react-refresh'; | ||
import globals from 'globals'; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all, | ||
}); | ||
|
||
export default [ | ||
{ | ||
ignores: ['**/dist', '**/eslint.config.mjs'], | ||
}, | ||
...fixupConfigRules( | ||
compat.extends( | ||
'prettier', | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:jsx-a11y/recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:import/typescript', | ||
'plugin:react/jsx-runtime', | ||
'plugin:react-hooks/recommended', | ||
'plugin:prettier/recommended', | ||
'plugin:@next/next/recommended', | ||
), | ||
), | ||
{ | ||
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx', '**/*.mjs', '**/*.cjs'], | ||
plugins: { | ||
'react-refresh': reactRefresh, | ||
import: fixupPluginRules(importPlugin), | ||
prettier: fixupPluginRules(prettierPlugin), | ||
}, | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
}, | ||
parser: tsParser, | ||
}, | ||
rules: { | ||
'import/order': [ | ||
'error', | ||
{ | ||
// Enforce a specific import order | ||
groups: ['builtin', 'external', 'parent', 'sibling', 'index'], | ||
'newlines-between': 'always', | ||
alphabetize: { | ||
order: 'asc', | ||
caseInsensitive: false, | ||
}, | ||
}, | ||
], | ||
'import/no-duplicates': 'error', | ||
// Prettier plugin to apply formatting rules | ||
'prettier/prettier': 'error', // This tells ESLint to show Prettier errors as ESLint errors | ||
}, | ||
settings: { | ||
// Spread Prettier config to disable conflicting ESLint rules | ||
...prettierConfig, | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
}, | ||
]; |
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.