mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 18:01:09 +02:00
🔧 chore: add root ESLint config and enable lint in pre-commit
- Add eslint.config.mjs at root with TypeScript/JS rules - Configure lint-staged to run ESLint --fix on JS/TS files - Add ESLint dependencies to root package.json - Set "type": "module" in package.json to fix module warning - Ignore projects with their own ESLint configs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
0086e33910
commit
fd962c30b2
4 changed files with 371 additions and 331 deletions
67
eslint.config.mjs
Normal file
67
eslint.config.mjs
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
// @ts-check
|
||||
import eslint from '@eslint/js';
|
||||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
||||
import globals from 'globals';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
/**
|
||||
* Root ESLint config for the monorepo.
|
||||
* Individual projects can override with their own eslint.config.* files.
|
||||
*/
|
||||
export default tseslint.config(
|
||||
// Global ignores
|
||||
{
|
||||
ignores: [
|
||||
'**/node_modules/**',
|
||||
'**/dist/**',
|
||||
'**/build/**',
|
||||
'**/.svelte-kit/**',
|
||||
'**/.expo/**',
|
||||
'**/.next/**',
|
||||
'**/coverage/**',
|
||||
'**/apps-archived/**',
|
||||
// Ignore projects with their own ESLint configs
|
||||
'apps/manadeck/apps/mobile/**',
|
||||
'apps/picture/apps/mobile/**',
|
||||
'apps/picture/apps/web/**',
|
||||
'games/voxel-lava/apps/web/**',
|
||||
],
|
||||
},
|
||||
// Base JavaScript rules
|
||||
eslint.configs.recommended,
|
||||
// TypeScript rules (without type-checking for speed)
|
||||
...tseslint.configs.recommended,
|
||||
// Prettier integration
|
||||
eslintPluginPrettierRecommended,
|
||||
// Global settings
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.browser,
|
||||
...globals.es2022,
|
||||
},
|
||||
ecmaVersion: 2022,
|
||||
sourceType: 'module',
|
||||
},
|
||||
},
|
||||
// TypeScript-specific rules (relaxed for monorepo compatibility)
|
||||
{
|
||||
files: ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'warn',
|
||||
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
||||
],
|
||||
'@typescript-eslint/no-require-imports': 'off',
|
||||
},
|
||||
},
|
||||
// JavaScript-specific rules
|
||||
{
|
||||
files: ['**/*.js', '**/*.jsx', '**/*.mjs', '**/*.cjs'],
|
||||
rules: {
|
||||
'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
|
||||
},
|
||||
}
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue