Instruction file imported from madelk/learning (
.github/instructions/eslint.instructions.md). Copyright stays with the author.
ESLint Quick Fixes
Prettier Integration
To prevent ESLint and Prettier conflicts, use eslint-config-prettier:
import prettier from 'eslint-config-prettier';
export default [
// ...other configs
prettier // Apply last to override conflicting rules
];
Ensure .prettierrc matches ESLint style rules:
{
"singleQuote": true,
"trailingComma": "none"
}
Vite Dependency Error Fix
When libraries use Vite build tools, add this to eslint.config.mjs:
{
rules: {
'@nx/dependency-checks': [
'error',
{
ignoredDependencies: ['vite', 'vite-plugin-dts']
}
]
}
}
Prevents lint errors when build tools are in workspace root devDependencies.
Style Rules
Rules in the root eslint.config.mjs apply to all files in the workspace:
{
files: [
'**/*.ts',
'**/*.tsx',
'**/*.js',
'**/*.jsx',
'**/*.cjs',
'**/*.mjs'
],
rules: {
'comma-dangle': ['error', 'never'] // No trailing commas
}
}
Note: Update this file when you find other common ESLint issues