Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .eslintrc.cjs

This file was deleted.

21 changes: 21 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Dependencies
node_modules/

# Build outputs
.next/
out/
dist-tests/

# Public assets
public/

# WASM files
wasm/

# Package manager files
package-lock.json
pnpm-lock.yaml

# Generated files
*.min.js
*.min.css
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"printWidth": 100,
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "lf"
}
49 changes: 49 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import nextConfig from 'eslint-config-next';
import eslintConfigPrettier from 'eslint-config-prettier';
import tseslint from 'typescript-eslint';

const eslintConfig = [
// Global ignores (must be first)
{
ignores: [
'dist-tests/',
'node_modules/',
'public/',
'wasm/',
'.next/',
'out/',
],
},

// Next.js recommended config (includes TypeScript ESLint, React, etc.)
...nextConfig,
Comment on lines +18 to +19

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Replace invalid spread of eslint-config-next

Because eslint-config-next exports a single legacy config object (not an array), ...nextConfig will throw a TypeError: object is not iterable as soon as ESLint loads eslint.config.mjs, so npm run lint will fail before any rules execute. This happens whenever the lint config is evaluated, so CI/dev linting is broken until the Next config is adapted (e.g., via FlatCompat or by using a flat-config export).

Useful? React with 👍 / 👎.


// TypeScript-specific rule overrides
{
files: ['**/*.ts', '**/*.tsx'],
plugins: {
'@typescript-eslint': tseslint.plugin,
},
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
},
},

// General rules for all files
{
rules: {
'no-console': ['warn', { allow: ['warn', 'error'] }],
'prefer-const': 'error',
eqeqeq: ['error', 'always'],
},
},

// Prettier config (must be last to override formatting rules)
eslintConfigPrettier,
];

export default eslintConfig;
Loading
Loading