|
@@ -7,38 +7,36 @@ module.exports = {
|
|
|
'vue'
|
|
'vue'
|
|
|
],
|
|
],
|
|
|
rules: {
|
|
rules: {
|
|
|
- // Règles générales
|
|
|
|
|
- 'no-console': 'off', // Autoriser l'utilisation de console.log() (peut être personnalisé selon vos besoins)
|
|
|
|
|
- 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', // Interdire l'utilisation de debugger dans les environnements de production
|
|
|
|
|
- 'no-unused-vars': 'warn', // Avertir en cas de variables non utilisées
|
|
|
|
|
|
|
+ 'no-console': 'off',
|
|
|
|
|
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
|
|
|
+ 'no-unused-vars': 'warn',
|
|
|
|
|
|
|
|
- // Règles spécifiques à Vue.js
|
|
|
|
|
- 'vue/attribute-hyphenation': 'error', // Utiliser la notation kebab-case pour les attributs dans les templates
|
|
|
|
|
- 'vue/component-definition-name-casing': ['error', 'PascalCase'], // Utiliser PascalCase pour les noms de composants Vue
|
|
|
|
|
|
|
+ 'vue/attribute-hyphenation': 'error', // enforce attribute naming style on custom components in template
|
|
|
|
|
+ 'vue/component-definition-name-casing': ['error', 'PascalCase'],
|
|
|
'vue/html-closing-bracket-newline': ['error', {
|
|
'vue/html-closing-bracket-newline': ['error', {
|
|
|
- 'singleline': 'never', // Pas de nouvelle ligne après une balise de fermeture en ligne
|
|
|
|
|
- 'multiline': 'always' // Nouvelle ligne après une balise de fermeture multiligne
|
|
|
|
|
|
|
+ 'singleline': 'never',
|
|
|
|
|
+ 'multiline': 'always'
|
|
|
}],
|
|
}],
|
|
|
- 'vue/html-closing-bracket-spacing': ['error', {
|
|
|
|
|
- 'startTag': 'never', // Pas d'espace avant la balise de fermeture
|
|
|
|
|
- 'endTag': 'never', // Pas d'espace avant la balise de fermeture
|
|
|
|
|
- 'selfClosingTag': 'always' // Espace avant la balise de fermeture des balises auto-fermantes
|
|
|
|
|
|
|
+ 'vue/html-closing-bracket-spacing': ['error', { // require or disallow a space before tag closing brackets
|
|
|
|
|
+ 'startTag': 'never',
|
|
|
|
|
+ 'endTag': 'never',
|
|
|
|
|
+ 'selfClosingTag': 'always'
|
|
|
}],
|
|
}],
|
|
|
- 'vue/html-indent': ['error', 2, {
|
|
|
|
|
- 'attribute': 1, // Indentation des attributs
|
|
|
|
|
- 'baseIndent': 1, // Indentation de base du contenu
|
|
|
|
|
- 'closeBracket': 0, // Pas d'indentation pour les balises de fermeture
|
|
|
|
|
- 'alignAttributesVertically': true // Aligner les attributs verticalement
|
|
|
|
|
|
|
+ 'vue/html-indent': ['error', 2, { // enforce consistent indentation in <template>
|
|
|
|
|
+ 'attribute': 1,
|
|
|
|
|
+ 'baseIndent': 1,
|
|
|
|
|
+ 'closeBracket': 0,
|
|
|
|
|
+ 'alignAttributesVertically': true
|
|
|
}],
|
|
}],
|
|
|
- 'vue/max-attributes-per-line': ['error', {
|
|
|
|
|
- 'singleline': 3, // Maximum de 3 attributs par ligne en ligne unique
|
|
|
|
|
|
|
+ 'vue/max-attributes-per-line': ['error', { // enforce the maximum number of attributes per line
|
|
|
|
|
+ 'singleline': 3,
|
|
|
'multiline': {
|
|
'multiline': {
|
|
|
- 'max': 1, // Maximum de 1 attribut par ligne en mode multiligne
|
|
|
|
|
- 'allowFirstLine': false // Interdire les attributs sur la première ligne en mode multiligne
|
|
|
|
|
|
|
+ 'max': 1,
|
|
|
|
|
+ 'allowFirstLine': false
|
|
|
}
|
|
}
|
|
|
}],
|
|
}],
|
|
|
- 'vue/no-v-html': 'off', // Autoriser l'utilisation de v-html
|
|
|
|
|
- 'vue/require-default-prop': 'off', // Ne pas exiger de valeur par défaut pour les props
|
|
|
|
|
- 'vue/singleline-html-element-content-newline': 'off', // Autoriser le contenu en ligne dans les éléments HTML
|
|
|
|
|
|
|
+ 'vue/no-v-html': 'off', // disallow use of v-html to prevent XSS attack
|
|
|
|
|
+ 'vue/require-default-prop': 'off',
|
|
|
|
|
+ 'vue/singleline-html-element-content-newline': 'off',
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|