Configurazione ESLint
Configurazione completa ESLint per progetti JavaScript PANDEV con Standard Style e supporto multi-framework.
๐ ๏ธ Setup Base
Installazione Dependencies
# Core ESLint
npm install --save-dev eslint
# Standard config
npm install --save-dev eslint-config-standard
npm install --save-dev eslint-plugin-import
npm install --save-dev eslint-plugin-node
npm install --save-dev eslint-plugin-promise
# Prettier integration
npm install --save-dev eslint-config-prettier
npm install --save-dev eslint-plugin-prettierFile .eslintrc.js Standard
module.exports = {
root: true,
extends: [
'standard',
'prettier'
],
plugins: ['prettier'],
env: {
browser: true,
node: true,
es2022: true
},
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module'
},
rules: {
// Prettier integration
'prettier/prettier': 'error',
// Custom PANDEV rules
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
// Code quality
'prefer-const': 'error',
'no-var': 'error',
'object-shorthand': 'error',
'prefer-arrow-callback': 'error',
'prefer-template': 'error',
// Import organization
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index'
],
'newlines-between': 'always'
}
]
}
}๐จ Configurazioni Framework-Specific
React Projects
Vue Projects
Angular Projects
Node.js/Express Projects
๐ File .eslintignore
๐ Scripts Package.json
๐ง VS Code Integration
Workspace Settings
Extensions Consigliate
๐ช Pre-commit Hooks
Setup Husky + lint-staged
Configurazione lint-staged
๐ CI/CD Integration
GitHub Actions
๐๏ธ Configurazioni Avanzate
Performance per Large Codebases
Override per File Specifici
๐ Troubleshooting
Problemi Comuni
ESLint non trova configurazione:
Conflitti Prettier/ESLint:
Performance lente:
Plugin non trovati:
Questa configurazione ESLint garantisce codice consistente e di qualitร per tutti i progetti JavaScript PANDEV.
Last updated
Was this helpful?