UNPKG

@nextcloud/eslint-config

Version:

Eslint shared config for nextcloud apps and libraries

31 lines (30 loc) 1.02 kB
import vuePlugin from 'eslint-plugin-vue'; import { GLOB_FILES_VUE } from "../globs.js"; import { restrictConfigFiles } from "../utils.js"; import { vue } from "./vue.js"; /** * Vue2 related ESLint rules for Nextcloud * * @param option options defining the config preset flavor */ export function vue2(option) { return [ ...restrictConfigFiles(vuePlugin.configs['flat/vue2-recommended'], GLOB_FILES_VUE), ...vue(option), { rules: { // Force kebab-case for custom event name definitions (recommended by Vue 2 documentation) 'vue/custom-event-name-casing': [ 'error', 'kebab-case', { // Allow namespace formats namespace:event ignores: ['/^[a-z]+(?:-[a-z]+)*:[a-z]+(?:-[a-z]+)*$/u'], }, ], }, files: GLOB_FILES_VUE, name: 'nextcloud/vue2/rules', }, ]; }