* Upgrade ESLint and related configurations to version 9 - Update ESLint to version 9.19.0 - Migrate ESLint configurations to flat config format - Remove deprecated ESLint config files - Update package dependencies and configurations - Simplify ESLint setup across packages - Remove unnecessary ESLint config blocks from package.json files - Improved CI caching with Turborepo tasks - Removed duplicate styles
93 lines
2.4 KiB
JavaScript
93 lines
2.4 KiB
JavaScript
import eslint from '@eslint/js';
|
|
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
import eslintReact from 'eslint-plugin-react';
|
|
import reactPlugin from 'eslint-plugin-react';
|
|
import hooksPlugin from 'eslint-plugin-react-hooks';
|
|
import tsEsLint from 'typescript-eslint';
|
|
|
|
import nextConfig from './nextjs.js';
|
|
|
|
export default tsEsLint.config(
|
|
eslint.configs.recommended,
|
|
tsEsLint.configs.recommended,
|
|
eslintReact.configs.flat.recommended,
|
|
{
|
|
languageOptions: {
|
|
parserOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: 'module',
|
|
ecmaFeatures: {
|
|
jsx: true,
|
|
modules: true,
|
|
},
|
|
projectService: true,
|
|
tsconfigRootDir: import.meta.dirname,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
settings: {
|
|
react: {
|
|
version: 'detect',
|
|
},
|
|
},
|
|
},
|
|
{
|
|
plugins: {
|
|
'react-hooks': hooksPlugin,
|
|
},
|
|
rules: hooksPlugin.configs.recommended.rules,
|
|
},
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
...reactPlugin.configs.flat['jsx-runtime'],
|
|
...reactPlugin.configs.flat.recommended,
|
|
},
|
|
nextConfig,
|
|
eslintConfigPrettier,
|
|
{
|
|
rules: {
|
|
'react/react-in-jsx-scope': 'off',
|
|
'import/no-anonymous-default-export': 'off',
|
|
'turbo/no-undeclared-env-vars': 'off',
|
|
'@typescript-eslint/array-type': 'off',
|
|
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
'@typescript-eslint/consistent-type-definitions': 'off',
|
|
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
|
|
'@typescript-eslint/only-throw-error': 'off',
|
|
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
|
],
|
|
'@typescript-eslint/no-misused-promises': [
|
|
2,
|
|
{ checksVoidReturn: { attributes: false } },
|
|
],
|
|
'no-restricted-imports': [
|
|
'error',
|
|
{
|
|
paths: [
|
|
{
|
|
name: 'react-i18next',
|
|
importNames: ['Trans'],
|
|
message: 'Please use `@kit/ui/trans` instead',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
ignores: [
|
|
'**/node_modules',
|
|
'**/database.types.ts',
|
|
'.next',
|
|
'dist',
|
|
'pnpm-lock.yaml',
|
|
],
|
|
},
|
|
);
|