lwc-linter
Version:
A comprehensive CLI tool for linting Lightning Web Components v8.0.0+ with modern LWC patterns, decorators, lifecycle hooks, and Salesforce platform integration
54 lines (50 loc) • 1.53 kB
JavaScript
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
project: './tsconfig.json',
},
plugins: ['prettier'],
extends: [
'eslint:recommended',
'prettier',
],
rules: {
// Prettier integration
'prettier/prettier': 'error',
// TypeScript specific rules (simplified for publishing)
'no-unused-vars': 'error',
// General ESLint rules
'no-console': 'warn',
'no-debugger': 'error',
'no-alert': 'error',
'no-eval': 'error',
'no-implied-eval': 'error',
'no-var': 'error',
'prefer-const': 'error',
'eqeqeq': 'error',
'curly': 'error',
'no-multi-spaces': 'error',
'no-trailing-spaces': 'error',
'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 1 }],
'comma-dangle': ['error', 'always-multiline'],
'semi': ['error', 'always'],
'quotes': ['error', 'single', { avoidEscape: true }],
// Code quality rules
'complexity': ['warn', { max: 10 }],
'max-depth': ['warn', { max: 4 }],
'max-lines-per-function': ['warn', { max: 50, skipBlankLines: true, skipComments: true }],
'max-params': ['warn', { max: 4 }],
'no-magic-numbers': ['warn', { ignore: [0, 1, -1], ignoreArrayIndexes: true }],
// Import rules
'sort-imports': ['error', { ignoreDeclarationSort: true }],
},
env: {
node: true,
es2022: true,
jest: true,
},
ignorePatterns: ['lib/', 'node_modules/', '*.js', '!.eslintrc.js'],
};